-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into use-go-redis-session
- Loading branch information
Showing
160 changed files
with
1,752 additions
and
3,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-latest' ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build Docker | ||
run: chmod +x ./scripts/build-docker.sh && ./scripts/build-docker.sh | ||
|
||
- name: Test Print Version | ||
run: chmod +x ./scripts/docker-example/run-gofs-docker-print-version.sh && ./scripts/docker-example/run-gofs-docker-print-version.sh | ||
|
||
- name: Test Checksum | ||
run: chmod +x ./scripts/docker-example/run-gofs-docker-checksum.sh && ./scripts/docker-example/run-gofs-docker-checksum.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Govulncheck | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
go: [ 'stable' ] | ||
os: [ 'ubuntu-latest' ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Scan Vulnerabilities | ||
run: chmod +x ./scripts/govulncheck.sh && ./scripts/govulncheck.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
go: [ 'stable' ] | ||
os: [ 'ubuntu-latest' ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Test Release | ||
run: chmod +x ./scripts/build-release.sh && ./scripts/build-release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package checksum | ||
|
||
import ( | ||
"github.com/no-src/gofs/util/hashutil" | ||
"github.com/no-src/gofs/util/jsonutil" | ||
"github.com/no-src/log" | ||
"github.com/no-src/gofs/logger" | ||
"github.com/no-src/nsgo/hashutil" | ||
"github.com/no-src/nsgo/jsonutil" | ||
) | ||
|
||
// PrintChecksum calculate and print the checksum for file | ||
func PrintChecksum(path string, chunkSize int64, checkpointCount int, algorithm string) error { | ||
func PrintChecksum(path string, chunkSize int64, checkpointCount int, algorithm string, logger *logger.Logger) error { | ||
hash, err := hashutil.NewHash(algorithm) | ||
if err != nil { | ||
log.Error(err, "init hash component error") | ||
logger.Error(err, "init hash component error") | ||
return err | ||
} | ||
hvs, err := hash.CheckpointsHashFromFileName(path, chunkSize, checkpointCount) | ||
if err != nil { | ||
log.Error(err, "calculate file checksum error") | ||
logger.Error(err, "calculate file checksum error") | ||
return err | ||
} | ||
|
||
hvsJson, _ := jsonutil.MarshalIndent(hvs) | ||
log.Log(string(hvsJson)) | ||
logger.Log(string(hvsJson)) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.