refactor: Update dependencies, modernize Hydrun build systems, CI/CD and README conventions
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
This commit is contained in:
59
.github/workflows/hydrun.yaml
vendored
59
.github/workflows/hydrun.yaml
vendored
@@ -6,34 +6,31 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * 0"
|
- cron: "0 0 * * 0"
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.target.runner }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
|
# Tests
|
||||||
- id: test
|
- id: test
|
||||||
src: .
|
src: .
|
||||||
os: golang:bookworm
|
os: golang:bookworm
|
||||||
flags: ""
|
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
|
||||||
cmd: GOFLAGS="-short" ./Hydrunfile test
|
cmd: GOFLAGS="-short" ./Hydrunfile test
|
||||||
dst: out/nonexistent
|
dst: out/nonexistent
|
||||||
- id: go-stfs
|
runner: ubuntu-latest
|
||||||
|
|
||||||
|
# Binaries
|
||||||
|
- id: go.stfs
|
||||||
src: .
|
src: .
|
||||||
os: golang:bookworm
|
os: golang:bookworm
|
||||||
flags: ""
|
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
|
||||||
cmd: ./Hydrunfile go stfs
|
cmd: ./Hydrunfile go stfs
|
||||||
dst: out/*
|
dst: out/*
|
||||||
# Disabled until `gccgo` supports generics/Go 1.21: https://go.dev/doc/install/gccgo
|
runner: ubuntu-latest
|
||||||
# - id: gccgo-stfs
|
|
||||||
# src: .
|
|
||||||
# os: ghcr.io/pojntfx/bagccgop-base-sid
|
|
||||||
# flags: -e '--privileged'
|
|
||||||
# cmd: ./Hydrunfile gccgo stfs
|
|
||||||
# dst: out/*
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
@@ -42,11 +39,17 @@ jobs:
|
|||||||
sudo rm -rf /usr/local/lib/android
|
sudo rm -rf /usr/local/lib/android
|
||||||
sudo rm -rf /opt/ghc
|
sudo rm -rf /opt/ghc
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
- name: Restore ccache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/ccache
|
||||||
|
key: cache-ccache-${{ matrix.target.id }}
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Set up hydrun
|
- name: Set up hydrun
|
||||||
run: |
|
run: |
|
||||||
curl -L -o /tmp/hydrun "https://github.com/pojntfx/hydrun/releases/latest/download/hydrun.linux-$(uname -m)"
|
curl -L -o /tmp/hydrun "https://github.com/pojntfx/hydrun/releases/latest/download/hydrun.linux-$(uname -m)"
|
||||||
@@ -56,21 +59,29 @@ jobs:
|
|||||||
run: hydrun -o ${{ matrix.target.os }} ${{ matrix.target.flags }} "${{ matrix.target.cmd }}"
|
run: hydrun -o ${{ matrix.target.os }} ${{ matrix.target.flags }} "${{ matrix.target.cmd }}"
|
||||||
- name: Fix permissions for output
|
- name: Fix permissions for output
|
||||||
run: sudo chown -R $USER .
|
run: sudo chown -R $USER .
|
||||||
|
- name: Save ccache
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/tmp/ccache
|
||||||
|
key: cache-ccache-${{ matrix.target.id }}
|
||||||
- name: Upload output
|
- name: Upload output
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.target.id }}
|
name: ${{ matrix.target.id }}
|
||||||
path: ${{ matrix.target.dst }}
|
path: ${{ matrix.target.dst }}
|
||||||
|
|
||||||
publish-linux:
|
publish-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
needs: build-linux
|
needs: build-linux
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Download output
|
- name: Download output
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/out
|
path: /tmp/out
|
||||||
- name: Extract branch name
|
- name: Extract branch name
|
||||||
@@ -78,18 +89,16 @@ jobs:
|
|||||||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||||
- name: Publish pre-release to GitHub releases
|
- name: Publish pre-release to GitHub releases
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
tag_name: release-${{ steps.extract_branch.outputs.branch }}
|
||||||
automatic_release_tag: release-${{ steps.extract_branch.outputs.branch }}
|
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: |
|
||||||
/tmp/out/*/*
|
/tmp/out/*/*
|
||||||
- name: Publish release to GitHub releases
|
- name: Publish release to GitHub releases
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: |
|
files: |
|
||||||
/tmp/out/*/*
|
/tmp/out/*/*
|
||||||
|
|||||||
19
Hydrunfile
19
Hydrunfile
@@ -37,22 +37,3 @@ if [ "$1" = "go" ]; then
|
|||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# gccgo
|
|
||||||
if [ "$1" = "gccgo" ]; then
|
|
||||||
# Install native dependencies
|
|
||||||
apt update
|
|
||||||
apt install -y curl git
|
|
||||||
|
|
||||||
# Install bagccgop
|
|
||||||
curl -L -o /tmp/bagccgop "https://github.com/pojntfx/bagccgop/releases/latest/download/bagccgop.linux-$(uname -m)"
|
|
||||||
install /tmp/bagccgop /usr/local/bin
|
|
||||||
|
|
||||||
# Configure Git
|
|
||||||
git config --global --add safe.directory '*'
|
|
||||||
|
|
||||||
# Build
|
|
||||||
GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/arm$|linux/arm64|linux/386|linux/amd64|linux/s390x)' -j1 -b "$2" -n -r 'make depend' -s 'build-essential,automake' -m 'libsqlite3-dev' -p 'make build/stfs DST=$DST' -d out
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
Simple Tape File System (STFS), a file system for tapes and tar files.
|
Simple Tape File System (STFS), a file system for tapes and tar files.
|
||||||
|
|
||||||
⚠️ STFS has not yet been audited! While we try to make it as secure as possible, it has not yet undergone a formal security audit by a third party. Please keep this in mind if you use it for security-critical applications. ⚠️
|
|
||||||
|
|
||||||
[](https://github.com/pojntfx/stfs/actions/workflows/hydrun.yaml)
|
[](https://github.com/pojntfx/stfs/actions/workflows/hydrun.yaml)
|
||||||

|

|
||||||
[](https://pkg.go.dev/github.com/pojntfx/stfs)
|
[](https://pkg.go.dev/github.com/pojntfx/stfs)
|
||||||
[](https://matrix.to/#/#stfs:matrix.org?via=matrix.org)
|
[](https://matrix.to/#/#stfs:matrix.org?via=matrix.org)
|
||||||
|
|
||||||
@@ -13,7 +11,7 @@ Simple Tape File System (STFS), a file system for tapes and tar files.
|
|||||||
|
|
||||||
STFS is a filesystem that brings tapes and tar files into the 21st century.
|
STFS is a filesystem that brings tapes and tar files into the 21st century.
|
||||||
|
|
||||||
It enables you too ...
|
It enables you to:
|
||||||
|
|
||||||
- **Use a tape or tar file like a regular disk**: STFS uses the robust `tar` format and tape technology to provide a fully features filesystem. This makes such storage solutions much for accessible and manageable, while also significantly increasing the performance of everyday operations such as listing and searching for files by using a SQLite-based on-disk index.
|
- **Use a tape or tar file like a regular disk**: STFS uses the robust `tar` format and tape technology to provide a fully features filesystem. This makes such storage solutions much for accessible and manageable, while also significantly increasing the performance of everyday operations such as listing and searching for files by using a SQLite-based on-disk index.
|
||||||
- **Archive data securely**: The integrated transparent, asymmetrical encryption and signature support makes it possible to use almost any tape as a regulations compliant storage medium, while still being able to take advantage of all the benefits of tapes like reduced cost and increased reliability.
|
- **Archive data securely**: The integrated transparent, asymmetrical encryption and signature support makes it possible to use almost any tape as a regulations compliant storage medium, while still being able to take advantage of all the benefits of tapes like reduced cost and increased reliability.
|
||||||
@@ -39,9 +37,17 @@ $ curl -L -o /tmp/stfs "https://github.com/pojntfx/stfs/releases/latest/download
|
|||||||
$ sudo install /tmp/stfs /usr/local/bin
|
$ sudo install /tmp/stfs /usr/local/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On Windows, the following should work (using PowerShell as administrator):
|
||||||
|
|
||||||
|
```shell
|
||||||
|
PS> Invoke-WebRequest https://github.com/pojntfx/stfs/releases/latest/download/stfs.windows-x86_64.exe -OutFile \Windows\System32\stfs.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that only the Linux version supports reading from tape drives; macOS and Windows are limited to operating on tar files.
|
||||||
|
|
||||||
You can find binaries for more operating systems and architectures on [GitHub releases](https://github.com/pojntfx/stfs/releases).
|
You can find binaries for more operating systems and architectures on [GitHub releases](https://github.com/pojntfx/stfs/releases).
|
||||||
|
|
||||||
## Usage
|
## Tutorial
|
||||||
|
|
||||||
> Please note that this is only a short overview and does not explain all configuration options. To get more info on available commands or options, use `--help`.
|
> Please note that this is only a short overview and does not explain all configuration options. To get more info on available commands or options, use `--help`.
|
||||||
|
|
||||||
@@ -613,6 +619,6 @@ Have any questions or need help? Chat with us [on Matrix](https://matrix.to/#/#s
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
STFS (c) 2023 Felicitas Pojtinger and contributors
|
STFS (c) 2024 Felicitas Pojtinger and contributors
|
||||||
|
|
||||||
SPDX-License-Identifier: AGPL-3.0
|
SPDX-License-Identifier: AGPL-3.0
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ func (l Logger) Error(event string, keyvals ...interface{}) {
|
|||||||
l.log("ERROR", event, keyvals)
|
l.log("ERROR", event, keyvals)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l Logger) Panic(event string, keyvals ...interface{}) {
|
||||||
|
l.log("PANIC", event, keyvals)
|
||||||
|
}
|
||||||
|
|
||||||
func (l Logger) With(keyvals ...interface{}) golog.Logger {
|
func (l Logger) With(keyvals ...interface{}) golog.Logger {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|||||||
110
go.mod
110
go.mod
@@ -1,71 +1,73 @@
|
|||||||
module github.com/pojntfx/stfs
|
module github.com/pojntfx/stfs
|
||||||
|
|
||||||
go 1.17
|
go 1.21
|
||||||
|
|
||||||
|
toolchain go1.22.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
aead.dev/minisign v0.2.0
|
aead.dev/minisign v0.3.0
|
||||||
filippo.io/age v1.0.0
|
filippo.io/age v1.2.0
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3
|
github.com/ProtonMail/go-crypto v1.0.0
|
||||||
github.com/ProtonMail/gopenpgp/v2 v2.3.1
|
github.com/ProtonMail/gopenpgp/v2 v2.7.5
|
||||||
github.com/andybalholm/brotli v1.0.4
|
github.com/andybalholm/brotli v1.1.0
|
||||||
github.com/cosnicolaou/pbzip2 v1.0.1
|
github.com/cosnicolaou/pbzip2 v1.0.3
|
||||||
github.com/dsnet/compress v0.0.1
|
github.com/dsnet/compress v0.0.1
|
||||||
github.com/fclairamb/ftpserverlib v0.16.0
|
github.com/fclairamb/ftpserverlib v0.24.1
|
||||||
github.com/fclairamb/go-log v0.1.0
|
github.com/fclairamb/go-log v0.5.0
|
||||||
github.com/friendsofgo/errors v0.9.2
|
github.com/friendsofgo/errors v0.9.2
|
||||||
github.com/klauspost/compress v1.13.6
|
github.com/klauspost/compress v1.17.9
|
||||||
github.com/klauspost/pgzip v1.2.5
|
github.com/klauspost/pgzip v1.2.6
|
||||||
github.com/mattetti/filebuffer v1.0.1
|
github.com/mattetti/filebuffer v1.0.1
|
||||||
github.com/mattn/go-sqlite3 v1.14.9
|
github.com/mattn/go-sqlite3 v1.14.22
|
||||||
github.com/pierrec/lz4/v4 v4.1.12
|
github.com/pierrec/lz4/v4 v4.1.21
|
||||||
github.com/rubenv/sql-migrate v0.0.0-20211023115951-9f02b1e13857
|
github.com/rubenv/sql-migrate v1.7.0
|
||||||
github.com/spf13/afero v1.8.0
|
github.com/spf13/afero v1.11.0
|
||||||
github.com/spf13/cobra v1.3.0
|
github.com/spf13/cobra v1.8.1
|
||||||
github.com/spf13/viper v1.10.1
|
github.com/spf13/viper v1.19.0
|
||||||
github.com/volatiletech/null/v8 v8.1.2
|
github.com/volatiletech/null/v8 v8.1.2
|
||||||
github.com/volatiletech/sqlboiler/v4 v4.8.3
|
github.com/volatiletech/sqlboiler/v4 v4.16.2
|
||||||
github.com/volatiletech/strmangle v0.0.1
|
github.com/volatiletech/strmangle v0.0.6
|
||||||
modernc.org/sqlite v1.14.3
|
modernc.org/sqlite v1.31.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a // indirect
|
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
|
||||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
github.com/cloudflare/circl v1.3.9 // indirect
|
||||||
github.com/gofrs/uuid v3.2.0+incompatible // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
|
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
|
||||||
|
github.com/gofrs/uuid v4.4.0+incompatible // indirect
|
||||||
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
|
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/magiconair/properties v1.8.5 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
github.com/sagikazarmark/locafero v0.6.0 // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.2.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/volatiletech/inflect v0.0.1 // indirect
|
github.com/volatiletech/inflect v0.0.1 // indirect
|
||||||
github.com/volatiletech/randomize v0.0.1 // indirect
|
github.com/volatiletech/randomize v0.0.1 // indirect
|
||||||
github.com/ziutek/mymysql v1.5.4 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect
|
golang.org/x/crypto v0.25.0 // indirect
|
||||||
golang.org/x/mod v0.5.0 // indirect
|
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
|
||||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
|
golang.org/x/sys v0.22.0 // indirect
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.16.0 // indirect
|
||||||
golang.org/x/tools v0.1.5 // indirect
|
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/gorp.v1 v1.7.2 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
modernc.org/gc/v3 v3.0.0-20240722195230-4a140ff9c08e // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
modernc.org/libc v1.55.6 // indirect
|
||||||
lukechampine.com/uint128 v1.1.1 // indirect
|
modernc.org/mathutil v1.6.0 // indirect
|
||||||
modernc.org/cc/v3 v3.35.18 // indirect
|
modernc.org/memory v1.8.0 // indirect
|
||||||
modernc.org/ccgo/v3 v3.12.95 // indirect
|
modernc.org/strutil v1.2.0 // indirect
|
||||||
modernc.org/libc v1.11.104 // indirect
|
modernc.org/token v1.1.0 // indirect
|
||||||
modernc.org/mathutil v1.4.1 // indirect
|
|
||||||
modernc.org/memory v1.0.5 // indirect
|
|
||||||
modernc.org/opt v0.1.1 // indirect
|
|
||||||
modernc.org/strutil v1.1.1 // indirect
|
|
||||||
modernc.org/token v1.0.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
@@ -163,18 +163,27 @@ var (
|
|||||||
_ = qmhelper.Where
|
_ = qmhelper.Where
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var gorpMigrationAfterSelectMu sync.Mutex
|
||||||
var gorpMigrationAfterSelectHooks []GorpMigrationHook
|
var gorpMigrationAfterSelectHooks []GorpMigrationHook
|
||||||
|
|
||||||
|
var gorpMigrationBeforeInsertMu sync.Mutex
|
||||||
var gorpMigrationBeforeInsertHooks []GorpMigrationHook
|
var gorpMigrationBeforeInsertHooks []GorpMigrationHook
|
||||||
|
var gorpMigrationAfterInsertMu sync.Mutex
|
||||||
var gorpMigrationAfterInsertHooks []GorpMigrationHook
|
var gorpMigrationAfterInsertHooks []GorpMigrationHook
|
||||||
|
|
||||||
|
var gorpMigrationBeforeUpdateMu sync.Mutex
|
||||||
var gorpMigrationBeforeUpdateHooks []GorpMigrationHook
|
var gorpMigrationBeforeUpdateHooks []GorpMigrationHook
|
||||||
|
var gorpMigrationAfterUpdateMu sync.Mutex
|
||||||
var gorpMigrationAfterUpdateHooks []GorpMigrationHook
|
var gorpMigrationAfterUpdateHooks []GorpMigrationHook
|
||||||
|
|
||||||
|
var gorpMigrationBeforeDeleteMu sync.Mutex
|
||||||
var gorpMigrationBeforeDeleteHooks []GorpMigrationHook
|
var gorpMigrationBeforeDeleteHooks []GorpMigrationHook
|
||||||
|
var gorpMigrationAfterDeleteMu sync.Mutex
|
||||||
var gorpMigrationAfterDeleteHooks []GorpMigrationHook
|
var gorpMigrationAfterDeleteHooks []GorpMigrationHook
|
||||||
|
|
||||||
|
var gorpMigrationBeforeUpsertMu sync.Mutex
|
||||||
var gorpMigrationBeforeUpsertHooks []GorpMigrationHook
|
var gorpMigrationBeforeUpsertHooks []GorpMigrationHook
|
||||||
|
var gorpMigrationAfterUpsertMu sync.Mutex
|
||||||
var gorpMigrationAfterUpsertHooks []GorpMigrationHook
|
var gorpMigrationAfterUpsertHooks []GorpMigrationHook
|
||||||
|
|
||||||
// doAfterSelectHooks executes all "after Select" hooks.
|
// doAfterSelectHooks executes all "after Select" hooks.
|
||||||
@@ -316,23 +325,41 @@ func (o *GorpMigration) doAfterUpsertHooks(ctx context.Context, exec boil.Contex
|
|||||||
func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook) {
|
func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook) {
|
||||||
switch hookPoint {
|
switch hookPoint {
|
||||||
case boil.AfterSelectHook:
|
case boil.AfterSelectHook:
|
||||||
|
gorpMigrationAfterSelectMu.Lock()
|
||||||
gorpMigrationAfterSelectHooks = append(gorpMigrationAfterSelectHooks, gorpMigrationHook)
|
gorpMigrationAfterSelectHooks = append(gorpMigrationAfterSelectHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationAfterSelectMu.Unlock()
|
||||||
case boil.BeforeInsertHook:
|
case boil.BeforeInsertHook:
|
||||||
|
gorpMigrationBeforeInsertMu.Lock()
|
||||||
gorpMigrationBeforeInsertHooks = append(gorpMigrationBeforeInsertHooks, gorpMigrationHook)
|
gorpMigrationBeforeInsertHooks = append(gorpMigrationBeforeInsertHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationBeforeInsertMu.Unlock()
|
||||||
case boil.AfterInsertHook:
|
case boil.AfterInsertHook:
|
||||||
|
gorpMigrationAfterInsertMu.Lock()
|
||||||
gorpMigrationAfterInsertHooks = append(gorpMigrationAfterInsertHooks, gorpMigrationHook)
|
gorpMigrationAfterInsertHooks = append(gorpMigrationAfterInsertHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationAfterInsertMu.Unlock()
|
||||||
case boil.BeforeUpdateHook:
|
case boil.BeforeUpdateHook:
|
||||||
|
gorpMigrationBeforeUpdateMu.Lock()
|
||||||
gorpMigrationBeforeUpdateHooks = append(gorpMigrationBeforeUpdateHooks, gorpMigrationHook)
|
gorpMigrationBeforeUpdateHooks = append(gorpMigrationBeforeUpdateHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationBeforeUpdateMu.Unlock()
|
||||||
case boil.AfterUpdateHook:
|
case boil.AfterUpdateHook:
|
||||||
|
gorpMigrationAfterUpdateMu.Lock()
|
||||||
gorpMigrationAfterUpdateHooks = append(gorpMigrationAfterUpdateHooks, gorpMigrationHook)
|
gorpMigrationAfterUpdateHooks = append(gorpMigrationAfterUpdateHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationAfterUpdateMu.Unlock()
|
||||||
case boil.BeforeDeleteHook:
|
case boil.BeforeDeleteHook:
|
||||||
|
gorpMigrationBeforeDeleteMu.Lock()
|
||||||
gorpMigrationBeforeDeleteHooks = append(gorpMigrationBeforeDeleteHooks, gorpMigrationHook)
|
gorpMigrationBeforeDeleteHooks = append(gorpMigrationBeforeDeleteHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationBeforeDeleteMu.Unlock()
|
||||||
case boil.AfterDeleteHook:
|
case boil.AfterDeleteHook:
|
||||||
|
gorpMigrationAfterDeleteMu.Lock()
|
||||||
gorpMigrationAfterDeleteHooks = append(gorpMigrationAfterDeleteHooks, gorpMigrationHook)
|
gorpMigrationAfterDeleteHooks = append(gorpMigrationAfterDeleteHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationAfterDeleteMu.Unlock()
|
||||||
case boil.BeforeUpsertHook:
|
case boil.BeforeUpsertHook:
|
||||||
|
gorpMigrationBeforeUpsertMu.Lock()
|
||||||
gorpMigrationBeforeUpsertHooks = append(gorpMigrationBeforeUpsertHooks, gorpMigrationHook)
|
gorpMigrationBeforeUpsertHooks = append(gorpMigrationBeforeUpsertHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationBeforeUpsertMu.Unlock()
|
||||||
case boil.AfterUpsertHook:
|
case boil.AfterUpsertHook:
|
||||||
|
gorpMigrationAfterUpsertMu.Lock()
|
||||||
gorpMigrationAfterUpsertHooks = append(gorpMigrationAfterUpsertHooks, gorpMigrationHook)
|
gorpMigrationAfterUpsertHooks = append(gorpMigrationAfterUpsertHooks, gorpMigrationHook)
|
||||||
|
gorpMigrationAfterUpsertMu.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
@@ -290,18 +290,27 @@ var (
|
|||||||
_ = qmhelper.Where
|
_ = qmhelper.Where
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var headerAfterSelectMu sync.Mutex
|
||||||
var headerAfterSelectHooks []HeaderHook
|
var headerAfterSelectHooks []HeaderHook
|
||||||
|
|
||||||
|
var headerBeforeInsertMu sync.Mutex
|
||||||
var headerBeforeInsertHooks []HeaderHook
|
var headerBeforeInsertHooks []HeaderHook
|
||||||
|
var headerAfterInsertMu sync.Mutex
|
||||||
var headerAfterInsertHooks []HeaderHook
|
var headerAfterInsertHooks []HeaderHook
|
||||||
|
|
||||||
|
var headerBeforeUpdateMu sync.Mutex
|
||||||
var headerBeforeUpdateHooks []HeaderHook
|
var headerBeforeUpdateHooks []HeaderHook
|
||||||
|
var headerAfterUpdateMu sync.Mutex
|
||||||
var headerAfterUpdateHooks []HeaderHook
|
var headerAfterUpdateHooks []HeaderHook
|
||||||
|
|
||||||
|
var headerBeforeDeleteMu sync.Mutex
|
||||||
var headerBeforeDeleteHooks []HeaderHook
|
var headerBeforeDeleteHooks []HeaderHook
|
||||||
|
var headerAfterDeleteMu sync.Mutex
|
||||||
var headerAfterDeleteHooks []HeaderHook
|
var headerAfterDeleteHooks []HeaderHook
|
||||||
|
|
||||||
|
var headerBeforeUpsertMu sync.Mutex
|
||||||
var headerBeforeUpsertHooks []HeaderHook
|
var headerBeforeUpsertHooks []HeaderHook
|
||||||
|
var headerAfterUpsertMu sync.Mutex
|
||||||
var headerAfterUpsertHooks []HeaderHook
|
var headerAfterUpsertHooks []HeaderHook
|
||||||
|
|
||||||
// doAfterSelectHooks executes all "after Select" hooks.
|
// doAfterSelectHooks executes all "after Select" hooks.
|
||||||
@@ -443,23 +452,41 @@ func (o *Header) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecut
|
|||||||
func AddHeaderHook(hookPoint boil.HookPoint, headerHook HeaderHook) {
|
func AddHeaderHook(hookPoint boil.HookPoint, headerHook HeaderHook) {
|
||||||
switch hookPoint {
|
switch hookPoint {
|
||||||
case boil.AfterSelectHook:
|
case boil.AfterSelectHook:
|
||||||
|
headerAfterSelectMu.Lock()
|
||||||
headerAfterSelectHooks = append(headerAfterSelectHooks, headerHook)
|
headerAfterSelectHooks = append(headerAfterSelectHooks, headerHook)
|
||||||
|
headerAfterSelectMu.Unlock()
|
||||||
case boil.BeforeInsertHook:
|
case boil.BeforeInsertHook:
|
||||||
|
headerBeforeInsertMu.Lock()
|
||||||
headerBeforeInsertHooks = append(headerBeforeInsertHooks, headerHook)
|
headerBeforeInsertHooks = append(headerBeforeInsertHooks, headerHook)
|
||||||
|
headerBeforeInsertMu.Unlock()
|
||||||
case boil.AfterInsertHook:
|
case boil.AfterInsertHook:
|
||||||
|
headerAfterInsertMu.Lock()
|
||||||
headerAfterInsertHooks = append(headerAfterInsertHooks, headerHook)
|
headerAfterInsertHooks = append(headerAfterInsertHooks, headerHook)
|
||||||
|
headerAfterInsertMu.Unlock()
|
||||||
case boil.BeforeUpdateHook:
|
case boil.BeforeUpdateHook:
|
||||||
|
headerBeforeUpdateMu.Lock()
|
||||||
headerBeforeUpdateHooks = append(headerBeforeUpdateHooks, headerHook)
|
headerBeforeUpdateHooks = append(headerBeforeUpdateHooks, headerHook)
|
||||||
|
headerBeforeUpdateMu.Unlock()
|
||||||
case boil.AfterUpdateHook:
|
case boil.AfterUpdateHook:
|
||||||
|
headerAfterUpdateMu.Lock()
|
||||||
headerAfterUpdateHooks = append(headerAfterUpdateHooks, headerHook)
|
headerAfterUpdateHooks = append(headerAfterUpdateHooks, headerHook)
|
||||||
|
headerAfterUpdateMu.Unlock()
|
||||||
case boil.BeforeDeleteHook:
|
case boil.BeforeDeleteHook:
|
||||||
|
headerBeforeDeleteMu.Lock()
|
||||||
headerBeforeDeleteHooks = append(headerBeforeDeleteHooks, headerHook)
|
headerBeforeDeleteHooks = append(headerBeforeDeleteHooks, headerHook)
|
||||||
|
headerBeforeDeleteMu.Unlock()
|
||||||
case boil.AfterDeleteHook:
|
case boil.AfterDeleteHook:
|
||||||
|
headerAfterDeleteMu.Lock()
|
||||||
headerAfterDeleteHooks = append(headerAfterDeleteHooks, headerHook)
|
headerAfterDeleteHooks = append(headerAfterDeleteHooks, headerHook)
|
||||||
|
headerAfterDeleteMu.Unlock()
|
||||||
case boil.BeforeUpsertHook:
|
case boil.BeforeUpsertHook:
|
||||||
|
headerBeforeUpsertMu.Lock()
|
||||||
headerBeforeUpsertHooks = append(headerBeforeUpsertHooks, headerHook)
|
headerBeforeUpsertHooks = append(headerBeforeUpsertHooks, headerHook)
|
||||||
|
headerBeforeUpsertMu.Unlock()
|
||||||
case boil.AfterUpsertHook:
|
case boil.AfterUpsertHook:
|
||||||
|
headerAfterUpsertMu.Lock()
|
||||||
headerAfterUpsertHooks = append(headerAfterUpsertHooks, headerHook)
|
headerAfterUpsertHooks = append(headerAfterUpsertHooks, headerHook)
|
||||||
|
headerAfterUpsertMu.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||||
|
|
||||||
package models
|
package models
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ func (l JSONLogger) Error(event string, keyvals ...interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l JSONLogger) Panic(event string, keyvals ...interface{}) {
|
||||||
|
if l.verbosity >= 0 {
|
||||||
|
printJSON("PANIC", event, keyvals)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (l JSONLogger) With(keyvals ...interface{}) golog.Logger {
|
func (l JSONLogger) With(keyvals ...interface{}) golog.Logger {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user