diff --git a/.air.toml b/.air.toml new file mode 100644 index 000000000..f8ddd1f30 --- /dev/null +++ b/.air.toml @@ -0,0 +1,53 @@ +# Config file for [Air](https://github.com/cosmtrek/air) in TOML format + +# Working directory +# . or absolute path, please note that the directories following must be under root. +root = "." +tmp_dir = "tmp" + +[build] +# Just plain old shell command. You could use `make` as well. +cmd = "make build" +# Binary file yields from `cmd`. +bin = "./.bin/app-cli" +# Customize binary, can setup environment variables when run your app. +full_bin = "./.bin/app-cli http-server run" +# Watch these filename extensions. +include_ext = ["go"] +# Ignore these filename extensions or directories. +exclude_dir = ["schema", "doc", "docker", "proto", "tmp"] +# Watch these directories if you specified. +include_dir = [] +# Exclude files. +exclude_file = [] +# Exclude specific regular expressions. +exclude_regex = ["_test\\.go"] +# Exclude unchanged files. +exclude_unchanged = true +# Follow symlink for directories +follow_symlink = true +# This log file places in your tmp_dir. +log = "air.log" +# It's not necessary to trigger build each time file changes if it's too frequent. +delay = 1000 # ms +# Stop running old binary when build errors occur. +stop_on_error = true +# Send Interrupt signal before killing process (windows does not support this feature) +send_interrupt = false +# Delay after sending Interrupt signal +kill_delay = 500 # ms + +[log] +# Show log time +time = false + +[color] +# Customize each part's color. If no color found, use the raw app log. +main = "magenta" +watcher = "cyan" +build = "yellow" +runner = "green" + +[misc] +# Delete tmp directory on exit +clean_on_exit = true diff --git a/.envrc.tepl b/.envrc.tepl deleted file mode 100644 index 41bbf6bdd..000000000 --- a/.envrc.tepl +++ /dev/null @@ -1,22 +0,0 @@ -# shared -export GOOGLE_APPLICATION_CREDENTIALS="./serviceAccount.json" -export PROJECT_ID="sample" - -# default server -export DEFAULT_ENV="local" -export DEFAULT_PORT="8080" -export DEFAULT_MIN_LOG_SEVERITY="DEBUG" -export DEFAULT_DB_HOST="tcp(localhost:3306)" -export DEFAULT_DB_USER="root" -export DEFAULT_DB_PASSWORD="password" -export DEFAULT_DB_DATABASE="defaultdb" - -# default gprc server -export DEFAULT_GRPC_ENV="LOCAL" -export DEFAULT_GRPC_PORT="50051" - -# push notification server -export PUSH_NOTIFICATION_ENV="local" -export PUSH_NOTIFICATION_PORT="8081" -export PUSH_NOTIFICATION_MIN_LOG_SEVERITY="DEBUG" -export FCM_SERVER_KEY=hogehoge diff --git a/.envrc.tmpl b/.envrc.tmpl new file mode 100644 index 000000000..372bc0ef6 --- /dev/null +++ b/.envrc.tmpl @@ -0,0 +1,12 @@ + +export ENV="local" +export PORT="8080" +export MIN_LOG_SEVERITY="DEBUG" +export DB_HOST="tcp(localhost:3306)" +export DB_USER="root" +export DB_PASSWORD="password" +export DB_DATABASE="maindb" + +export GCP_PROJECT_ID="sample" +export FIREBASE_CLIENT_API_KEY="sample" +export GOOGLE_APPLICATION_CREDENTIALS="./secret/service_account.json" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dd3abb53..9e1f4e3fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,47 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - - name: Set up Go 1.13 - uses: actions/setup-go@v1 + - name: Set up Go 1.19 + uses: actions/setup-go@v3 with: - go-version: 1.13 + go-version: 1.19 + + - name: mod download + run: go mod download - name: build - run: make build-cli + run: make build + + - name: test + run: make test + + - name: lint + uses: golangci/golangci-lint-action@v3 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: latest + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + args: --timeout=10m + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the all caching functionality will be complete disabled, + # takes precedence over all other caching options. + # skip-cache: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + skip-build-cache: true + + - name: proto lint + run: | + make lint.proto diff --git a/.gitignore b/.gitignore index 9923d7f9f..dbea5d587 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,158 @@ secret/* .envrc db/*/data/* -.env.* +.env serviceAccount.json -rapid -helper \ No newline at end of file +rapid-cli +lib +.firebase +**/out/** +.bin/** +tmp +secret/ + + +### https://raw.github.com/github/gitignore/f9291de89f5f7dc0d3d87f9eb111b839f81d5dbc/Node.gitignore + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# build +dist + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + + +### https://raw.github.com/github/gitignore/f9291de89f5f7dc0d3d87f9eb111b839f81d5dbc/Global/macOS.gitignore + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### https://raw.github.com/github/gitignore/f9291de89f5f7dc0d3d87f9eb111b839f81d5dbc/Global/VisualStudioCode.gitignore + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + + +### secret +firebase.admin.key.json +firebase.client.key.json + +### build +server/main.js +server/main.js.map +firebase/admin.js +firebase/admin.js.map \ No newline at end of file diff --git a/.golangci-lint.yaml b/.golangci-lint.yaml new file mode 100644 index 000000000..41c4ae9aa --- /dev/null +++ b/.golangci-lint.yaml @@ -0,0 +1,93 @@ +go: "1.19" +run: + deadline: 10m + +linters: + # Disable all linters. + # Default: false + disable-all: true + # Enable specific linter + # https://golangci-lint.run/usage/linters/#enabled-by-default-linters + enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - containedctx + - contextcheck + - gocyclo + - deadcode + - decorder + - depguard + - dogsled + - dupl + - durationcheck + - errcheck + - errchkjson + - errname + - errorlint + - execinquery + - exportloopref + - forbidigo + - forcetypeassert + - funlen + - gochecknoglobals + - gochecknoinits + - gocognit + - goconst + - gocyclo + - godot + - gofmt + - gofumpt + - goheader + - goimports + - gomnd + - gomoddirectives + - gomodguard + - goprintffuncname + - gosec + - gosimple + - govet + - grouper + - ifshort + - importas + - ineffassign + - interfacer + - ireturn + - lll + - maintidx + - makezero + - maligned + - misspell + - nakedret + - nestif + - nilerr + - nilnil + - noctx + - nolintlint + - nonamedreturns + - nosnakecase + - nosprintfhostport + - paralleltest + - prealloc + - predeclared + - promlinter + - rowserrcheck + - scopelint + - sqlclosecheck + - staticcheck + - structcheck + - stylecheck + - tagliatelle + - tenv + - testpackage + - thelper + - tparallel + - typecheck + - unconvert + - unparam + - unused + - usestdlibvars + - varcheck + - wastedassign + - whitespace diff --git a/.realize.yaml b/.realize.yaml deleted file mode 100755 index 4151dc588..000000000 --- a/.realize.yaml +++ /dev/null @@ -1,76 +0,0 @@ -settings: - legacy: - force: false - interval: 0s -schema: - - name: default-server - path: . - commands: - install: - status: true - method: make build-cli - run: - status: true - method: ./rapid - fmt: - status: true - args: - - default-http - - run - watcher: - extensions: - - go - paths: - - / - ignored_paths: - - .git - - .realize - - vendor - - - name: default-grpc-server - path: . - commands: - install: - status: true - method: make build-cli - run: - status: true - method: ./rapid - fmt: - status: true - args: - - default-grpc - - run - watcher: - extensions: - - go - paths: - - / - ignored_paths: - - .git - - .realize - - vendor - - - name: push-notification-server - path: . - commands: - install: - status: true - method: make build-cli - run: - status: true - method: ./rapid - fmt: - status: true - args: - - push-notification - - run - watcher: - extensions: - - go - paths: - - / - ignored_paths: - - .git - - .realize - - vendor diff --git a/Makefile b/Makefile index 1a7c8b0b8..75147cc13 100644 --- a/Makefile +++ b/Makefile @@ -1,84 +1,52 @@ -# note: call scripts from /scripts +.PHONY: build +build: + go build -o ./.bin/app-cli ./cmd/app -init: - go get -u google.golang.org/grpc \ - go get -u github.com/golang/protobuf/protoc-gen-go \ - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \ - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger - -format: - $(call format) - -build-helper: - go build -o helper ./cmd/helper - -build-cli: - go build -o ./rapid ./cmd/rapid +.PHONY: test test: - go test `go list ./... | grep -v internal/dbmodels` + @go test ./internal/... -mockgen: - $(call mockgen_app ,default) - $(call mockgen_app ,default-grpc) - $(call format) +.PHONY: http.dev +http.dev: + @go run github.com/cosmtrek/air -c .air.toml -sqlboiler: - sqlboiler mysql --config ./db/default/sqlboiler.toml --pkgname defaultdb --wipe --no-hooks --struct-tag-casing camel --output ./internal/dbmodels/defaultdb --templates ${GOPATH}/src/github.com/volatiletech/sqlboiler/templates,${GOPATH}/src/github.com/volatiletech/sqlboiler/templates_test +.PHONY: generate.mock +generate.mock: + @go generate ./... $(call format) -protogen: - $(call gen_proto_go ,user) +.PHONY: generate.buf +generate.buf: + @go run github.com/bufbuild/buf/cmd/buf generate $(call format) -define format - go fmt ./... && goimports -w ./ && go mod tidy -endef - -define mockgen_app - $(eval USECASE_LIST := $(call get_usecase_list,$1)) - $(foreach file, $(USECASE_LIST), $(call mockgen_usecase,$1,$(shell basename $(file)))) - $(eval SERVICE_LIST := $(call get_service_list,$1)) - $(foreach file, $(SERVICE_LIST), $(call mockgen_service,$1,$(shell basename $(file)))) - $(eval REPOSITORY_LIST := $(call get_repository_list,$1)) - $(foreach file, $(REPOSITORY_LIST), $(call mockgen_repository,$1,$(shell basename $(file)))) -endef - - -define get_usecase_list - $(shell find ./internal/$1/usecase -mindepth 1 -maxdepth 1 -type f ! -name "*_impl*.go") -endef - -define mockgen_usecase - $(shell mockgen -source ./internal/$1/usecase/$2 -destination ./internal/$1/usecase/mock/$2) -endef +.PHONY: generate.sqlboiler +generate.sqlboiler: + @go run github.com/volatiletech/sqlboiler/v4 --config=./db/main/sqlboiler.toml mysql + $(call format) -define get_service_list - $(shell find ./internal/$1/domain/service -mindepth 1 -maxdepth 1 -type f ) -endef +.PHONY: lint.go +lint.go: + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run + $(call format) -define mockgen_service - $(shell mockgen -source ./internal/$1/domain/service/$2 -destination ./internal/$1/domain/service/mock/$2) -endef +.PHONY: lint.proto +lint.proto: + @go run github.com/bufbuild/buf/cmd/buf lint + $(call format) -define get_repository_list - $(shell find ./internal/$1/domain/repository -mindepth 1 -maxdepth 1 -type f ) -endef +.PHONY: migrate.up +migrate.up: + @go run github.com/pressly/goose/v3/cmd/goose --dir db/main/migrations mysql "$(DB_USER):$(DB_PASSWORD)@$(DB_HOST)/$(DB_DATABASE)?parseTime=true" up -define mockgen_repository - $(shell mockgen -source ./internal/$1/domain/repository/$2 -destination ./internal/$1/domain/repository/mock/$2) -endef +.PHONY: format +format: + $(call format) -define gen_proto_go - $(shell protoc -I${GOPATH}/src \ - -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/ \ - --proto_path=./proto \ - --go_out=plugins=grpc:./proto/default \ - --include_imports \ - --include_source_info \ - --descriptor_set_out=./proto/default/$1.pb \ - --swagger_out=json_names_for_fields=true:./proto/default \ - $1.proto \ - ) +define format + @go fmt ./... + @go run github.com/bufbuild/buf/cmd/buf format + @go run golang.org/x/tools/cmd/goimports -w ./ + @go mod tidy endef \ No newline at end of file diff --git a/README.md b/README.md index 18bf14424..3156739b3 100644 --- a/README.md +++ b/README.md @@ -14,110 +14,12 @@ the boilerplate for monorepo application (support only http protocol) ## Apps -| Package | Localhost | Prodction | -| :----------------------------------------------------------------- | :--------------------- | :------------------- | -| **[[REST] default](./cmd/default)** | http://localhost:8080 | default.\* | -| **[[gRPC] default-grpc](./cmd/push-notification)** | http://localhost:50051 | default-grpc.\* | -| **[[REST] default-grpc-json-transcoder](./cmd/push-notification)** | http://localhost:51051 | default-grpc-rest.\* | -| **[[REST] push-notification](./cmd/push-notification)** | http://localhost:8081 | push-notification.\* | +| Package | Localhost | Prodction | +| :------------------------------------------ | :-------------------- | :-------- | +| **[[REST] api server](./cmd/app/http_server_cmd.go)** | http://localhost:8080 | api.\* | -## development +## document links -### Preparation - - - -- environment (using dotenv) - - you should fix a host to default-db if you use docker-compose as server runtime - -```bash -> cp .tmpl.env.default .env.default -``` - -### server starting - -- docker - -```bash -# build image -> docker-compose build - -# container start -> docker-compose up -d -``` - -- example of default server - -```bash -> curl --request GET 'http://localhost:8080/ping' -``` - - - -### testing - -```bash -> docker-compose run --rm default-grpc-server ash -c "source .envrc && make test" -``` - -## production - -### build - -```bash -> docker build -f ./docker/production/default/Dockerfile . -``` - -## about layer - -### infrastructure - -- data layer -- It is responsibility to handle the data -- interested in database etc. - -#### entity - -- struct for setting the result of SQL etc.... - -#### infra/repository - -- write the actual data manipulation process - -### domain - -#### model - -- domain model - -#### domain/repository - -- write interface for infrastructure/repository and convert entity to domain - -#### domain/service - -- write application logic using repository - -### usecase layer - -- write usecase using repository and service - -### handler - -- write the process about request and response - -### internal/pkg - -- shared code +| Title | +| :---------------------------------------------- | +| **[golang docs](./docs/golang.md)** | diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 000000000..acd385fd1 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,35 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb + except: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway +plugins: + - remote: buf.build/library/plugins/go:v1.27.1-1 + out: ./internal/infrastructure/grpc/pb + opt: + - paths=source_relative + + - remote: buf.build/library/plugins/go-grpc:v1.1.0-2 + out: ./internal/infrastructure/grpc/pb + opt: + - paths=source_relative + - require_unimplemented_servers=false + + - remote: buf.build/grpc-ecosystem/plugins/grpc-gateway:v2.7.0-1 + out: ./internal/infrastructure/grpc/pb + opt: + - generate_unbound_methods=true + - logtostderr=true + - paths=source_relative + + - remote: buf.build/grpc-ecosystem/plugins/openapiv2:v2.6.0-1 + out: ./schema/openapi + opt: + - logtostderr=true + - allow_merge=true + - simple_operation_ids=true + - json_names_for_fields=false + - disable_default_errors=true diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 000000000..5f86973ad --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,3 @@ +version: v1 +directories: + - schema/proto diff --git a/cmd/README.md b/cmd/README.md deleted file mode 100644 index 19c269ec5..000000000 --- a/cmd/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# `/cmd` - -Main applications for this project. - -The directory name for each application should match the name of the executable you want to have (e.g., `/cmd/myapp`). - -Don't put a lot of code in the application directory. If you think the code can be imported and used in other projects, then it should live in the `/pkg` directory. If the code is not reusable or if you don't want others to reuse it, put that code in the `/internal` directory. You'll be surprised what others will do, so be explicit about your intentions! - -It's common to have a small `main` function that imports and invokes the code from the `/internal` and `/pkg` directories and nothing else. - -Examples: - -* https://github.com/heptio/ark/tree/master/cmd (just a really small `main` function with everything else in packages) -* https://github.com/moby/moby/tree/master/cmd -* https://github.com/prometheus/prometheus/tree/master/cmd -* https://github.com/influxdata/influxdb/tree/master/cmd -* https://github.com/kubernetes/kubernetes/tree/master/cmd -* https://github.com/satellity/satellity/tree/master/cmd/satellity -* https://github.com/dapr/dapr/tree/master/cmd - diff --git a/cmd/app/main.go b/cmd/app/main.go new file mode 100644 index 000000000..57b9f3733 --- /dev/null +++ b/cmd/app/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "os" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/cmd" +) + +func main() { + cmd := cmd.NewCmdRoot() + if err := cmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} diff --git a/cmd/helper/ctxhelper/context.go b/cmd/helper/ctxhelper/context.go deleted file mode 100644 index 443db714c..000000000 --- a/cmd/helper/ctxhelper/context.go +++ /dev/null @@ -1,16 +0,0 @@ -package ctxhelper - -import "context" - -// Context ... -var Context context.Context - -// SetContext ... -func SetContext(ctx context.Context) { - Context = ctx -} - -// GetContext ... -func GetContext() context.Context { - return Context -} diff --git a/cmd/helper/dependency.go b/cmd/helper/dependency.go deleted file mode 100644 index 93b924879..000000000 --- a/cmd/helper/dependency.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "github.com/abyssparanoia/rapid-go/cmd/helper/handler" - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - "go.uber.org/zap" -) - -// Deps ... -var Deps Dependency - -func setDeps(deps Dependency) { - Deps = deps -} - -func getDeps() Dependency { - return Deps -} - -// Dependency ... dependency -type Dependency struct { - Logger *zap.Logger - HelperHandler handler.HelperHandler -} - -// Inject ... indect dependency -func (d *Dependency) Inject(e *Environment) { - - d.Logger, _ = log.New("LOCAL") - d.HelperHandler = handler.NewHelperHandler() - -} diff --git a/cmd/helper/env.go b/cmd/helper/env.go deleted file mode 100644 index b4cf1d428..000000000 --- a/cmd/helper/env.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "github.com/joho/godotenv" - "github.com/kelseyhightower/envconfig" -) - -// Environment ... environment variable -type Environment struct { - Port string `envconfig:"PORT" default:"8080"` - ENV string `envconfig:"ENV" required:"true"` - ProjectID string `envconfig:"PROJECT_ID" required:"true"` - LocationID string `envconfig:"LOCATION_ID" default:"asia-northeast1"` - // ServiceID string `envconfig:"SERVICE_ID" required:"true"` - CredentialsPath string `envconfig:"GOOGLE_APPLICATION_CREDENTIALS" required:"true"` - MinLogSeverity string `envconfig:"MIN_LOG_SEVERITY" required:"true"` -} - -// Get ... get env -func (e *Environment) Get() { - err := godotenv.Load(".env.default") - if err != nil { - panic(err) - } - err = envconfig.Process("", e) - if err != nil { - panic(err) - } -} diff --git a/cmd/helper/handler/hello.go b/cmd/helper/handler/hello.go deleted file mode 100644 index 6ce74f2b6..000000000 --- a/cmd/helper/handler/hello.go +++ /dev/null @@ -1,11 +0,0 @@ -package handler - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" -) - -func (h *helperHandler) HelloWorld(ctx context.Context) { - log.Debugf(ctx, "hello") -} diff --git a/cmd/helper/handler/interface.go b/cmd/helper/handler/interface.go deleted file mode 100644 index 2831035c8..000000000 --- a/cmd/helper/handler/interface.go +++ /dev/null @@ -1,15 +0,0 @@ -package handler - -import "context" - -// HelperHandler ... -type HelperHandler interface { - HelloWorld(ctx context.Context) -} - -type helperHandler struct{} - -// NewHelperHandler ... new helper handler -func NewHelperHandler() HelperHandler { - return &helperHandler{} -} diff --git a/cmd/helper/main.go b/cmd/helper/main.go deleted file mode 100644 index aa06d7c93..000000000 --- a/cmd/helper/main.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "context" - - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - - "github.com/abyssparanoia/rapid-go/cmd/helper/ctxhelper" -) - -func main() { - - e := &Environment{} - e.Get() - - // Dependency - d := Dependency{} - d.Inject(e) - ctx := context.Background() - ctx = ctxzap.ToContext(ctx, d.Logger) - - setDeps(d) - ctxhelper.SetContext(ctx) - - execute() -} diff --git a/cmd/helper/root.go b/cmd/helper/root.go deleted file mode 100644 index 3829942e6..000000000 --- a/cmd/helper/root.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" -) - -// newCmdRoot ... -func newCmdRoot() *cobra.Command { - cmd := &cobra.Command{ - Use: "helper", - Short: "helper cli", - Long: `helper cli`, - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - cmd.HelpFunc()(cmd, args) - } - }} - cmd.AddCommand(newCmdHello()) - return cmd -} - -func execute() { - cmd := newCmdRoot() - if err := cmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} diff --git a/cmd/helper/sub.go b/cmd/helper/sub.go deleted file mode 100644 index d8c8d4de7..000000000 --- a/cmd/helper/sub.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "github.com/abyssparanoia/rapid-go/cmd/helper/ctxhelper" - "github.com/spf13/cobra" -) - -func newCmdHello() *cobra.Command { - cmd := &cobra.Command{ - Use: "hello", - Short: "output hello world", - Run: func(cmd *cobra.Command, args []string) { - d := getDeps() - ctx := ctxhelper.GetContext() - d.HelperHandler.HelloWorld(ctx) - }, - } - - return cmd -} diff --git a/cmd/rapid/default-grpc/cmd.go b/cmd/rapid/default-grpc/cmd.go deleted file mode 100644 index 55dc2de70..000000000 --- a/cmd/rapid/default-grpc/cmd.go +++ /dev/null @@ -1,31 +0,0 @@ -package defaultgrpc - -import ( - "github.com/spf13/cobra" -) - -// NewDefaultGRPCCmd ... new default GRPC cmd -func NewDefaultGRPCCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "default-grpc", - Short: "cli default grpc server", - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - cmd.HelpFunc()(cmd, args) - } - }, - } - cmd.AddCommand(newDefaultGRPCRunCmd()) - return cmd -} - -func newDefaultGRPCRunCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "run", - Short: "running default grpc server", - Run: func(cmd *cobra.Command, args []string) { - run() - }, - } - return cmd -} diff --git a/cmd/rapid/default-grpc/dependency.go b/cmd/rapid/default-grpc/dependency.go deleted file mode 100644 index c864e3d60..000000000 --- a/cmd/rapid/default-grpc/dependency.go +++ /dev/null @@ -1,74 +0,0 @@ -package defaultgrpc - -import ( - "fmt" - "net" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/handler" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/infrastructure/repository" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/usecase" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluemysql" - grpc_requestlog "github.com/abyssparanoia/rapid-go/internal/pkg/interceptor/requestlog" - pb "github.com/abyssparanoia/rapid-go/proto/default" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap" - grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" - grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/health" - "google.golang.org/grpc/health/grpc_health_v1" - "google.golang.org/grpc/reflection" - "google.golang.org/grpc/status" -) - -func recoveryFuncFactory(logger *zap.Logger) func(p interface{}) error { - return func(p interface{}) error { - logger.Error(fmt.Sprintf("p: %+v\n", p)) - return status.Errorf(codes.Internal, "Unexpected error: %+v\n", p) - } -} - -func newDefaultServer(logger *zap.Logger, e *environment) *grpc.Server { - grpc_zap.ReplaceGrpcLogger(logger) - - _ = gluemysql.NewClient(e.DBHost, e.DBUser, e.DBPassword, e.DBDatabase) - - // Repository - userRepository := repository.NewUser() - - userUsecase := usecase.NewUser(userRepository) - - userHandler := handler.NewUserHandler(userUsecase) - - opts := []grpc_recovery.Option{ - grpc_recovery.WithRecoveryHandler(recoveryFuncFactory(logger)), - } - - server := grpc.NewServer( - grpc_middleware.WithUnaryServerChain( - grpc_ctxtags.UnaryServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)), - grpc_requestlog.UnaryServerInterceptor(logger), - grpc_recovery.UnaryServerInterceptor(opts...), - ), - ) - - pb.RegisterUserServiceServer(server, userHandler) - reflection.Register(server) - grpc_health_v1.RegisterHealthServer(server, health.NewServer()) - - listen, err := net.Listen("tcp", fmt.Sprintf(":%s", e.Port)) - if err != nil { - panic(err) - } - - go func() { - logger.Info(fmt.Sprintf("Listening grpc on %s:%s", "localhost", e.Port)) - if err := server.Serve(listen); err != nil { - logger.Error("server.Serve", zap.Error(err)) - } - }() - - return server -} diff --git a/cmd/rapid/default-grpc/env.go b/cmd/rapid/default-grpc/env.go deleted file mode 100644 index 5af9400cb..000000000 --- a/cmd/rapid/default-grpc/env.go +++ /dev/null @@ -1,12 +0,0 @@ -package defaultgrpc - -type environment struct { - Port string `env:"DEFAULT_GRPC_PORT,required"` - Envrionment string `env:"DEFAULT_GRPC_ENV,required"` - ProjectID string `env:"PROJECT_ID,required"` - CredentialsPath string `env:"GOOGLE_APPLICATION_CREDENTIALS,required"` - DBHost string `env:"DEFAULT_DB_HOST,required"` - DBUser string `env:"DEFAULT_DB_USER,required"` - DBPassword string `env:"DEFAULT_DB_PASSWORD,required"` - DBDatabase string `env:"DEFAULT_DB_DATABASE,required"` -} diff --git a/cmd/rapid/default-grpc/run.go b/cmd/rapid/default-grpc/run.go deleted file mode 100644 index 4cd7b112f..000000000 --- a/cmd/rapid/default-grpc/run.go +++ /dev/null @@ -1,69 +0,0 @@ -package defaultgrpc - -import ( - "context" - "os" - "os/signal" - "syscall" - "time" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - - env "github.com/caarlos0/env/v6" - "go.uber.org/zap" -) - -func run() { - - // initilize environment variables - e := &environment{} - if err := env.Parse(e); err != nil { - panic(err) - } - - logger, err := log.New(e.Envrionment) - if err != nil { - panic(err) - } - - server := newDefaultServer(logger, e) - - c := make(chan os.Signal, 1) - signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT) - - for s := range c { - logger.Info("Signal recieved", zap.String("signal", s.String())) - - switch s { - case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT: - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - shutdown := make(chan bool, 1) - - go func() { - - server.GracefulStop() - - shutdown <- true - }() - - select { - case <-shutdown: - logger.Info("Gracefully stop") - case <-ctx.Done(): - logger.Info("Force stop") - server.Stop() - } - - cancel() - - logger.Info("Exit") - return - - case syscall.SIGHUP: - default: - return - - } - } - -} diff --git a/cmd/rapid/default-http/cmd.go b/cmd/rapid/default-http/cmd.go deleted file mode 100644 index d0437c668..000000000 --- a/cmd/rapid/default-http/cmd.go +++ /dev/null @@ -1,31 +0,0 @@ -package defaulthttp - -import ( - "github.com/spf13/cobra" -) - -// NewDefaultHTTPCmd ... new default HTTP cmd -func NewDefaultHTTPCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "default-http", - Short: "cli default http server", - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - cmd.HelpFunc()(cmd, args) - } - }, - } - cmd.AddCommand(newDefaultHTTPRunCmd()) - return cmd -} - -func newDefaultHTTPRunCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "run", - Short: "running default http server", - Run: func(cmd *cobra.Command, args []string) { - run() - }, - } - return cmd -} diff --git a/cmd/rapid/default-http/dependency.go b/cmd/rapid/default-http/dependency.go deleted file mode 100644 index 23ed54781..000000000 --- a/cmd/rapid/default-http/dependency.go +++ /dev/null @@ -1,59 +0,0 @@ -package defaulthttp - -import ( - "github.com/abyssparanoia/rapid-go/internal/default/handler/api" - "github.com/abyssparanoia/rapid-go/internal/default/infrastructure/repository" - "github.com/abyssparanoia/rapid-go/internal/default/usecase" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluefirebaseauth" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluemysql" - "github.com/abyssparanoia/rapid-go/internal/pkg/httpheader" - "github.com/abyssparanoia/rapid-go/internal/pkg/middleware/requestlog" - "github.com/volatiletech/sqlboiler/boil" - "go.uber.org/zap" -) - -// Dependency ... dependency -type Dependency struct { - httpMiddleware *requestlog.HTTPMiddleware - gluefirebaseauth *gluefirebaseauth.Middleware - DummyHTTPHeader *httpheader.Middleware - HTTPHeader *httpheader.Middleware - UserHandler *api.UserHandler -} - -// Inject ... indect dependency -func (d *Dependency) Inject(e *environment, logger *zap.Logger) { - - var firebaseauth gluefirebaseauth.Firebaseauth - - authCli := gluefirebaseauth.NewClient(e.ProjectID) - // fCli := gluefirestore.NewClient(e.ProjectID) - - // pkg - _ = gluemysql.NewClient(e.DBHost, e.DBUser, e.DBPassword, e.DBDatabase) - - if e.Envrionment == "local" { - firebaseauth = gluefirebaseauth.NewDebug(authCli) - boil.DebugMode = true - } else { - firebaseauth = gluefirebaseauth.New(authCli) - } - - // Repository - uRepo := repository.NewUser() - - // Service - dhh := httpheader.NewDummy() - hh := httpheader.New() - uSvc := usecase.NewUser(uRepo) - - // Middleware - d.httpMiddleware = requestlog.New(logger) - - d.gluefirebaseauth = gluefirebaseauth.NewMiddleware(firebaseauth) - d.DummyHTTPHeader = httpheader.NewMiddleware(dhh) - d.HTTPHeader = httpheader.NewMiddleware(hh) - - // Handler - d.UserHandler = api.NewUserHandler(uSvc) -} diff --git a/cmd/rapid/default-http/env.go b/cmd/rapid/default-http/env.go deleted file mode 100644 index 335b7d531..000000000 --- a/cmd/rapid/default-http/env.go +++ /dev/null @@ -1,13 +0,0 @@ -package defaulthttp - -type environment struct { - Port string `env:"DEFAULT_PORT,required"` - Envrionment string `env:"DEFAULT_ENV,required"` - ProjectID string `env:"PROJECT_ID,required"` - CredentialsPath string `env:"GOOGLE_APPLICATION_CREDENTIALS,required"` - MinLogSeverity string `env:"DEFAULT_MIN_LOG_SEVERITY,required"` - DBHost string `env:"DEFAULT_DB_HOST,required"` - DBUser string `env:"DEFAULT_DB_USER,required"` - DBPassword string `env:"DEFAULT_DB_PASSWORD,required"` - DBDatabase string `env:"DEFAULT_DB_DATABASE,required"` -} diff --git a/cmd/rapid/default-http/routing.go b/cmd/rapid/default-http/routing.go deleted file mode 100644 index cc9f16de7..000000000 --- a/cmd/rapid/default-http/routing.go +++ /dev/null @@ -1,33 +0,0 @@ -package defaulthttp - -import ( - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/default/handler" - "github.com/abyssparanoia/rapid-go/internal/pkg/accesscontrol" - "github.com/go-chi/chi" -) - -// Routing ... define routing -func Routing(r chi.Router, d Dependency) { - - // access control - r.Use(accesscontrol.Handle) - - // request log - r.Use(d.httpMiddleware.Handle) - - // need to authenticate for production - r.Route("/v1", func(r chi.Router) { - r.With(d.gluefirebaseauth.Handle).Route("/users", func(r chi.Router) { - //r.Post("/", d.UserHandler.Create) - r.Get("/{userID}", d.UserHandler.Get) - }) - }) - - // Ping - r.Get("/ping", handler.Ping) - r.Get("/", handler.Ping) - - http.Handle("/", r) -} diff --git a/cmd/rapid/default-http/run.go b/cmd/rapid/default-http/run.go deleted file mode 100644 index 37d00b1f7..000000000 --- a/cmd/rapid/default-http/run.go +++ /dev/null @@ -1,69 +0,0 @@ -package defaulthttp - -import ( - "context" - "fmt" - "net/http" - "os" - "os/signal" - "syscall" - "time" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - "go.uber.org/zap" - - "github.com/caarlos0/env/v6" - "github.com/go-chi/chi" -) - -func run() { - - e := &environment{} - if err := env.Parse(e); err != nil { - panic(err) - } - - logger, err := log.New(e.Envrionment) - if err != nil { - panic(err) - } - - // Dependency - d := Dependency{} - d.Inject(e, logger) - - // Routing - r := chi.NewRouter() - Routing(r, d) - - addr := fmt.Sprintf(":%s", e.Port) - - //server - server := http.Server{ - Addr: addr, - Handler: r, - } - - // Run - logger.Info(fmt.Sprintf("[START] server. port: %s\n", addr)) - go func() { - if err := server.ListenAndServe(); err != http.ErrServerClosed { - logger.Error("[CLOSED] server closed with error", zap.Error(err)) - } - }() - - // graceful shuttdown - quit := make(chan os.Signal, 1) - signal.Notify(quit, syscall.SIGTERM, os.Interrupt) - logger.Info(fmt.Sprintf("SIGNAL %d received, so server shutting down now...\n", <-quit)) - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - err = server.Shutdown(ctx) - if err != nil { - logger.Error("failed to gracefully shutdown", zap.Error(err)) - } - - logger.Info("server shutdown completed") -} diff --git a/cmd/rapid/main.go b/cmd/rapid/main.go deleted file mode 100644 index f7d07b015..000000000 --- a/cmd/rapid/main.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - execute() -} diff --git a/cmd/rapid/push-notification/cmd.go b/cmd/rapid/push-notification/cmd.go deleted file mode 100644 index d3fc5f075..000000000 --- a/cmd/rapid/push-notification/cmd.go +++ /dev/null @@ -1,31 +0,0 @@ -package notification - -import ( - "github.com/spf13/cobra" -) - -// NewPushNotificationCmd ... new notification server cmd -func NewPushNotificationCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "push-notification", - Short: "cli default push notification server", - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - cmd.HelpFunc()(cmd, args) - } - }, - } - cmd.AddCommand(newPushNotificationRunCmd()) - return cmd -} - -func newPushNotificationRunCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "run", - Short: "running push notification server", - Run: func(cmd *cobra.Command, args []string) { - run() - }, - } - return cmd -} diff --git a/cmd/rapid/push-notification/dependency.go b/cmd/rapid/push-notification/dependency.go deleted file mode 100644 index 8acad941b..000000000 --- a/cmd/rapid/push-notification/dependency.go +++ /dev/null @@ -1,47 +0,0 @@ -package notification - -import ( - "github.com/abyssparanoia/rapid-go/internal/pkg/gluefcm" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluefirestore" - "github.com/abyssparanoia/rapid-go/internal/pkg/httpheader" - "github.com/abyssparanoia/rapid-go/internal/pkg/middleware/requestlog" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/service" - "github.com/abyssparanoia/rapid-go/internal/push-notification/handler/api" - "github.com/abyssparanoia/rapid-go/internal/push-notification/infrastructure/repository" - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase" - "go.uber.org/zap" -) - -// Dependency ... dependency -type Dependency struct { - httpMiddleware *requestlog.HTTPMiddleware - DummyHTTPHeader *httpheader.Middleware - HTTPHeader *httpheader.Middleware - TokenHandler *api.TokenHandler - MessageHandler *api.MessageHandler -} - -// Inject ... inject dependency -func (d *Dependency) Inject(e *environment, logger *zap.Logger) { - - fcmClient := gluefcm.NewClient(e.ProjectID) - firestoreClient := gluefirestore.NewClient(e.ProjectID) - - tokenRepository := repository.NewToken(firestoreClient) - fcmRepository := repository.NewFcm(fcmClient, e.FcmServerKey) - - tokenService := service.NewToken(tokenRepository) - - tokenUsecase := usecase.NewToken(fcmRepository, tokenRepository, tokenService) - messageUsecase := usecase.NewMessage(fcmRepository, tokenRepository) - - dhh := httpheader.NewDummy() - hh := httpheader.New() - - d.httpMiddleware = requestlog.New(logger) - - d.DummyHTTPHeader = httpheader.NewMiddleware(dhh) - d.HTTPHeader = httpheader.NewMiddleware(hh) - d.TokenHandler = api.NewTokenHandler(tokenUsecase) - d.MessageHandler = api.NewMessageHandler(messageUsecase) -} diff --git a/cmd/rapid/push-notification/env.go b/cmd/rapid/push-notification/env.go deleted file mode 100644 index f450223c0..000000000 --- a/cmd/rapid/push-notification/env.go +++ /dev/null @@ -1,10 +0,0 @@ -package notification - -type environment struct { - Port string `env:"PUSH_NOTIFICATION_PORT,required"` - Envrionment string `env:"PUSH_NOTIFICATION_ENV,required"` - ProjectID string `env:"PROJECT_ID,required"` - CredentialsPath string `env:"GOOGLE_APPLICATION_CREDENTIALS,required"` - MinLogSeverity string `env:"PUSH_NOTIFICATION_MIN_LOG_SEVERITY,required"` - FcmServerKey string `env:"FCM_SERVER_KEY,required"` -} diff --git a/cmd/rapid/push-notification/routing.go b/cmd/rapid/push-notification/routing.go deleted file mode 100644 index f5ad145ba..000000000 --- a/cmd/rapid/push-notification/routing.go +++ /dev/null @@ -1,39 +0,0 @@ -package notification - -import ( - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/pkg/accesscontrol" - "github.com/abyssparanoia/rapid-go/internal/push-notification/handler" - "github.com/go-chi/chi" -) - -// Routing ... define routing -func Routing(r chi.Router, d Dependency) { - - // access control - r.Use(accesscontrol.Handle) - - // request log - r.Use(d.httpMiddleware.Handle) - - // need to authenticate for production - r.Route("/v1", func(r chi.Router) { - r.Route("/tokens", func(r chi.Router) { - r.Post("/set", d.TokenHandler.Set) - r.Post("/delete", d.TokenHandler.Delete) - }) - - r.Route("/messages", func(r chi.Router) { - r.Post("/send_to_user", d.MessageHandler.SendToUser) - r.Post("/send_to_multi_user", d.MessageHandler.SendToMultiUser) - r.Post("/send_to_all_user", d.MessageHandler.SendToAllUser) - }) - }) - - // Ping - r.Get("/ping", handler.Ping) - r.Get("/", handler.Ping) - - http.Handle("/", r) -} diff --git a/cmd/rapid/push-notification/run.go b/cmd/rapid/push-notification/run.go deleted file mode 100644 index f79edaa57..000000000 --- a/cmd/rapid/push-notification/run.go +++ /dev/null @@ -1,69 +0,0 @@ -package notification - -import ( - "context" - "fmt" - "net/http" - "os" - "os/signal" - "syscall" - "time" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - "go.uber.org/zap" - - "github.com/caarlos0/env/v6" - "github.com/go-chi/chi" -) - -func run() { - - e := &environment{} - if err := env.Parse(e); err != nil { - panic(err) - } - - logger, err := log.New(e.Envrionment) - if err != nil { - panic(err) - } - - // Dependency - d := Dependency{} - d.Inject(e, logger) - - // Routing - r := chi.NewRouter() - Routing(r, d) - - addr := fmt.Sprintf(":%s", e.Port) - - //server - server := http.Server{ - Addr: addr, - Handler: r, - } - - // Run - logger.Info(fmt.Sprintf("[START] server. port: %s\n", addr)) - go func() { - if err := server.ListenAndServe(); err != http.ErrServerClosed { - logger.Error("[CLOSED] server closed with error", zap.Error(err)) - } - }() - - // graceful shuttdown - quit := make(chan os.Signal, 1) - signal.Notify(quit, syscall.SIGTERM, os.Interrupt) - logger.Info(fmt.Sprintf("SIGNAL %d received, so server shutting down now...\n", <-quit)) - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - err = server.Shutdown(ctx) - if err != nil { - logger.Error("failed to gracefully shutdown", zap.Error(err)) - } - - logger.Info("server shutdown completed") -} diff --git a/cmd/rapid/root.go b/cmd/rapid/root.go deleted file mode 100644 index 687610407..000000000 --- a/cmd/rapid/root.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "fmt" - "os" - - notification "github.com/abyssparanoia/rapid-go/cmd/rapid/push-notification" - - defaulthttp "github.com/abyssparanoia/rapid-go/cmd/rapid/default-http" - - defaultgrpc "github.com/abyssparanoia/rapid-go/cmd/rapid/default-grpc" - - "github.com/spf13/cobra" -) - -func newCmdRoot() *cobra.Command { - cmd := &cobra.Command{ - Use: "rapid", - Short: "cli tool for rapid-go", - Long: "cli tool for rapid-go", - Run: func(cmd *cobra.Command, args []string) { - if len(args) == 0 { - cmd.HelpFunc()(cmd, args) - } - }, - } - cmd.AddCommand(defaultgrpc.NewDefaultGRPCCmd()) - cmd.AddCommand(defaulthttp.NewDefaultHTTPCmd()) - cmd.AddCommand(notification.NewPushNotificationCmd()) - return cmd -} - -func execute() { - cmd := newCmdRoot() - if err := cmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} diff --git a/db/authentication/sql/01-create_db.sql b/db/authentication/sql/01-create_db.sql deleted file mode 100644 index 2ad00a450..000000000 --- a/db/authentication/sql/01-create_db.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE DATABASE catharsis_authentication; \ No newline at end of file diff --git a/db/authentication/sql/02-create_table.sql b/db/authentication/sql/02-create_table.sql deleted file mode 100644 index 10952727d..000000000 --- a/db/authentication/sql/02-create_table.sql +++ /dev/null @@ -1,16 +0,0 @@ -\c catharsis_authentication; - -create extension "uuid-ossp"; - -create table users ( - id uuid DEFAULT uuid_generate_v4 () primary key, - password varchar NOT NULL, - display_name varchar NOT NULL, - icon_image_path varchar NOT NULL, - background_image_path varchar NOT NULL, - profile varchar, - email varchar, - created_at timestamp NOT NULL, - updated_at timestamp NOT NULL, - deleted_at timestamp -); \ No newline at end of file diff --git a/db/authentication/sqlboiler.toml b/db/authentication/sqlboiler.toml deleted file mode 100644 index 7c38b0229..000000000 --- a/db/authentication/sqlboiler.toml +++ /dev/null @@ -1,7 +0,0 @@ -[psql] - dbname = "catharsis_authentication" - host = "localhost" - port = 5432 - user = "postgres" - pass = "password" - sslmode = "disable" \ No newline at end of file diff --git a/db/default/initdb.d/01-create_db.sql b/db/default/initdb.d/01-create_db.sql deleted file mode 100644 index f04ca1915..000000000 --- a/db/default/initdb.d/01-create_db.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE DATABASE IF NOT EXISTS defaultdb \ No newline at end of file diff --git a/db/default/initdb.d/02-create_table.sql b/db/default/initdb.d/02-create_table.sql deleted file mode 100644 index c255d84df..000000000 --- a/db/default/initdb.d/02-create_table.sql +++ /dev/null @@ -1,15 +0,0 @@ -USE `defaultdb`; - -CREATE TABLE `users` ( - `id` varchar(50) NOT NULL COMMENT 'firebase auth UID', - `display_name` varchar(36) NOT NULL COMMENT 'display name', - `icon_image_path` varchar(3000) NOT NULL COMMENT 'profile icon image path', - `background_image_path` varchar(3000) NOT NULL COMMENT 'background image path', - `profile` varchar(1024) NULL COMMENT 'profile text', - `email` varchar(1024) NULL COMMENT 'email address', - `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'creation date', - `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'updation date', - `deleted_at` TIMESTAMP NULL COMMENT 'delete date', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 -COMMENT "users table"; diff --git a/db/default/initdb.d/03-insert-seed.sql b/db/default/initdb.d/03-insert-seed.sql deleted file mode 100644 index a425ca37d..000000000 --- a/db/default/initdb.d/03-insert-seed.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE `defaultdb`; - -INSERT INTO `users` ( - id, display_name, icon_image_path, background_image_path, profile ,created_at, updated_at -) -VALUES - ('DUMMY_USER_ID','tarou','icon_url','background_url','profile',NOW(),NOW()); \ No newline at end of file diff --git a/db/default/sqlboiler.toml b/db/default/sqlboiler.toml deleted file mode 100644 index 5335579a7..000000000 --- a/db/default/sqlboiler.toml +++ /dev/null @@ -1,7 +0,0 @@ -[mysql] - dbname = "defaultdb" - host = "localhost" - port = 3306 - user = "root" - pass = "password" - sslmode = "false" \ No newline at end of file diff --git a/db/default/Dockerfile b/db/main/Dockerfile similarity index 73% rename from db/default/Dockerfile rename to db/main/Dockerfile index 903e43941..aface2e05 100644 --- a/db/default/Dockerfile +++ b/db/main/Dockerfile @@ -1,4 +1,4 @@ -FROM mysql:8.0 +FROM --platform=linux/amd64 mysql:8.0.30 ADD ./my.cnf /etc/mysql/conf.d/my.cnf diff --git a/db/main/initdb.d/01-create_db.sql b/db/main/initdb.d/01-create_db.sql new file mode 100644 index 000000000..a2d5ef3ee --- /dev/null +++ b/db/main/initdb.d/01-create_db.sql @@ -0,0 +1 @@ +CREATE DATABASE IF NOT EXISTS maindb \ No newline at end of file diff --git a/db/main/migrations/20220930004233_initilize.sql b/db/main/migrations/20220930004233_initilize.sql new file mode 100644 index 000000000..2eeb8330d --- /dev/null +++ b/db/main/migrations/20220930004233_initilize.sql @@ -0,0 +1,45 @@ +-- +goose Up +CREATE TABLE `tenants` ( + `id` VARCHAR(64) NOT NULL COMMENT "id", + `name` VARCHAR(256) NOT NULL COMMENT "name", + `created_at` TIMESTAMP NOT NULL COMMENT "created date", + `updated_at` TIMESTAMP NOT NULL COMMENT "update date", + CONSTRAINT `tenants_pkey` PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 +COMMENT "tenant"; + +CREATE TABLE `user_roles` ( + `id` VARCHAR(32) NOT NULL COMMENT "id", + CONSTRAINT `user_roles_pkey` PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 +COMMENT "user_role"; + +INSERT INTO `user_roles` + (`id`) +VALUES + ('normal'), + ('admin'); + + +CREATE TABLE `users` ( + `id` VARCHAR(64) NOT NULL COMMENT "id", + `tenant_id` VARCHAR(64) NOT NULL COMMENT "tenant_id", + `role` VARCHAR(32) NOT NULL COMMENT "role", + `auth_uid` VARCHAR(256) NOT NULL COMMENT "auth_uid", + `display_name` VARCHAR(256) NOT NULL COMMENT "display_name", + `image_path` VARCHAR(1024) NOT NULL COMMENT "auth_uid", + `email` VARCHAR(512) NOT NULL COMMENT "email", + `created_at` TIMESTAMP NOT NULL COMMENT "created date", + `updated_at` TIMESTAMP NOT NULL COMMENT "update date", + CONSTRAINT `users_pkey` PRIMARY KEY (`id`), + UNIQUE `users_unique_email` (`email`), + UNIQUE `users_unique_auth_uid` (`auth_uid`), + CONSTRAINT `users_fkey_tenant_id` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`), + CONSTRAINT `users_fkey_role` FOREIGN KEY (`role`) REFERENCES `user_roles` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 +COMMENT "user"; + +-- +goose Down +DROP TABLE users; +DROP TABLE user_roles; +DROP TABLE tenants; diff --git a/db/default/my.cnf b/db/main/my.cnf similarity index 100% rename from db/default/my.cnf rename to db/main/my.cnf diff --git a/db/main/sqlboiler.toml b/db/main/sqlboiler.toml new file mode 100644 index 000000000..700ee3748 --- /dev/null +++ b/db/main/sqlboiler.toml @@ -0,0 +1,15 @@ +add-global-variants = true +add-panic-variants = true +no-driver-templates = true +no-tests = true +output = "internal/infrastructure/database/internal/dbmodel" +pkgname = "dbmodel" +wipe = true + +[mysql] + dbname = "maindb" + host = "localhost" + port = 3306 + user = "root" + pass = "password" + sslmode = "false" \ No newline at end of file diff --git a/deployment/default/staging/cloudbuild.yaml b/deployment/default/staging/cloudbuild.yaml deleted file mode 100644 index fb86fd969..000000000 --- a/deployment/default/staging/cloudbuild.yaml +++ /dev/null @@ -1,70 +0,0 @@ -steps: - - id: Decrypt serviceAccount - name: "gcr.io/cloud-builders/gcloud" - args: - [ - "kms", - "decrypt", - "--location", - "asia-northeast1", - "--keyring", - "dkeyring", - "--key", - "serviceAccount_crypto_key", - "--ciphertext-file", - "serviceAccount.json.encrypted", - "--plaintext-file", - "serviceAccount.json", - ] - - - id: Decrypt dotenv - name: "gcr.io/cloud-builders/gcloud" - args: - [ - "kms", - "decrypt", - "--location", - "asia-northeast1", - "--keyring", - "dkeyring", - "--key", - "dotenv_crypto_key", - "--ciphertext-file", - "dev.dotenv.encrypted", - "--plaintext-file", - ".env.default", - ] - - - id: Build docker image - name: gcr.io/cloud-builders/docker - args: - [ - "build", - "-t", - "asia.gcr.io/$PROJECT_ID/default:$SHORT_SHA", - "-f", - "./docker/production/default/Dockerfile", - ".", - ] - - - id: Push docker image to GCR - name: gcr.io/cloud-builders/docker - args: ["push", "asia.gcr.io/$PROJECT_ID/default:$SHORT_SHA"] - - - id: Deploy Cloud Run - name: gcr.io/cloud-builders/gcloud - args: - [ - "beta", - "run", - "deploy", - "default", - "--project", - "${PROJECT_ID}", - "--image", - "asia.gcr.io/$PROJECT_ID/default:$SHORT_SHA", - "--platform", - "managed", - "--region", - "asia-northeast1", - ] diff --git a/deployment/envoy/envoy.yaml b/deployment/envoy/envoy.yaml deleted file mode 100644 index 39911e1c9..000000000 --- a/deployment/envoy/envoy.yaml +++ /dev/null @@ -1,52 +0,0 @@ -admin: - access_log_path: /tmp/admin_access.log - address: - socket_address: { address: 0.0.0.0, port_value: 9901 } - -static_resources: - listeners: - - name: listener1 - address: - socket_address: { address: 0.0.0.0, port_value: 51051 } - filter_chains: - - filters: - - name: envoy.http_connection_manager - typed_config: - "@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager - stat_prefix: grpc_json - codec_type: AUTO - route_config: - name: local_route - virtual_hosts: - - name: local_service - domains: ["*"] - routes: - - match: { prefix: "/" } - route: { cluster: grpc, timeout: { seconds: 60 } } - http_filters: - - name: envoy.grpc_json_transcoder - config: - proto_descriptor: "/etc/pb/default/user.pb" - services: ["default.UserService"] - print_options: - add_whitespace: true - always_print_primitive_fields: true - always_print_enums_as_ints: false - preserve_proto_field_names: false - - name: envoy.router - clusters: - - name: grpc - connect_timeout: 1.25s - type: logical_dns - lb_policy: round_robin - dns_lookup_family: V4_ONLY - http2_protocol_options: {} - load_assignment: - cluster_name: grpc - endpoints: - - lb_endpoints: - - endpoint: - address: - socket_address: - address: default-grpc-server - port_value: 50051 diff --git a/docker-compose.yml b/docker-compose.yml index 68b4ba1f1..826f73eea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,46 +1,13 @@ version: "3" services: - # default-server: - # build: - # context: . - # dockerfile: docker/development/Dockerfile - # ports: - # - 8080:8080 - # volumes: - # - .:/go/src/github.com/abyssparanoia/rapid-go - # command: ash -c "source .envrc && realize start --name default-server" - - default-grpc-server: &server - build: - context: . - dockerfile: docker/development/Dockerfile - expose: - - 50051 - volumes: - - .:/go/src/github.com/abyssparanoia/rapid-go - command: ash -c "source .envrc && realize start --name default-grpc-server" - - envoy: - image: envoyproxy/envoy:v1.22.0 - volumes: - - "./deployment/envoy:/etc/envoy" - - "./proto:/etc/pb" - expose: - - 51051 - ports: - - 51051:51051 - links: - - default-grpc-server - - default-db: - build: ./db/default + main-db: + build: ./db/main volumes: - - ./db/default/data:/var/lib/mysql - - ./db/default/initdb.d:/docker-entrypoint-initdb.d + - ./db/main/initdb.d:/docker-entrypoint-initdb.d ports: - "3306:3306" environment: TZ: "Asia/Tokyo" MYSQL_ROOT_PASSWORD: password - MYSQL_DATABASE: defaultdb + MYSQL_DATABASE: maindb diff --git a/docker/development.Dockerfile b/docker/development.Dockerfile new file mode 100644 index 000000000..e6e7df806 --- /dev/null +++ b/docker/development.Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.19-alpine AS builder + +WORKDIR /go/src/github.com/abyssparanoia/rapid-go/ + +ENV CGO_ENABLED=0 + +COPY . . + +RUN make build \ No newline at end of file diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile deleted file mode 100644 index a776113e9..000000000 --- a/docker/development/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.18-alpine - -WORKDIR /go/src/github.com/abyssparanoia/rapid-go/ -COPY . . - -ENV GO111MODULE=off - -RUN apk upgrade \ - && apk add git alpine-sdk \ - && go get -u github.com/tockins/realize - -ENV GO111MODULE=on - -RUN go mod download \ No newline at end of file diff --git a/docker/production/default/Dockerfile b/docker/production.Dockerfile similarity index 56% rename from docker/production/default/Dockerfile rename to docker/production.Dockerfile index e9ab54ac1..1b582110a 100644 --- a/docker/production/default/Dockerfile +++ b/docker/production.Dockerfile @@ -1,6 +1,4 @@ -FROM golang:1.13.11-alpine3.10 AS builder - -ARG SERVICE_NAME=default +FROM golang:1.19-alpine AS builder WORKDIR /go/src/github.com/abyssparanoia/rapid-go/ @@ -8,17 +6,14 @@ ENV CGO_ENABLED=0 COPY . . -RUN go install -v -tags netgo -ldflags '-extldflags "-static"' ./cmd/rapid/ +RUN go install -v -tags netgo -ldflags '-extldflags "-static"' ./cmd/app FROM alpine AS server RUN apk add ca-certificates -COPY --from=builder /go/bin/rapid /bin/rapid +COPY --from=builder /go/bin/app /bin/app WORKDIR /go/src/github.com/abyssparanoia/rapid-go/ -ENV PORT 8080 -EXPOSE 8080 - -ENTRYPOINT ["rapid","default-http","run"] \ No newline at end of file +EXPOSE 80 diff --git a/docs/golang.md b/docs/golang.md new file mode 100644 index 000000000..13f0136fc --- /dev/null +++ b/docs/golang.md @@ -0,0 +1,42 @@ +# golang 環境 + +## environment (using direnv) + - service account for gcp. + - save it as serviceAccount.json + +```bash +> cp .envrc.tepl .envrc +> direnv allow +``` + +## run + +```bash +> make http.dev +``` + +## lint + +```bash +> make lint.go + +> make lint.proto +``` + +## generate protocol buffer + openapi(v2) + +```bash +> make generate.buf +``` + +## db migration + +```bash +> make migrate.up +``` + +## generate sqlboiler + +```bash +> make generate.sqlboiler +``` \ No newline at end of file diff --git a/go.mod b/go.mod index db086af49..843a850cb 100644 --- a/go.mod +++ b/go.mod @@ -1,50 +1,286 @@ module github.com/abyssparanoia/rapid-go -go 1.13 +go 1.19 require ( - cloud.google.com/go/firestore v1.6.1 - cloud.google.com/go/iam v0.1.0 // indirect firebase.google.com/go v3.13.0+incompatible - firebase.google.com/go/v4 v4.7.1 github.com/blendle/zapdriver v1.3.1 + github.com/bufbuild/buf v1.8.0 github.com/bxcodec/faker v2.0.1+incompatible - github.com/bxcodec/faker/v3 v3.8.0 github.com/caarlos0/env/v6 v6.7.1 - github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect + github.com/cosmtrek/air v1.40.4 github.com/friendsofgo/errors v0.9.2 - github.com/go-chi/chi v4.1.2+incompatible - github.com/go-chi/chi/v5 v5.0.7 - github.com/go-playground/validator v9.31.0+incompatible - github.com/go-playground/validator/v10 v10.10.0 + github.com/go-playground/validator/v10 v10.11.1 github.com/go-sql-driver/mysql v1.6.0 - github.com/go-testfixtures/testfixtures/v3 v3.6.2 github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.2 + github.com/golangci/golangci-lint v1.49.0 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/joho/godotenv v1.4.0 - github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12 - github.com/kelseyhightower/envconfig v1.4.0 - github.com/lib/pq v1.10.6 - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.18.1 - github.com/opentracing/opentracing-go v1.2.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 + github.com/oklog/ulid v1.3.1 github.com/pkg/errors v0.9.1 - github.com/rs/xid v1.4.0 - github.com/spf13/cobra v1.4.0 - github.com/spf13/viper v1.10.1 - github.com/uber/jaeger-client-go v2.29.1+incompatible - github.com/uber/jaeger-lib v2.2.0+incompatible // indirect - github.com/unrolled/render v1.4.1 - github.com/volatiletech/null v8.0.0+incompatible - github.com/volatiletech/null/v9 v9.0.0 - github.com/volatiletech/sqlboiler v3.7.1+incompatible - github.com/volatiletech/sqlboiler/v4 v4.11.0 - go.uber.org/zap v1.21.0 - golang.org/x/text v0.3.7 - google.golang.org/api v0.68.0 - google.golang.org/genproto v0.0.0-20220526192754-51939a95c655 - google.golang.org/grpc v1.46.2 - gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + github.com/pressly/goose/v3 v3.7.0 + github.com/spf13/cobra v1.5.0 + github.com/stretchr/testify v1.8.0 + github.com/volatiletech/null/v8 v8.1.2 + github.com/volatiletech/sqlboiler/v4 v4.13.0 + github.com/volatiletech/strmangle v0.0.4 + go.uber.org/zap v1.22.0 + golang.org/x/tools v0.1.12 + google.golang.org/api v0.84.0 + google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc + google.golang.org/grpc v1.48.0 + google.golang.org/protobuf v1.28.1 +) + +require ( + 4d63.com/gochecknoglobals v0.1.0 // indirect + cloud.google.com/go v0.102.0 // indirect + cloud.google.com/go/compute v1.7.0 // indirect + cloud.google.com/go/firestore v1.6.1 // indirect + cloud.google.com/go/iam v0.3.0 // indirect + cloud.google.com/go/storage v1.22.1 // indirect + github.com/Antonboom/errname v0.1.7 // indirect + github.com/Antonboom/nilnil v0.1.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/BurntSushi/toml v1.2.0 // indirect + github.com/ClickHouse/clickhouse-go/v2 v2.2.0 // indirect + github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/OpenPeeDeeP/depguard v1.1.0 // indirect + github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/alingse/asasalint v0.0.11 // indirect + github.com/ashanbrown/forbidigo v1.3.0 // indirect + github.com/ashanbrown/makezero v1.1.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/blizzy78/varnamelen v0.8.0 // indirect + github.com/bombsimon/wsl/v3 v3.3.0 // indirect + github.com/breml/bidichk v0.2.3 // indirect + github.com/breml/errchkjson v0.3.0 // indirect + github.com/bufbuild/connect-go v0.4.0 // indirect + github.com/butuzov/ireturn v0.1.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/charithe/durationcheck v0.0.9 // indirect + github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect + github.com/containerd/containerd v1.6.8 // indirect + github.com/containerd/typeurl v1.0.2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/creack/pty v1.1.11 // indirect + github.com/curioswitch/go-reassign v0.1.2 // indirect + github.com/daixiang0/gci v0.6.3 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/denisenkom/go-mssqldb v0.12.2 // indirect + github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/docker/docker v20.10.17+incompatible // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.4.0 // indirect + github.com/esimonov/ifshort v1.0.4 // indirect + github.com/ettle/strcase v0.1.1 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/firefart/nonamedreturns v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/go-chi/chi/v5 v5.0.7 // indirect + github.com/go-critic/go-critic v0.6.4 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-toolsmith/astcast v1.0.0 // indirect + github.com/go-toolsmith/astcopy v1.0.1 // indirect + github.com/go-toolsmith/astequal v1.0.2 // indirect + github.com/go-toolsmith/astfmt v1.0.0 // indirect + github.com/go-toolsmith/astp v1.0.0 // indirect + github.com/go-toolsmith/strparse v1.0.0 // indirect + github.com/go-toolsmith/typep v1.0.2 // indirect + github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/gofrs/uuid v4.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect + github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect + github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect + github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a // indirect + github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect + github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect + github.com/golangci/misspell v0.3.5 // indirect + github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/go-cmp v0.5.8 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa // indirect + github.com/googleapis/gax-go/v2 v2.4.0 // indirect + github.com/googleapis/go-type-adapters v1.0.0 // indirect + github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect + github.com/gostaticanalysis/analysisutil v0.7.1 // indirect + github.com/gostaticanalysis/comment v1.4.2 // indirect + github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect + github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/huandu/xstrings v1.3.1 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.13.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.12.0 // indirect + github.com/jackc/pgx/v4 v4.17.0 // indirect + github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a // indirect + github.com/jgautheron/goconst v1.5.1 // indirect + github.com/jhump/protocompile v0.0.0-20220812162104-d108583e055d // indirect + github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b // indirect + github.com/jingyugao/rowserrcheck v1.1.1 // indirect + github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/julz/importas v0.1.0 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/kisielk/errcheck v1.6.2 // indirect + github.com/kisielk/gotool v1.0.0 // indirect + github.com/klauspost/compress v1.15.9 // indirect + github.com/klauspost/pgzip v1.2.5 // indirect + github.com/kulti/thelper v0.6.3 // indirect + github.com/kunwardeep/paralleltest v1.0.6 // indirect + github.com/kyoh86/exportloopref v0.1.8 // indirect + github.com/ldez/gomoddirectives v0.2.3 // indirect + github.com/ldez/tagliatelle v0.3.1 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/leonklingele/grouper v1.1.0 // indirect + github.com/lufeee/execinquery v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/maratori/testpackage v1.1.0 // indirect + github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mbilski/exhaustivestruct v1.2.0 // indirect + github.com/mgechev/revive v1.2.3 // indirect + github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/moby/buildkit v0.10.3 // indirect + github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect + github.com/moricho/tparallel v0.2.1 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/nakabonne/nestif v0.3.1 // indirect + github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect + github.com/nishanths/exhaustive v0.8.1 // indirect + github.com/nishanths/predeclared v0.2.2 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect + github.com/paulmach/orb v0.7.1 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect + github.com/pierrec/lz4/v4 v4.1.15 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/profile v1.6.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/polyfloyd/go-errorlint v1.0.2 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/quasilyte/go-ruleguard v0.3.17 // indirect + github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5 // indirect + github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect + github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect + github.com/rs/cors v1.8.2 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryancurrah/gomodguard v1.2.4 // indirect + github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect + github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect + github.com/sashamelentyev/interfacebloat v1.1.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.13.0 // indirect + github.com/securego/gosec/v2 v2.13.1 // indirect + github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/sivchari/containedctx v1.0.2 // indirect + github.com/sivchari/nosnakecase v1.7.0 // indirect + github.com/sivchari/tenv v1.7.0 // indirect + github.com/sonatard/noctx v0.0.1 // indirect + github.com/sourcegraph/go-diff v0.6.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.12.0 // indirect + github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect + github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/stretchr/objx v0.4.0 // indirect + github.com/subosito/gotenv v1.4.0 // indirect + github.com/sylvia7788/contextcheck v1.0.6 // indirect + github.com/tdakkota/asciicheck v0.1.1 // indirect + github.com/tetafro/godot v1.4.11 // indirect + github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect + github.com/timonwong/logrlint v0.1.0 // indirect + github.com/tomarrell/wrapcheck/v2 v2.6.2 // indirect + github.com/tommy-muehle/go-mnd/v2 v2.5.0 // indirect + github.com/ultraware/funlen v0.0.3 // indirect + github.com/ultraware/whitespace v0.0.5 // indirect + github.com/uudashr/gocognit v1.0.6 // indirect + github.com/volatiletech/inflect v0.0.1 // indirect + github.com/volatiletech/randomize v0.0.1 // indirect + github.com/yagipy/maintidx v1.0.0 // indirect + github.com/yeya24/promlinter v0.2.0 // indirect + github.com/ziutek/mymysql v1.5.4 // indirect + gitlab.com/bosi/decorder v0.2.3 // indirect + go.opencensus.io v0.23.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect + go.opentelemetry.io/otel v1.9.0 // indirect + go.opentelemetry.io/otel/trace v1.9.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d // indirect + golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect + golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect + golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect + golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect + golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect + golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + google.golang.org/appengine v1.6.7 // indirect + gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + honnef.co/go/tools v0.3.3 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.36.1 // indirect + modernc.org/ccgo/v3 v3.16.8 // indirect + modernc.org/libc v1.16.19 // indirect + modernc.org/mathutil v1.4.1 // indirect + modernc.org/memory v1.1.1 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/sqlite v1.18.1 // indirect + modernc.org/strutil v1.1.2 // indirect + modernc.org/token v1.0.0 // indirect + mvdan.cc/gofumpt v0.3.1 // indirect + mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect + mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect + mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect ) diff --git a/go.sum b/go.sum index 5e97a936d..7aabc4f4c 100644 --- a/go.sum +++ b/go.sum @@ -1,238 +1,231 @@ -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= +4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= +4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0 h1:WRz29PgAsVEyPSDHyk+0fpEkwEFyfhHn+JbksT6gIL4= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0 h1:RmDygqvj27Zf3fCQjQRtLyC7KwFcHkeJitcO0OoGOcA= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0 h1:eWRCuwubtDrCJG0oSUMgnsbD4CmPFQF2ei4OFbXvwww= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0 h1:oKpsiyKMfVpwR3zSAkQixGzlVE5ovitBuO0qSmCf0bI= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0 h1:oqqswrt4x6b9OGBnNqdssxBl1xf0rSUNjU2BR4BZar0= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0 h1:bAMqZidYkmIsUqe6PtkEPT7Q+vfizScn+jfNA6jwK9c= cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0 h1:8ZtzmY4a2JIO2sljMbpqkDYxA8aJQveYr3AMa+X40oc= cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.88.0 h1:MZ2cf9Elnv1wqccq8ooKO2MqHQLc+ChCp/+QWObCpxg= -cloud.google.com/go v0.88.0/go.mod h1:dnKwfYbP9hQhefiUvpbcAyoGSHUrOxR20JVElLiUvEY= -cloud.google.com/go v0.90.0 h1:MjvSkUq8RuAb+2JLDi5VQmmExRJPUQ3JLCWpRB6fmdw= cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3 h1:wPBktZFzYBcCZVARvwVKqH1uEj+aLXofJEtrb4oOsio= cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1 h1:DwuSvDZ1pTYGbXo8yOJevCTr3BoBlE+OVkHAKiYQUXc= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0 h1:w6LozQJyDDEyhf64Uusu1LCcnLt0I1VMLiJC2kV+eXk= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0 h1:y/cM2iqGgGi5D5DQZl6D9STN/3dR/Vx5Mp8s752oJTY= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= -cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0 h1:DAq3r8y4mDgyB/ZPJ9v/5VJNqjgJAxTn6ZYLlUywOu8= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v0.1.0 h1:rSUBvAyVwNJ5uQCKNJFMwPtTvJkfN38b6Pvb9zZoqJ8= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.2.0 h1:EKki8sSdvDU0OO9mAXGwPXOTOgPz2l08R0/IutDH11I= -cloud.google.com/go/compute v1.2.0/go.mod h1:xlogom/6gr8RJGBe7nT2eGsQYAFUbbv8dbC29qE3Xmw= -cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.1.1 h1:vFLWT9tT+SQnfY20DgeNmwh56CSB3kc+Jt16o6Wy8IE= -cloud.google.com/go/firestore v1.1.1/go.mod h1:ADXYdzUfnr5T2SaB0Of9UXDIjgcRIZ221HQOikRONfE= -cloud.google.com/go/firestore v1.5.0 h1:4qNItsmc4GP6UOZPGemmHY4ZfPofVhcaKXsYw9wm9oA= -cloud.google.com/go/firestore v1.5.0/go.mod h1:c4nNYR1qdq7eaZ+jSc5fonrQN2k3M7sWATcYTiakjEo= -cloud.google.com/go/firestore v1.6.0 h1:dMIWvm+3O0E3DM7kcZPH0FBQ94Xg/OMkdTNDaY9itbI= cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= cloud.google.com/go/firestore v1.6.1 h1:8rBq3zRjnHx8UtBvaOWqBB1xq9jH6/wltfQLlTMh2Fw= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= -cloud.google.com/go/iam v0.1.0 h1:W2vbGCrE3Z7J/x3WXLxxGl9LMSB2uhsAA7Ss/6u/qRY= -cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0 h1:9/vpR43S4aJaROxqQHQ3nH9lfyKKV0dC3vOmnw8ebQQ= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0 h1:VV2nUM3wwLLGh9lSABFgZMjInyUbJeaRSE64WuAIQ+4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0 h1:RPUcBvDeYgQFMfQu1eBMq6piD1SXmLH+vK3qjewZPus= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -firebase.google.com/go v3.12.1+incompatible h1:lTLxDHUZWtpvrpCUM7AsHbwfmM8DSkVlrFRtNt9aSW4= -firebase.google.com/go v3.12.1+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= -firebase.google.com/go/v4 v4.0.0/go.mod h1:mB8wL5ohyReUeds5IIaA1+pOw3Tk1aybMEwceIQEqVg= -firebase.google.com/go/v4 v4.1.0/go.mod h1:ZEg8GLS38m7BMB3RcOd3RE1t2BPV8QglyOW2SpRH1uw= -firebase.google.com/go/v4 v4.2.0/go.mod h1:ZEg8GLS38m7BMB3RcOd3RE1t2BPV8QglyOW2SpRH1uw= -firebase.google.com/go/v4 v4.3.0/go.mod h1:ZEg8GLS38m7BMB3RcOd3RE1t2BPV8QglyOW2SpRH1uw= -firebase.google.com/go/v4 v4.4.0/go.mod h1:ZEg8GLS38m7BMB3RcOd3RE1t2BPV8QglyOW2SpRH1uw= -firebase.google.com/go/v4 v4.5.0/go.mod h1:UgGSTOhEZVbB2L3dQ3z4pThDTiH869i8TDAZKnrHKbU= -firebase.google.com/go/v4 v4.6.0/go.mod h1:UgGSTOhEZVbB2L3dQ3z4pThDTiH869i8TDAZKnrHKbU= -firebase.google.com/go/v4 v4.6.1/go.mod h1:UgGSTOhEZVbB2L3dQ3z4pThDTiH869i8TDAZKnrHKbU= -firebase.google.com/go/v4 v4.7.0/go.mod h1:UgGSTOhEZVbB2L3dQ3z4pThDTiH869i8TDAZKnrHKbU= -firebase.google.com/go/v4 v4.7.1/go.mod h1:UgGSTOhEZVbB2L3dQ3z4pThDTiH869i8TDAZKnrHKbU= +github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= +github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= +github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= +github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= +github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= +github.com/ClickHouse/clickhouse-go/v2 v2.2.0 h1:dj00TDKY+xwuTJdbpspCSmTLFyWzRJerTHwaBxut1C0= +github.com/ClickHouse/clickhouse-go/v2 v2.2.0/go.mod h1:8f2XZUi7XoeU+uPIytSi1cvx8fmJxi7vIgqpvYTF1+o= github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= +github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/OpenPeeDeeP/depguard v1.1.0 h1:pjK9nLPS1FwQYGGpPxoMYpe7qACHOhAWQMQzV71i49o= +github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= -github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= -github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apmckinlay/gsuneido v0.0.0-20180907175622-1f10244968e3/go.mod h1:hJnaqxrCRgMCTWtpNz9XUFkBCREiQdlcyK6YNmOfroM= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= +github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= +github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= +github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= +github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= +github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= +github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= +github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= +github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +github.com/bufbuild/buf v1.8.0 h1:53qJ3QY/KOHwSjWgCQYkQaR3jGWst7aOfTXnFe8e+VQ= +github.com/bufbuild/buf v1.8.0/go.mod h1:tBzKkd1fzCcBV6KKSO7zo3rlhk3o1YQ0F2tQKSC2aNU= +github.com/bufbuild/connect-go v0.4.0 h1:fIMyUYG8mXSTH+nnlOx9KmRUf3mBF0R2uKK+BQBoOHE= +github.com/bufbuild/connect-go v0.4.0/go.mod h1:ZEtBnQ7J/m7bvWOW+H8T/+hKQCzPVfhhhICuvtcnjlI= +github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= +github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= github.com/bxcodec/faker v2.0.1+incompatible/go.mod h1:BNzfpVdTwnFJ6GtfYTcQu6l6rHShT+veBxNCnjCx5XM= -github.com/bxcodec/faker/v3 v3.6.0/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= -github.com/bxcodec/faker/v3 v3.7.0/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= -github.com/bxcodec/faker/v3 v3.8.0/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= -github.com/caarlos0/env/v6 v6.2.2 h1:R0NIFXaB/LhwuGrjnsldzpnVNjFU/U+hTVHt+cq0yDY= -github.com/caarlos0/env/v6 v6.2.2/go.mod h1:3LpmfcAYCG6gCiSgDLaFR5Km1FRpPwFvBbRcjHar6Sw= -github.com/caarlos0/env/v6 v6.3.0 h1:PaqGnS5iHScZ5SnZNBPvQbA2VE/eMAwlp51mKGuEZLg= -github.com/caarlos0/env/v6 v6.3.0/go.mod h1:nXKfztzgWXH0C5Adnp+gb+vXHmMjKdBnMrSVSczSkiw= -github.com/caarlos0/env/v6 v6.4.0 h1:fUo2hQNR3O7Yb7E2sYy8cxY42BRvFxWa0G4XBMLJAQM= -github.com/caarlos0/env/v6 v6.4.0/go.mod h1:MX/8qQ2zCofGGkb7FxjmDLOOjUylO2b7dbsIpN30bnY= -github.com/caarlos0/env/v6 v6.5.0 h1:f4C7ZQwm0nRFo8vETCQviLUOtOlOwsOhgc/QXp0zrTM= -github.com/caarlos0/env/v6 v6.5.0/go.mod h1:5ZqhjfyF261xGkANuSuMQ1FeA9ikA3wzDY64wSd9k8k= -github.com/caarlos0/env/v6 v6.6.0 h1:kVhajCpqX5pSfH41gFd8cPXPZahqJrnn9HxJ1vKftW4= -github.com/caarlos0/env/v6 v6.6.0/go.mod h1:P0BVSgU9zfkxfSpFUs6KsO3uWR4k3Ac0P66ibAGTybM= -github.com/caarlos0/env/v6 v6.6.2 h1:BypLXDWQTA32rS4UM7pBz+/0BOuvs6C7LSeQAxMwyvI= -github.com/caarlos0/env/v6 v6.6.2/go.mod h1:P0BVSgU9zfkxfSpFUs6KsO3uWR4k3Ac0P66ibAGTybM= -github.com/caarlos0/env/v6 v6.7.0 h1:OftrMgQyETinUI4YU3WxhHeKtCRonDMtnUO14+ZRXdY= -github.com/caarlos0/env/v6 v6.7.0/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0= github.com/caarlos0/env/v6 v6.7.1 h1:2r2GyonA8aJX6lDEhwFfpxwAX8Z3mvbE1X6vhaSzEyU= github.com/caarlos0/env/v6 v6.7.1/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= +github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 h1:E7LT642ysztPWE0dfz43cWOvMiF42DyTRC+eZIaO4yI= +github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xfuwWPNKXlThldNuJvutYM6J95wNuuVmn55To= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158 h1:CevA8fI91PAnP8vpnXuB8ZYAZ5wqY86nAbxfgK8tWO4= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 h1:KwaoQzs/WeUxxJqiJsZ4euOly1Az/IgZXXSxlD/UBNk= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/containerd/containerd v1.6.8 h1:h4dOFDwzHmqFEP754PgfgTeVXFnLiRc6kiqC7tplDJs= +github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0= +github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmtrek/air v1.40.4 h1:AjSlvS7IofbSf4m0BkJLm6TnBlfREwkJ9eCmLR3FLHc= +github.com/cosmtrek/air v1.40.4/go.mod h1:Urz3nl9UBvc/rntZkXRBttYWt4sBeh2NZaGcdBbkNak= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cristalhq/acmd v0.7.0/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= +github.com/curioswitch/go-reassign v0.1.2 h1:ekM07+z+VFT560Exz4mTv0/s1yU9gem6CJc/tlYpkmI= +github.com/curioswitch/go-reassign v0.1.2/go.mod h1:bFJIHgtTM3hRm2sKXSPkbwNjSFyGURQXyn4IXD2qwfQ= +github.com/daixiang0/gci v0.6.3 h1:wUAqXChk8HbwXn8AfxD9DYSCp9Bpz1L3e6Q4Roe+q9E= +github.com/daixiang0/gci v0.6.3/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA= -github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.0.0-20200206145737-bbfc9a55622e h1:LzwWXEScfcTu7vUZNlDDWDARoSGEtvlDKK2BYHowNeE= -github.com/denisenkom/go-mssqldb v0.0.0-20200206145737-bbfc9a55622e/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= +github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +github.com/denisenkom/go-mssqldb v0.12.2 h1:1OcPn5GBIobjWNd+8yjfHNIaFX14B1pWI3F9HZy5KXw= +github.com/denisenkom/go-mssqldb v0.12.2/go.mod h1:lnIw1mZukFRZDJYQ0Pb833QS2IaC3l5HkEfra2LJ+sk= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v20.10.17+incompatible h1:JYCuMrWaVNophQTOrMMoSwudOVEfcegoZZrleKc1xwE= +github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -240,40 +233,36 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021 h1:fP+fF0up6oPY49OrjPrhIJ8yQfdIM85NXMLkMg1EXVs= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1 h1:cgDRLG7bs59Zd+apAWuzLQL95obVYAymNJek76W3mgw= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2 h1:JiO+kJTpmYGjEodY7O1Zk8oZcNz1+f30UtwtXoFUPzE= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/ericlagergren/decimal v0.0.0-20181231230500-73749d4874d5/go.mod h1:1yj25TwtUlJ+pfOu9apAVaM1RWfZGg+aFpd4hPQZekQ= +github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= +github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= +github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= +github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= +github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/friendsofgo/errors v0.9.2 h1:X6NYxef4efCBdwI7BgS820zFaN7Cphrmb+Pljdzjtgk= github.com/friendsofgo/errors v0.9.2/go.mod h1:yCvFW5AkDIL9qn7suHVLiI/gH228n7PC4Pn44IGoTOI= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-chi/chi v4.1.1+incompatible h1:MmTgB0R8Bt/jccxp+t6S/1VGIKdJw5J74CK/c9tTfA4= -github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= -github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-chi/chi/v5 v5.0.2/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-chi/chi/v5 v5.0.3/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-chi/chi/v5 v5.0.4/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-chi/chi/v5 v5.0.5/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-chi/chi/v5 v5.0.6/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-critic/go-critic v0.6.4 h1:tucuG1pvOyYgpBIrVxw0R6gwO42lNa92Aq3VaDoIs+E= +github.com/go-critic/go-critic v0.6.4/go.mod h1:qL5SOlk7NtY6sJPoVCTKDIgzNOxHkkkOCVDyi9wJe1U= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -283,90 +272,87 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator v9.31.0+incompatible h1:UA72EPEogEnq76ehGdEDp4Mit+3FDh548oRqwVgNsHA= -github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.5.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk= -github.com/go-playground/validator/v10 v10.7.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk= -github.com/go-playground/validator/v10 v10.8.0/go.mod h1:9JhgTzTaE31GZDpH/HSvHiRJrJ3iKAgqqH0Bl/Ocjdk= -github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-testfixtures/testfixtures/v3 v3.2.0 h1:FGAW3z5UzmrZGjR/dZp1u3Tbld0SDmirLO4RrR5++7Q= -github.com/go-testfixtures/testfixtures/v3 v3.2.0/go.mod h1:RZctY24ixituGC73XlAV1gkCwYMVwiSwPm26MNlQIhE= -github.com/go-testfixtures/testfixtures/v3 v3.3.0 h1:wCeFtfwle9Xoj4upskuQZLhvVCuH9VGT7V7mr993nso= -github.com/go-testfixtures/testfixtures/v3 v3.3.0/go.mod h1:P4L3WxgOsCLbAeUC50qX5rdj1ULZfUMqgCbqah3OH5U= -github.com/go-testfixtures/testfixtures/v3 v3.4.0 h1:cny44xqH4ctXRld/COxFGPC7XDyOU8KNnwmfCxEEqoQ= -github.com/go-testfixtures/testfixtures/v3 v3.4.0/go.mod h1:P4L3WxgOsCLbAeUC50qX5rdj1ULZfUMqgCbqah3OH5U= -github.com/go-testfixtures/testfixtures/v3 v3.4.1 h1:Qz9y0wUOXPHzKhK6C79A/menChtEu/xd0Dn5ngVyMD0= -github.com/go-testfixtures/testfixtures/v3 v3.4.1/go.mod h1:P4L3WxgOsCLbAeUC50qX5rdj1ULZfUMqgCbqah3OH5U= -github.com/go-testfixtures/testfixtures/v3 v3.5.0 h1:fFJGHhFdcwy48oTLHvr0WRQ09rGiZE+as9ElvbRWS+c= -github.com/go-testfixtures/testfixtures/v3 v3.5.0/go.mod h1:P4L3WxgOsCLbAeUC50qX5rdj1ULZfUMqgCbqah3OH5U= -github.com/go-testfixtures/testfixtures/v3 v3.6.0 h1:fHrJWcZ0TOHA0UcExV0Nwx+5MR9QXVDWYdVfwe4DfmM= -github.com/go-testfixtures/testfixtures/v3 v3.6.0/go.mod h1:YUBpgqvleDRhkx4MQbzdA7A3G5ca2wLtf9bHbDqNaRQ= -github.com/go-testfixtures/testfixtures/v3 v3.6.1 h1:n4Fv95Exp0D05G6l6CAZv22Ck1EJK0pa0TfPqE4ncSs= -github.com/go-testfixtures/testfixtures/v3 v3.6.1/go.mod h1:Bsb2MoHAfHnNsPpSwAjtOs102mqDuM+1u3nE2OCi0N0= -github.com/go-testfixtures/testfixtures/v3 v3.6.2 h1:xfcTCkQlyDmNF+DtpGvxOnUk8aj4aenOwcKO0valf9o= -github.com/go-testfixtures/testfixtures/v3 v3.6.2/go.mod h1:iok8G2W/yEGHD4R9PDFRr+7PmAKZCKlr36D+HDND5Mo= +github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= +github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= +github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= +github.com/go-toolsmith/astcopy v1.0.1 h1:l09oBhAPyV74kLJ3ZO31iBU8htZGTwr9LTjuMCyL8go= +github.com/go-toolsmith/astcopy v1.0.1/go.mod h1:4TcEdbElGc9twQEYpVo/aieIXfHhiuLh4aLAck6dO7Y= +github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= +github.com/go-toolsmith/astequal v1.0.2 h1:+XvaV8zNxua+9+Oa4AHmgmpo4RYAbwr/qjNppLfX2yM= +github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= +github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= +github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= +github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= +github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5 h1:eD9POs68PHkwrx7hAB78z1cb6PfGq/jyWn3wJywsH1o= +github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= +github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= +github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0 h1:Rd1kQnQu0Hq3qvJppYSG0HtP+f5LPPUiDswTLiEegLg= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= @@ -374,49 +360,58 @@ github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= +github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= +github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= +github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= +github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= +github.com/golangci/golangci-lint v1.49.0 h1:I8WHOavragDttlLHtSraHn/h39C+R60bEQ5NoGcHQr8= +github.com/golangci/golangci-lint v1.49.0/go.mod h1:+V/7lLv449R6w9mQ3WdV0EKh7Je/jTylMeSwBZcLeWE= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= +github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= +github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= +github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -430,621 +425,638 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210715191844-86eeefc3e471/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.4 h1:0ecGp3skIrHWPNGPJDaBIghfA6Sp7Ruo2Io8eLKzWm0= -github.com/google/uuid v1.1.4/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa h1:7MYGT2XEMam7Mtzv1yDUYXANedWvwk3HKkR3MyGowy8= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 h1:0IKlLyQ3Hs9nDaiK5cSHAGmcQEIC8l2Ts1u6x5Dfrqg= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1 h1:V59tBiPuMkySHwJkuq/OYkK0WnOLwCwD3UkTbEMr12U= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 h1:PVRE9d4AQKmbelZ7emNig1+NT27DUmKZn5qXxfio54U= +github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= +github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= +github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= +github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= +github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= +github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= +github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= +github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= +github.com/jackc/pgx/v4 v4.17.0 h1:Hsx+baY8/zU2WtPLQyZi8WbecgcsWEeyoK1jvg/WgIo= +github.com/jackc/pgx/v4 v4.17.0/go.mod h1:Gd6RmOhtFLTu8cp/Fhq4kP195KrshxYJH3oW8AWJ1pw= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= -github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= -github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= -github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= -github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.2.0 h1:lzPl/30ZLkTveYsYZPKMcgXc8MbnE6RsTd4F9KgiLtk= -github.com/jcmturner/gokrb5/v8 v8.2.0/go.mod h1:T1hnNppQsBtxW0tCHMHTkAt8n/sABdzZgZdoFrZaZNM= -github.com/jcmturner/rpc/v2 v2.0.2 h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0= -github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a h1:d4+I1YEKVmWZrgkt6jpXBnLgV2ZjO0YxEtLDdfIZfH4= +github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= +github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= +github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= +github.com/jhump/protocompile v0.0.0-20220812162104-d108583e055d h1:1BLWxsvcb5w9/vGjtyEo//r3dwEPNg7z73nbQ/XV4/s= +github.com/jhump/protocompile v0.0.0-20220812162104-d108583e055d/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= +github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= +github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= +github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12 h1:DQVOxR9qdYEybJUr/c7ku34r3PfajaMYXZwgDM7KuSk= -github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12/go.mod h1:u9MdXq/QageOOSGp7qG4XAQsYUMP+V5zEel/Vrl6OOc= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= +github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= -github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= +github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= +github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= +github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= +github.com/kunwardeep/paralleltest v1.0.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= +github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= +github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= +github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= +github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= +github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= +github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= +github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.1-0.20191011153232-f91d3411e481/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.5.2 h1:yTSXVswvWUOQ3k1sd7vJfDrbSl8lKuscqFJRqjC0ifw= -github.com/lib/pq v1.5.2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc= -github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g= -github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= -github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.1 h1:6VXZrLU0jHBYyAqrSPa+MgPfnSvTPuMgK+k0o5kVFWo= -github.com/lib/pq v1.10.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= -github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ= -github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= +github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/maratori/testpackage v1.1.0 h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q= +github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= +github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= +github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v2.0.2+incompatible h1:qzw9c2GNT8UFrgWNDhCTqRqYUSmu/Dav/9Z58LGpk7U= -github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.14 h1:qZgc/Rwetq+MtyE18WhzjokPD93dNqLGNT3QJuLvBGw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= +github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/mgechev/revive v1.2.3 h1:NzIEEa9+WimQ6q2Ov7OcNeySS/IOcwtkQ8RAh0R5UJ4= +github.com/mgechev/revive v1.2.3/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= +github.com/microsoft/go-mssqldb v0.15.0/go.mod h1:Wr+jfynAR4lYmHA093AL8njUw2T6ovxe2jjBQKxBIco= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM= +github.com/moby/buildkit v0.10.3 h1:/dGykD8FW+H4p++q5+KqKEo6gAkYKyBQHdawdjVwVAU= +github.com/moby/buildkit v0.10.3/go.mod h1:jxeOuly98l9gWHai0Ojrbnczrk/rf+o9/JqNhY+UCSo= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= +github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= +github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= +github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/exhaustive v0.8.1 h1:0QKNascWv9qIHY7zRoZSxeRr6kuk5aAT3YXLTiDmjTo= +github.com/nishanths/exhaustive v0.8.1/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.12.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.12.3/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= -github.com/onsi/ginkgo v1.15.1/go.mod h1:Dd6YFfwBW84ETqqtL0CPyPXillHgY6XhQH3uuCCTr/o= -github.com/onsi/ginkgo v1.15.2/go.mod h1:Dd6YFfwBW84ETqqtL0CPyPXillHgY6XhQH3uuCCTr/o= -github.com/onsi/ginkgo v1.16.0/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.3/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.0 h1:Gwkk+PTu/nfOwNMtUB/mRUv0X7ewW5dO4AERT1ThVKo= -github.com/onsi/gomega v1.10.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= -github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= -github.com/onsi/gomega v1.12.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/paulmach/orb v0.7.1 h1:Zha++Z5OX/l168sqHK3k4z18LDvr+YAO/VjK0ReQ9rU= +github.com/paulmach/orb v0.7.1/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhmqB/A= +github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= +github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= +github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/polyfloyd/go-errorlint v1.0.2 h1:kp1yvHflYhTmw5m3MmBy8SCyQkKPjwDthVuMH0ug6Yk= +github.com/polyfloyd/go-errorlint v1.0.2/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/pressly/goose/v3 v3.7.0 h1:jblaZul15uCIEKHRu5KUdA+5wDA7E60JC0TOthdrtf8= +github.com/pressly/goose/v3 v3.7.0/go.mod h1:N5gqPdIzdxf3BiPWdmoPreIwHStkxsvKWE5xjUvfYNk= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= +github.com/quasilyte/go-ruleguard v0.3.17 h1:cDdoaSbQg11LXPDQqiCK54QmQXsEQQCTIgdcpeULGSI= +github.com/quasilyte/go-ruleguard v0.3.17/go.mod h1:sST5PvaR7yb/Az5ksX8oc88usJ4EGjmJv7cK7y3jyig= +github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= +github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5 h1:PDWGei+Rf2bBiuZIbZmM20J2ftEy9IeUCHA8HbQqed8= +github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= +github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryancurrah/gomodguard v1.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= +github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= +github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= +github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= +github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= +github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= +github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= +github.com/sashamelentyev/usestdlibvars v1.13.0 h1:uObNudVEEHf6JbOJy5bgKJloA1bWjxR9fwgNFpPzKnI= +github.com/sashamelentyev/usestdlibvars v1.13.0/go.mod h1:D2Wb7niIYmTB+gB8z7kh8tyP5ccof1dQ+SFk+WW5NtY= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/securego/gosec/v2 v2.13.1 h1:7mU32qn2dyC81MH9L2kefnQyRMUarfDER3iQyMHcjYM= +github.com/securego/gosec/v2 v2.13.1/go.mod h1:EO1sImBMBWFjOTFzMWfTRrZW6M15gm60ljzrmy/wtHo= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= +github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= +github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= +github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= +github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= +github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= +github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= +github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= +github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.0 h1:IHGo93KUJjih0Gz449MCBDKuaWPqcKcbuUM7GXWFnlw= -github.com/spf13/cobra v1.2.0/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= -github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= +github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.23.1+incompatible h1:uArBYHQR0HqLFFAypI7RsWTzPSj/bDpmZZuQjMLSg1A= -github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.24.0+incompatible h1:CGchgJcHsDd2jWnaL4XngByMrXoGHh3n8oCqAKx0uMo= -github.com/uber/jaeger-client-go v2.24.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.26.0+incompatible h1:h285ag9YqU5dfE+D2tc2mL93wjg1YLveCCDgm2y4Rsg= -github.com/uber/jaeger-client-go v2.26.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.27.0+incompatible h1:6WVONolFJiB8Vx9bq4z9ddyV/SXSpfvvtb7Yl/TGHiE= -github.com/uber/jaeger-client-go v2.27.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.29.0+incompatible h1:wG3BqQcZG4M4+3/6BKjmlhXLC97Qy6w0nZqeM75R4q4= -github.com/uber/jaeger-client-go v2.29.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= -github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/unrolled/render v1.0.3 h1:baO+NG1bZSF2WR4zwh+0bMWauWky7DVrTOfvE2w+aFo= -github.com/unrolled/render v1.0.3/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= -github.com/unrolled/render v1.1.0 h1:gvpR9hHxTt6DcGqRYuVVFcfd8rtK+nyEPUJN06KB57Q= -github.com/unrolled/render v1.1.0/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= -github.com/unrolled/render v1.3.0 h1:WSWvsKjQBExZS2MfNXlpdpyS/AHwmgAVY+7OpReV7yM= -github.com/unrolled/render v1.3.0/go.mod h1:jSYOwUBX9pnJzbd7NlGO948lgbK8Bz3CBM2+YCnnIiM= -github.com/unrolled/render v1.4.0 h1:p73obhpsXuE3paXOtcuXTBKgBJpLCfmABnsUiO35x+Q= -github.com/unrolled/render v1.4.0/go.mod h1:cK4RSTTVdND5j9EYEc0LAMOvdG11JeiKjyjfyZRvV2w= -github.com/unrolled/render v1.4.1 h1:VdpMc2YkAOWzbmC/P2yoHhRDXgsaCQHcTJ1KK6SNCA4= -github.com/unrolled/render v1.4.1/go.mod h1:cK4RSTTVdND5j9EYEc0LAMOvdG11JeiKjyjfyZRvV2w= +github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= +github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/sylvia7788/contextcheck v1.0.6 h1:o2EZgVPyMKE/Mtoqym61DInKEjwEbsmyoxg3VrmjNO4= +github.com/sylvia7788/contextcheck v1.0.6/go.mod h1:9XDxwvxyuKD+8N+a7Gs7bfWLityh5t70g/GjdEt2N2M= +github.com/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= +github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= +github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= +github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro= +github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/timonwong/logrlint v0.1.0 h1:phZCcypL/vtx6cGxObJgWZ5wexZF5SXFPLOM+ru0e/M= +github.com/timonwong/logrlint v0.1.0/go.mod h1:Zleg4Gw+kRxNej+Ra7o+tEaW5k1qthTaYKU7rSD39LU= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tomarrell/wrapcheck/v2 v2.6.2 h1:3dI6YNcrJTQ/CJQ6M/DUkc0gnqYSIk6o0rChn9E/D0M= +github.com/tomarrell/wrapcheck/v2 v2.6.2/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= +github.com/tommy-muehle/go-mnd/v2 v2.5.0 h1:iAj0a8e6+dXSL7Liq0aXPox36FiN1dBbjA6lt9fl65s= +github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= +github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= +github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= +github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/volatiletech/inflect v0.0.1 h1:2a6FcMQyhmPZcLa+uet3VJ8gLn/9svWhJxJYwvE8KsU= github.com/volatiletech/inflect v0.0.1/go.mod h1:IBti31tG6phkHitLlr5j7shC5SOo//x0AjDzaJU1PLA= -github.com/volatiletech/null v8.0.0+incompatible h1:7wP8m5d/gZ6kW/9GnrLtMCRre2dlEnaQ9Km5OXlK4zg= -github.com/volatiletech/null v8.0.0+incompatible/go.mod h1:0wD98JzdqB+rLyZ70fN05VDbXbafIb0KU0MdVhCzmOQ= -github.com/volatiletech/null/v8 v8.1.0/go.mod h1:98DbwNoKEpRrYtGjWFctievIfm4n4MxG0A6EBUcoS5g= +github.com/volatiletech/null/v8 v8.1.2 h1:kiTiX1PpwvuugKwfvUNX/SU/5A2KGZMXfGD0DUHdKEI= github.com/volatiletech/null/v8 v8.1.2/go.mod h1:98DbwNoKEpRrYtGjWFctievIfm4n4MxG0A6EBUcoS5g= -github.com/volatiletech/null/v9 v9.0.0/go.mod h1:zRFghPVahaiIMRXiUJrc6gsoG83Cm3ZoAfSTw7VHGQc= +github.com/volatiletech/randomize v0.0.1 h1:eE5yajattWqTB2/eN8df4dw+8jwAzBtbdo5sbWC4nMk= github.com/volatiletech/randomize v0.0.1/go.mod h1:GN3U0QYqfZ9FOJ67bzax1cqZ5q2xuj2mXrXBjWaRTlY= -github.com/volatiletech/sqlboiler v3.7.1+incompatible h1:dm9/NjDskQVwAarmpeZ2UqLn1NKE8M3WHSHBS4jw2x8= -github.com/volatiletech/sqlboiler v3.7.1+incompatible/go.mod h1:jLfDkkHWPbS2cWRLkyC20vQWaIQsASEY7gM7zSo11Yw= -github.com/volatiletech/sqlboiler/v4 v4.4.0/go.mod h1:h4RBAO6QbwMP3ezGmtfGljRms7S27cFIgF3rKgPKstE= -github.com/volatiletech/sqlboiler/v4 v4.5.0/go.mod h1:tQgF5zxwqrjR6Wydc5rRylI6puDOO1WvBC70/5up+Hg= -github.com/volatiletech/sqlboiler/v4 v4.6.0/go.mod h1:tBWGn0ZDYngQr2QUTRpwmjiDIPOUI3mVqo/g5qizcew= -github.com/volatiletech/sqlboiler/v4 v4.7.1/go.mod h1:Lyb+AkiwCxSmINv099SgxWULAh0CcsQTmHpc+Z8mRVo= -github.com/volatiletech/sqlboiler/v4 v4.8.1/go.mod h1:Lyb+AkiwCxSmINv099SgxWULAh0CcsQTmHpc+Z8mRVo= -github.com/volatiletech/sqlboiler/v4 v4.8.3/go.mod h1:Lyb+AkiwCxSmINv099SgxWULAh0CcsQTmHpc+Z8mRVo= -github.com/volatiletech/sqlboiler/v4 v4.8.6/go.mod h1:iJ1ENC0t2TToKM0wQkVcRgK+FnEDg1QrHkjsdY4Yp+k= -github.com/volatiletech/sqlboiler/v4 v4.10.2/go.mod h1:kroP3Q/ZkkrvMk6keq9zbJHGyP+d8yTHRCTXcoG1RBM= -github.com/volatiletech/sqlboiler/v4 v4.11.0/go.mod h1:AAaQj77uX6nyU+Q5q6OcVCFFEs/gs+qsthM18/NVemo= +github.com/volatiletech/sqlboiler/v4 v4.13.0 h1:dwrs3AEEGWNrEWDnrI1GILxp85p1Qb0WuzArpVXAZgk= +github.com/volatiletech/sqlboiler/v4 v4.13.0/go.mod h1:QmJpWSj/s9xGSHFr2SN/MF371fLgeo10PZ9Tl8AUQNw= github.com/volatiletech/strmangle v0.0.1/go.mod h1:F6RA6IkB5vq0yTG4GQ0UsbbRcl3ni9P76i+JrTBKFFg= -github.com/volatiletech/strmangle v0.0.3/go.mod h1:ycDvbDkjDvhC0NUU8w3fWwl5JEMTV56vTKXzR3GeR+0= +github.com/volatiletech/strmangle v0.0.4 h1:CxrEPhobZL/PCZOTDSH1aq7s4Kv76hQpRoTVVlUOim4= github.com/volatiletech/strmangle v0.0.4/go.mod h1:ycDvbDkjDvhC0NUU8w3fWwl5JEMTV56vTKXzR3GeR+0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= +github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= +github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= +gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= +gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= +go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= +go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= +go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 h1:QmwruyY+bKbDDL0BaglrbZABEali68eoMFhTZpCjYVA= -golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd h1:zkO/Lhoka23X63N9OSzpSeROEUQ5ODw47tM3YWjygbs= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d h1:+W8Qf4iJtMGKkyAygcKohjxTk4JPsL9DpzApJ22m5Ic= +golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1054,15 +1066,10 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -1070,143 +1077,114 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 h1:alLDrZkL34Y2bnGHfvC1CYBRBXCXgx8AC2vY4MRtYX4= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84 h1:duBc5zuJsmJXYOVVE/6PxejI+N3AaCqKjtsoLn1Je5Q= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 h1:0Ja1LBD+yisY6RWM/BH7TJVXWsSjs2VwBSmvSX4HdBc= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78 h1:rPRtHfUb0UKZeZ6GH4K4Nt4YRbE9V1u+QZX5upZXqJQ= -golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1215,141 +1193,122 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 h1:B6caxRw+hozq68X2MY7jEpZh/cr4/aHLv9xU8Kkadrw= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4 h1:kCCpuwSAoYJPkNc6x0xT9yTtV4oKtARo4RGBQWOfg9E= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad h1:MCsdmFSdEd4UEa5TKS5JztCRHK/WtvNei1edOj5RSRo= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091 h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210223095934-7937bea0104d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b h1:ggRgirZABFolTmi3sn6Ivd9SipZwLedQ5wR0aAKnFxU= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210314195730-07df6a141424/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 h1:ZBu6861dZq7xBnG1bn5SRU0vA8nx42at4+kP07FMTog= -golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea h1:+WiDlPBBaO+h9vPNZi8uJ3k4BkKQB7Iow3aqwHVA5hI= -golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 h1:6wSTsvPddg9gc/mVEEyk9oOAoxn+bT4Z9q1zx+4RwA4= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 h1:Sx/u41w+OwrInGdEckYmEuU5gHoGSL4QbDz3S9s6j4U= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1357,11 +1316,14 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1372,165 +1334,122 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56 h1:DFtSed2q3HtNuVazwVDZ4nSRS/JrZEig0gz2BY4VNrg= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4 h1:kDtqNkeBrZb8B+atrj50B5XLHpzXXqcCdZPP/ApQ5NY= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d h1:szSOL78iTCl0LF1AMjhSWJj8tIM0KixlUUnBtYXsmd8= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202 h1:DrWbY9UUFi/sl/3HkNVoBjDbGfIPZZfgoGsGxOL1EU8= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858 h1:xLt+iB5ksWcZVxqc+g9K41ZHy+6MKWfXCDsjSThnsPA= +golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a h1:+77BOOi9CMFjpy3D2P/OnfSSmC/Hx/fGAQJUAQaM2gc= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818 h1:u2ssHESKr0HP2d1wlnjMKH+V/22Vg1lGCVuXmOYU1qA= +golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0 h1:0q95w+VuFtv4PAx4PZVQdBMmYbaCHbnfKaEiDIcVyag= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0 h1:cG03eaksBzhfSIk7JRGctfp3lanklcOM/mTGvow7BbQ= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0 h1:LodzhlzZEUfhXzNUMIfVlf9Gr6Ua5MMtoFWh7+f47qA= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.26.0 h1:VJZ8h6E8ip82FRpQl848c5vAadxlTXrUh8RzQzSRm08= -google.golang.org/api v0.26.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0 h1:jMF5hhVfMkTZwHW1SDpKq5CkgWLXOb31Foaca9Zr3oM= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.31.0 h1:1w5Sz/puhxFo9lTtip2n47k7toB/U2nCqOKNHd3Yrbo= -google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= -google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= -google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.33.0 h1:+gL0XvACeMIvpwLZ5rQZzLn5cwOsgg8dIcfJ2SYfBVw= -google.golang.org/api v0.33.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.35.0 h1:TBCmTTxUrRDA1iTctnK/fIeitxIZ+TQuaf0j29fmCGo= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.37.0 h1:Ifp4Kt7Mf6Tqyj+Uf4MgHYYZ6sIOaf2D20v4qbZCgkE= -google.golang.org/api v0.37.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.38.0 h1:vDyWk6eup8eQAidaZ31sNWIn8tZEL8qpbtGkBD4ytQo= -google.golang.org/api v0.38.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.39.0 h1:zHCTXf0NeDdKTgcSQpT+ZflWAqHsEp1GmdpxW09f3YM= -google.golang.org/api v0.39.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.40.0 h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0 h1:12aHIhhQCpWtd3Rcp2WwbboB5W72tJHcjzyA9MCoHAw= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.42.0 h1:uqATLkpxiBrhrvFoebXUjvyzE9nQf+pVyy0Z0IHE+fc= -google.golang.org/api v0.42.0/go.mod h1:+Oj4s6ch2SEGtPjGqfUfZonBH0GjQH89gTeKKAEGZKI= -google.golang.org/api v0.43.0 h1:4sAyIHT6ZohtAQDoxws+ez7bROYmUlOVvsUscYCDTqA= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.45.0 h1:pqMffJFLBVUDIoYsHcqtxgQVTsmxMDpYLOc5MT4Jrww= -google.golang.org/api v0.45.0/go.mod h1:ISLIJCedJolbZvDfAk+Ctuq5hf+aJ33WgtUsfyFoLXA= -google.golang.org/api v0.47.0 h1:sQLWZQvP6jPGIP4JGPkJu4zHswrv81iobiyszr3b/0I= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0 h1:RDAPWfNFY06dffEXfn7hZF5Fr1ZbnChzfQZAPyBd1+I= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0 h1:LX7NFCFYOHzr7WHaYiRUpeipZe9o5L8T+2F4Z798VDw= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0 h1:SQaA2Cx57B+iPw2MBgyjEkoeMkRK2IenSGoia0U3lCk= google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.52.0 h1:m5FLEd6dp5CU1F0tMWyqDi2XjchviIz8ntzOSz7w8As= -google.golang.org/api v0.52.0/go.mod h1:Him/adpjt0sxtkWViy0b6xyKW/SD71CwdJ7HqJo7SrU= -google.golang.org/api v0.54.0 h1:ECJUVngj71QI6XEm7b1sAf8BljU5inEhMbKPR8Lxhhk= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0 h1:08F9XVYTLOGeSQb3xI9C0gXMuQanhdGed0cWFhDozbI= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0 h1:4t9zuDlHLcIx0ZEhmXEeFVCRsiOgpgn2QOH9N0MNjPI= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.58.0 h1:MDkAbYIB1JpSgCTOCYYoIec/coMlKK4oVbpnBLLcyT0= -google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= -google.golang.org/api v0.59.0 h1:fPfFO7gttlXYo2ALuD3HxJzh8vaF++4youI0BkFL6GE= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -google.golang.org/api v0.60.0 h1:eq/zs5WPH4J9undYM9IP1O7dSr7Yh8Y0GtSCpzGzIUk= -google.golang.org/api v0.60.0/go.mod h1:d7rl65NZAkEQ90JFzqBjcRq1TVeG5ZoGV3sSpEnnVb4= -google.golang.org/api v0.61.0 h1:TXXKS1slM3b2bZNJwD5DV/Tp6/M2cLzLOLh9PjDhrw8= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0 h1:PhGymJMXfGBzc4lBRmrx9+1w4w2wEzURHNGF/sD/xGc= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -google.golang.org/api v0.63.0 h1:n2bqqK895ygnBpdPDYetfy23K7fJ22wsrZKCyfuRkkA= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.64.0 h1:l3pi8ncrQgB9+ncFw3A716L8lWujnXniBYbxWqqy6tE= -google.golang.org/api v0.64.0/go.mod h1:931CdxA8Rm4t6zqTFGSsgwbAEZ2+GMYurbndwSimebM= -google.golang.org/api v0.65.0 h1:MTW9c+LIBAbwoS1Gb+YV7NjFBt2f7GtAS5hIzh2NjgQ= -google.golang.org/api v0.65.0/go.mod h1:ArYhxgGadlWmqO1IqVujw6Cs8IdD33bTmzKo2Sh+cbg= -google.golang.org/api v0.66.0/go.mod h1:I1dmXYpX7HGwz/ejRxwQp2qj5bFAz93HiCU1C1oYd9M= -google.golang.org/api v0.68.0 h1:9eJiHhwJKIYX6sX2fUZxQLi7pDRA/MYu8c12q6WbJik= -google.golang.org/api v0.68.0/go.mod h1:sOM8pTpwgflXRhz+oC8H2Dr+UcbMqkPPWNJo88Q7TH8= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0 h1:NMB9J4cCxs9xEm+1Z9QiO3eFvn7EnQj3Eo3hN6ugVlg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -1540,422 +1459,179 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce h1:1mbrb1tUU+Zmt5C94IGKADBTJZjZXAd+BubWi7r9EiI= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940 h1:MRHtG0U6SnaUb+s+LhNE1qt1FQ1wlhqr5E4usBKC0uA= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587 h1:1Ym+vvUpq1ZHvxzn34gENJX8U4aKO+vhy2P/2+Xl6qQ= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200519141106-08726f379972 h1:6ydLqG65DIMNJf6p97WudGsmd1w3Ickm/LiZnBrREPI= -google.golang.org/genproto v0.0.0-20200519141106-08726f379972/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200521103424-e9a78aa275b7/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece h1:1YM0uhfumvoDu9sx8+RyWwTI63zoCQvI23IYFRlvte0= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200528191852-705c0b31589b h1:nl5tymnV+50ACFZUDAP+xFCe3Zh3SWdMDx+ernZSKNA= -google.golang.org/genproto v0.0.0-20200528191852-705c0b31589b/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200602104108-2bb8d6132df6/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200603110839-e855014d5736/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200604104852-0b0486081ffb h1:ek2py5bOqzR7MR/6obzk0rXUgYCLmjyLnaO9ssT+l6w= -google.golang.org/genproto v0.0.0-20200604104852-0b0486081ffb/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200605102947-12044bf5ea91 h1:ES+5k7Xz+sYByd2L7mvcanaIuY0Iz3L3O6OhN+cRdu8= -google.golang.org/genproto v0.0.0-20200605102947-12044bf5ea91/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200610212329-df9b449b0ff2 h1:9Y7uVP/lc90ltZK8jTDgsu0rDb9xFZYfNahF5U1TqFs= -google.golang.org/genproto v0.0.0-20200610212329-df9b449b0ff2/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200611194920-44ba362f84c1 h1:rRk0Nk0YJuu8qID4s2qgHG/WOMKXFafQ0/4vD/6/EuM= -google.golang.org/genproto v0.0.0-20200611194920-44ba362f84c1/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11 h1:II66Di7x1uAfKBfe3OchemS7pUg9ahSr7qAP3bD0+Mo= -google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200616192300-fc83d8c00726 h1:lMcDmvQ6vt1yLOlu+nQLw6GpCy3JFPCvLb24pDfbtk4= -google.golang.org/genproto v0.0.0-20200616192300-fc83d8c00726/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200620020550-bd6e04640131 h1:IXNofpkLhv80L3TJQvj2YQLnMHZgAktycswvtXwQiRk= -google.golang.org/genproto v0.0.0-20200620020550-bd6e04640131/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200623002339-fbb79eadd5eb h1:PUcq6RTy8Gp9xukBme8m2+2Z8pQCmJ7TbPpQd6xNDvk= -google.golang.org/genproto v0.0.0-20200623002339-fbb79eadd5eb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5 h1:a/Sqq5B3dGnmxhuJZIHFsIxhEkqElErr5TaU6IqBAj0= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 h1:4BC1C1i30F3MZeiIO6y6IIo4DxrtOwITK87bQl3lhFA= -google.golang.org/genproto v0.0.0-20200702021140-07506425bd67/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200708133552-18036109789b h1:gYoomKOmhJ9YGwv9D05xH6fNWcNBNrMvOuoysvYIVV4= -google.golang.org/genproto v0.0.0-20200708133552-18036109789b/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3 h1:JwLN1jVnmIsfE4HkDVe2AblFAbo0Z+4cjteDSOnv6oE= -google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200715011427-11fb19a81f2c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 h1:LCO0fg4kb6WwkXQXRQQgUYsFeFb5taTX5WAx5O/Vt28= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70 h1:wboULUXGF3c5qdUnKp+6gLAccE6PRpa/czkYvQ4UXv8= -google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200918140846-d0d605568037 h1:ujwz1DPMeHwCvo36rK5shXhAzc4GMRecrqQFaMZJBKQ= -google.golang.org/genproto v0.0.0-20200918140846-d0d605568037/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200921165018-b9da36f5f452 h1:2S8dcPkOK9QyAAKa46Cgl//VOCS6ZOsY+iwD3bb9Phg= -google.golang.org/genproto v0.0.0-20200921165018-b9da36f5f452/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200925023002-c2d885f95484 h1:Rr9EZdYRq2WLckzJQVtN3ISKoP7dvgwi7jbglILNZ34= -google.golang.org/genproto v0.0.0-20200925023002-c2d885f95484/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200929141702-51c3e5b607fe h1:6SgESkjJknFUnsfQ2yxQbmTAi37BxhwS/riq+VdLo9c= -google.golang.org/genproto v0.0.0-20200929141702-51c3e5b607fe/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201002142447-3860012362da h1:DTQYk4u7nICKkkVZsBv0/0po0ChISxAJ5CTAfUhO0PQ= -google.golang.org/genproto v0.0.0-20201002142447-3860012362da/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201009135657-4d944d34d83c h1:YhtyeaRgEDy6amoaijBY0B6uzaztIKKZbUcaO2OIFps= -google.golang.org/genproto v0.0.0-20201009135657-4d944d34d83c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201021134325-0d71844de594 h1:JZWUHUjZJojCHxs9ZZLFsnRGKVBXBoOHGxeTSt6OE+Q= -google.golang.org/genproto v0.0.0-20201021134325-0d71844de594/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba h1:HocWKLuilwaaLY56cHV38rw84wJ1nscA0Rs7OnO8mm8= -google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201204160425-06b3db808446 h1:65ppmIPdaZE+BO34gntwqexoTYr30IRNGmS0OGOHu3A= -google.golang.org/genproto v0.0.0-20201204160425-06b3db808446/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d h1:HV9Z9qMhQEsdlvxNFELgQ11RkMzO3CMkjEySjCtuLes= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210111234610-22ae2b108f89 h1:R2owLnwrU3BdTJ5R9cnHDNsnEmBQ7n5lZjKShnbISe4= -google.golang.org/genproto v0.0.0-20210111234610-22ae2b108f89/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210122163508-8081c04a3579 h1:Iwh0ba2kTgq2Q6mJiXhzrrjD7h11nEVnbMHFmp0/HsQ= -google.golang.org/genproto v0.0.0-20210122163508-8081c04a3579/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 h1:uLBY0yHDCj2PMQ98KWDSIDFwn9zK2zh+tgWtbvPPBjI= -google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210204154452-deb828366460 h1:pvsg2TgyP8bWrYqyL10tbNHu5KypD5DWJPrCjaTkwZA= -google.golang.org/genproto v0.0.0-20210204154452-deb828366460/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea h1:N98SvVh7Hdle2lgUVFuIkf0B3u29CUakMUQa7Hwz8Wc= -google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d h1:Edhcm0CKDPLQIecHCp5Iz57Lo7MfT6zUFBAlocmOjcY= -google.golang.org/genproto v0.0.0-20210212180131-e7f2df4ecc2d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210218151259-fe80b386bf06 h1:Px6YyLaNKEo5eoniIBAv6Es0jbvyEmSYqOac64iS2Rs= -google.golang.org/genproto v0.0.0-20210218151259-fe80b386bf06/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210219173056-d891e3cb3b5b h1:zTeTu5p/EXQSqNJboHUw32wdNFYQTT9vSc+ibSpCoLk= -google.golang.org/genproto v0.0.0-20210219173056-d891e3cb3b5b/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 h1:PYBmACG+YEv8uQPW0r1kJj8tR+gkF0UWq7iFdUezwEw= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210302154924-ca353664deba h1:D7QtQqbgs3GUhm6JwVV9dVwFTDoi9iQuE3CF38SEIzU= -google.golang.org/genproto v0.0.0-20210302154924-ca353664deba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb h1:hcskBH5qZCOa7WpTUFUFvoebnSFZBYpjykLtjIp9DVk= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210311153111-e2979279ddde h1:ZC8QEWwnT4z5oijBVf++MV+RKH6uYcT6zORNP014fi8= -google.golang.org/genproto v0.0.0-20210311153111-e2979279ddde/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210312152112-fc591d9ea70f h1:YRBxgxUW6GFi+AKsn8WGA9k1SZohK+gGuEqdeT5aoNQ= -google.golang.org/genproto v0.0.0-20210312152112-fc591d9ea70f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210315173758-2651cd453018 h1:ZH67MZWSz0sEGHWoYAO1ysjL0yWEXTQ7gOxytol4KAk= -google.golang.org/genproto v0.0.0-20210315173758-2651cd453018/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6 h1:4Xw2NwItrJOFR5s6PnK98PI6Bgw1LhMP1j/rO5WP0S4= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210324141432-3032e8ff099e h1:IYrHTUywwtorLXynts01yby09nLqYNNnnveUnnLzaYA= -google.golang.org/genproto v0.0.0-20210324141432-3032e8ff099e/go.mod h1:f2Bd7+2PlaVKmvKQ52aspJZXIDaRQBVdOOBfJ5i8OEs= -google.golang.org/genproto v0.0.0-20210325224202-eed09b1b5210 h1:fFxjezD+ZiiYJ6zyfH738tgcWOqfzWl9I1GoepZzrI4= -google.golang.org/genproto v0.0.0-20210325224202-eed09b1b5210/go.mod h1:f2Bd7+2PlaVKmvKQ52aspJZXIDaRQBVdOOBfJ5i8OEs= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210405174219-a39eb2f71cb9 h1:Uga0hMhZnzB159cnlmhVPgEmZTwoZqwOb7e0pu+rlNI= -google.golang.org/genproto v0.0.0-20210405174219-a39eb2f71cb9/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210406143921-e86de6bf7a46 h1:f4STrQZf8jaowsiUitigvrqMCCM4QJH1A2JCSI7U1ow= -google.golang.org/genproto v0.0.0-20210406143921-e86de6bf7a46/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210413151531-c14fb6ef47c3 h1:K+7Ig5hjiLVA/i1UFUUbCGimWz5/Ey0lAQjT3QiLaPY= -google.golang.org/genproto v0.0.0-20210413151531-c14fb6ef47c3/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210415145412-64678f1ae2d5 h1:MSDsGZzppeaFIEzKO8W4ONBHajeQ0fMfwcQev1Z3T0o= -google.golang.org/genproto v0.0.0-20210415145412-64678f1ae2d5/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210416161957-9910b6c460de h1:+nG/xknR+Gc5ByHOtK1dT0Pl3LYo8NLR+Jz3XeBeGEg= -google.golang.org/genproto v0.0.0-20210416161957-9910b6c460de/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210421164718-3947dc264843 h1:H1DhP53WMRaBnh6sOAENBSST/qd4ikaYYKWRsOlV+gI= -google.golang.org/genproto v0.0.0-20210421164718-3947dc264843/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210426193834-eac7f76ac494 h1:KMgpo2lWy1vfrYjtxPAzR0aNWeAR1UdQykt6sj/hpBY= -google.golang.org/genproto v0.0.0-20210426193834-eac7f76ac494/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab h1:dkb90hr43A2Q5as5ZBphcOF2II0+EqfCBqGp7qFSpN4= -google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384 h1:z+j74wi4yV+P7EtK9gPLGukOk7mFOy9wMQaC0wNb7eY= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210524171403-669157292da3 h1:xFyh6GBb+NO1L0xqb978I3sBPQpk6FrKO0jJGRvdj/0= -google.golang.org/genproto v0.0.0-20210524171403-669157292da3/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 h1:pc16UedxnxXXtGxHCSUhafAoVHQZ0yXl8ZelMH4EETc= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced h1:c5geK1iMU3cDKtFrCVQIcjR3W+JOZMuhIyICMCTbtus= -google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210701191553-46259e63a0a9 h1:HBPuvo39L0DgfVn9eHR3ki/RjZoUFWa+em77e7KFDfs= -google.golang.org/genproto v0.0.0-20210701191553-46259e63a0a9/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/genproto v0.0.0-20210708141623-e76da96a951f h1:khwpF3oSk7GIab/7DDMDyE8cPQEO6FAfOcWHIRAhO20= -google.golang.org/genproto v0.0.0-20210708141623-e76da96a951f/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210715145939-324b959e9c22 h1:jcklN/lATdu/CSsNEOLujIgfvY7IMQpRq6HNaPZuVIc= -google.golang.org/genproto v0.0.0-20210715145939-324b959e9c22/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea h1:8ZyCcgugUqamxp/vZSEJw9CMy7VZlSWYJLLJPi/dSDA= google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210721163202-f1cecdd8b78a h1:17YmRUuEF4d+t2ygJZaDPhqNL2Hf17832xWKcMU7r2I= -google.golang.org/genproto v0.0.0-20210721163202-f1cecdd8b78a/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210722135532-667f2b7c528f h1:YORWxaStkWBnWgELOHTmDrqNlFXuVGEbhwbB5iK94bQ= -google.golang.org/genproto v0.0.0-20210722135532-667f2b7c528f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f h1:4m1jFN3fHeKo0UvpraW2ipO2O0rgp5w2ugXeggtecAk= google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210729151513-df9385d47c1b h1:4xoALQmXxqVdDdLimpPyPeDdsJzo+nFTJw9euAMpqgM= -google.golang.org/genproto v0.0.0-20210729151513-df9385d47c1b/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67 h1:VmMSf20ssFK0+u1dscyTH9bU4/M4y+X/xNfkvD6kGtM= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210809142519-0135a39c2737 h1:Moip0fL+OCinHcDkf5I8SnDySKoj58/LsVYUidA6GEM= -google.golang.org/genproto v0.0.0-20210809142519-0135a39c2737/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210811021853-ddbe55d93216 h1:qnrhhl4uoNFepTqE28u11llFcDH07Z6r/cQxpGR97A4= -google.golang.org/genproto v0.0.0-20210811021853-ddbe55d93216/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210816143620-e15ff196659d h1:fPtHPeysWvGVJwQFKu3B7H2DB2sOEsW7UTayKkWESKw= -google.golang.org/genproto v0.0.0-20210816143620-e15ff196659d/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210818220304-27ea9cc85d9f h1:enWPderunHptc5pzJkSYGx0olpF8goXzG0rY3kL0eSg= -google.golang.org/genproto v0.0.0-20210818220304-27ea9cc85d9f/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210820002220-43fce44e7af1 h1:F0WcJZXJRyfaWMXUBAGq7Ba4MWDn+yeACpeEkDUkJ1A= -google.golang.org/genproto v0.0.0-20210820002220-43fce44e7af1/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 h1:XosVttQUxX8erNhEruTu053/VchgYuksoS9Bj/OITjU= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 h1:NHN4wOCScVzKhPenJ2dt+BTs3X/XkBVI/Rh4iDt55T8= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 h1:3V2dxSZpz4zozWWUq36vUxXEKnSYitEH2LdsAx+RUmg= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af h1:aLMMXFYqw01RA6XJim5uaN+afqNNjc9P8HPAbnpnc5s= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210915214522-86cf1236ec46 h1:dUeqvtUQy6Xh63UIs6Jgkj/97+qWYZ+Gf52HXC0rojE= -google.golang.org/genproto v0.0.0-20210915214522-86cf1236ec46/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 h1:ysnBoUyeL/H6RCvNRhWHjKoDEmguI+mPU+qHgK8qv/w= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 h1:2ncG/LajxmrclaZH+ppVi02rQxz4eXYJzGHdFN4Y9UA= -google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0 h1:5Tbluzus3QxoAJx4IefGt1W0HQZW4nuMrVk684jI74Q= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9 h1:eF1wcrhdz56Vugf8qNX5dD93ItkrhothojQyHXqloe0= -google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e h1:Im71rbA1N3CbIag/PumYhQcNR8bLNmuOtRIyOnnLsT8= -google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4 h1:YXPV/eKW0ZWRdB5tyI6aPoaa2Wxb4OSlFrTREMdwn64= -google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663 h1:33YYJanAOLxgS7pGjzC1IUrFLpwN//bbgtnKYikOmQU= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e h1:B3r2Cb5u7Od6/WGb95VHDMp99VU/fuqPYZb6VM8IozI= -google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211013025323-ce878158c4d4 h1:NBxB1XxiWpGqkPUiJ9PoBXkHV5A9+GohMOA+EmWoPbU= -google.golang.org/genproto v0.0.0-20211013025323-ce878158c4d4/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 h1:Rp1vYDPD4TdkMH5S/bZbopsGCsWhPcrLBUwOVhAQCxM= -google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a h1:8maMHMQp9NroHXhc3HelFX9Ay2lWlXLcdH5mw5Biz0s= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351 h1:uf3hR4mj3fn7tjJL1f0kkRqFE7GDPoBiyvLxvu1Gt/g= google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 h1:b9mVrqYfq3P4bCdaLg1qtBnPzUYgglsIdjZkL/fQVOE= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 h1:DN5b3HU13J4sMd/QjDx34U6afpaexKTDdop+26pdjdk= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 h1:fU3FNfL/oBU2D5DvGqiuyVqqn40DdxvaTFHq7aivA3k= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 h1:Et6SkiuvnBn+SgrSYXs/BrUpGB4mbdwt4R3vaPIlicA= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220112215332-a9c7c0acf9f2 h1:z+R4M/SuyaRsj1zu3WC+nIQyfSrSIpuDcY01/R3uCtg= -google.golang.org/genproto v0.0.0-20220112215332-a9c7c0acf9f2/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220114231437-d2e6a121cae0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220204002441-d6cc3cc0770e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220211171837-173942840c17 h1:2X+CNIheCutWRyKRte8szGxrE5ggtV4U+NKAbh/oLhg= -google.golang.org/genproto v0.0.0-20220211171837-173942840c17/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c h1:TU4rFa5APdKTq0s6B7WTsH6Xmx0Knj86s6Biz56mErE= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7 h1:ntPPoHzFW6Xp09ueznmahONZufyoSakK/piXnr2BU3I= -google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8 h1:U9V52f6rAgINH7kT+musA1qF8kWyVOxzF8eYuOVuFwQ= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e h1:fNKDNuUyC4WH+inqDMpfXDdfvwfYILbsX+oskGZ8hxg= -google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2 h1:3n0D2NdPGm0g0wrVJzXJWW5CBOoqgGBkDX9cRMJHZAY= -google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4 h1:myaecH64R0bIEDjNORIel4iXubqzaHU1K2z8ajBwWcM= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731 h1:nquqdM9+ps0JZcIiI70+tqoaIFS5Ql4ZuK8UXnz3HfE= -google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e h1:gMjH4zLGs9m+dGzR7qHCHaXMOwsJHJKKkHtyXhtOrJk= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220525015930-6ca3db687a9d h1:8BnRR08DxAQ+e2pFx64Q3Ltg/AkrrxyG1LLa1WpomyA= -google.golang.org/genproto v0.0.0-20220525015930-6ca3db687a9d/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To= -google.golang.org/genproto v0.0.0-20220526192754-51939a95c655 h1:56rmjc5LUAanErbiNrY+s/Nd47wDQEJkpqS7i43M1I0= -google.golang.org/genproto v0.0.0-20220526192754-51939a95c655/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1 h1:DGeFlSan2f+WEtCERJ4J9GJWk15TxUi8QGagfI87Xyc= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1 h1:cmUfbeGKnz9+2DD/UYsMQXeqbHZqZDs4eQwW0sFOpBY= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1 h1:ARnQJNWxGyYJpdf/JXscNlQr/uv607ZPU9Z7ogHi+iI= google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1 h1:f37vZbBVTiJ6jKG5mWz8ySOBxNqy6ViPgyhSdVnxF3E= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= +gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= +honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= @@ -1972,6 +1648,11 @@ modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.35.20/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.35.22/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.1 h1:CICrjwr/1M4+6OQ4HJZ/AHxjcwe67r5vPUF518MkO8A= +modernc.org/cc/v3 v3.36.1/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= @@ -2012,8 +1693,15 @@ modernc.org/ccgo/v3 v3.12.92/go.mod h1:5yDdN7ti9KWPi5bRVWPl8UNhpEAtCjuEE7ayQnzzq modernc.org/ccgo/v3 v3.13.1/go.mod h1:aBYVOUfIlcSnrsRVU8VRS35y2DIfpgkmVkYZ0tpIXi4= modernc.org/ccgo/v3 v3.14.0/go.mod h1:hBrkiBlUwvr5vV/ZH9YzXIp982jKE8Ek8tR1ytoAL6Q= modernc.org/ccgo/v3 v3.15.1/go.mod h1:md59wBwDT2LznX/OTCPoVS6KIsdRgY8xqQwBV+hkTH0= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8 h1:G0QNlTqI5uVgczBWfGKs7B++EPwCfXPWGD2MdeKloDs= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= @@ -2055,21 +1743,44 @@ modernc.org/libc v1.12.0/go.mod h1:2MH3DaF/gCU8i/UBiVE1VFRos4o523M7zipmwH8SIgQ= modernc.org/libc v1.13.1/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= modernc.org/libc v1.13.2/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= modernc.org/libc v1.14.1/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19 h1:S8flPn5ZeXx6iw/8yNa986hwTQDrY8RXU7tObZuAozo= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= +modernc.org/memory v1.1.1 h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.14.5/go.mod h1:YyX5Rx0WbXokitdWl2GJIDy4BrPxBP0PwwhpXOHCDLE= +modernc.org/sqlite v1.18.1 h1:ko32eKt3jf7eqIkCgPAeHMBXw3riNSLhl2f3loEF7o8= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.2 h1:iFBDH6j1Z0bN/Q9udJnnFoFpENA4252qe/7/5woE5MI= +modernc.org/strutil v1.1.2/go.mod h1:OYajnUAcI/MX+XD/Wx7v1bbdvcQSvxgtb0gC+u3d3eg= modernc.org/tcl v1.10.0/go.mod h1:WzWapmP/7dHVhFoyPpEaNSVTL8xtewhouN/cqSJ5A2s= +modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao= +modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.2.21/go.mod h1:uXrObx4pGqXWIMliC5MiKuwAyMrltzwpteOFUP1PWCc= modernc.org/z v1.3.0/go.mod h1:+mvgLH814oDjtATDdT3rs84JnUIpkvAF5B8AVkNlE2g= +modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM= +mvdan.cc/gofumpt v0.3.1 h1:avhhrOmv0IuvQVK7fvwV91oFSGAk5/6Po8GXTzICeu8= +mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/dbmodels/.gitkeep b/internal/dbmodels/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/dbmodels/defaultdb/boil_main_test.go b/internal/dbmodels/defaultdb/boil_main_test.go deleted file mode 100644 index 903d2f430..000000000 --- a/internal/dbmodels/defaultdb/boil_main_test.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "database/sql" - "flag" - "fmt" - "math/rand" - "os" - "path/filepath" - "strings" - "testing" - "time" - - "github.com/spf13/viper" - "github.com/volatiletech/sqlboiler/boil" -) - -var flagDebugMode = flag.Bool("test.sqldebug", false, "Turns on debug mode for SQL statements") -var flagConfigFile = flag.String("test.config", "", "Overrides the default config") - -const outputDirDepth = 3 - -var ( - dbMain tester -) - -type tester interface { - setup() error - conn() (*sql.DB, error) - teardown() error -} - -func TestMain(m *testing.M) { - if dbMain == nil { - fmt.Println("no dbMain tester interface was ready") - os.Exit(-1) - } - - rand.Seed(time.Now().UnixNano()) - - flag.Parse() - - var err error - - // Load configuration - err = initViper() - if err != nil { - fmt.Println("unable to load config file") - os.Exit(-2) - } - - // Set DebugMode so we can see generated sql statements - boil.DebugMode = *flagDebugMode - - if err = dbMain.setup(); err != nil { - fmt.Println("Unable to execute setup:", err) - os.Exit(-4) - } - - conn, err := dbMain.conn() - if err != nil { - fmt.Println("failed to get connection:", err) - } - - var code int - boil.SetDB(conn) - code = m.Run() - - if err = dbMain.teardown(); err != nil { - fmt.Println("Unable to execute teardown:", err) - os.Exit(-5) - } - - os.Exit(code) -} - -func initViper() error { - if flagConfigFile != nil && *flagConfigFile != "" { - viper.SetConfigFile(*flagConfigFile) - if err := viper.ReadInConfig(); err != nil { - return err - } - return nil - } - - var err error - - viper.SetConfigName("sqlboiler") - - configHome := os.Getenv("XDG_CONFIG_HOME") - homePath := os.Getenv("HOME") - wd, err := os.Getwd() - if err != nil { - wd = strings.Repeat("../", outputDirDepth) - } else { - wd = wd + strings.Repeat("/..", outputDirDepth) - } - - configPaths := []string{wd} - if len(configHome) > 0 { - configPaths = append(configPaths, filepath.Join(configHome, "sqlboiler")) - } else { - configPaths = append(configPaths, filepath.Join(homePath, ".config/sqlboiler")) - } - - for _, p := range configPaths { - viper.AddConfigPath(p) - } - - // Ignore errors here, fall back to defaults and validation to provide errs - _ = viper.ReadInConfig() - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - viper.AutomaticEnv() - - return nil -} diff --git a/internal/dbmodels/defaultdb/boil_queries_test.go b/internal/dbmodels/defaultdb/boil_queries_test.go deleted file mode 100644 index 1bc2a2674..000000000 --- a/internal/dbmodels/defaultdb/boil_queries_test.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "math/rand" - "regexp" - - "github.com/volatiletech/sqlboiler/boil" -) - -var dbNameRand *rand.Rand - -func MustTx(transactor boil.ContextTransactor, err error) boil.ContextTransactor { - if err != nil { - panic(fmt.Sprintf("Cannot create a transactor: %s", err)) - } - return transactor -} - -func newFKeyDestroyer(regex *regexp.Regexp, reader io.Reader) io.Reader { - return &fKeyDestroyer{ - reader: reader, - rgx: regex, - } -} - -type fKeyDestroyer struct { - reader io.Reader - buf *bytes.Buffer - rgx *regexp.Regexp -} - -func (f *fKeyDestroyer) Read(b []byte) (int, error) { - if f.buf == nil { - all, err := ioutil.ReadAll(f.reader) - if err != nil { - return 0, err - } - - all = bytes.Replace(all, []byte{'\r', '\n'}, []byte{'\n'}, -1) - all = f.rgx.ReplaceAll(all, []byte{}) - f.buf = bytes.NewBuffer(all) - } - - return f.buf.Read(b) -} diff --git a/internal/dbmodels/defaultdb/boil_suites_test.go b/internal/dbmodels/defaultdb/boil_suites_test.go deleted file mode 100644 index 4295530c8..000000000 --- a/internal/dbmodels/defaultdb/boil_suites_test.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import "testing" - -// This test suite runs each operation test in parallel. -// Example, if your database has 3 tables, the suite will run: -// table1, table2 and table3 Delete in parallel -// table1, table2 and table3 Insert in parallel, and so forth. -// It does NOT run each operation group in parallel. -// Separating the tests thusly grants avoidance of Postgres deadlocks. -func TestParent(t *testing.T) { - t.Run("Users", testUsers) -} - -func TestDelete(t *testing.T) { - t.Run("Users", testUsersDelete) -} - -func TestQueryDeleteAll(t *testing.T) { - t.Run("Users", testUsersQueryDeleteAll) -} - -func TestSliceDeleteAll(t *testing.T) { - t.Run("Users", testUsersSliceDeleteAll) -} - -func TestExists(t *testing.T) { - t.Run("Users", testUsersExists) -} - -func TestFind(t *testing.T) { - t.Run("Users", testUsersFind) -} - -func TestBind(t *testing.T) { - t.Run("Users", testUsersBind) -} - -func TestOne(t *testing.T) { - t.Run("Users", testUsersOne) -} - -func TestAll(t *testing.T) { - t.Run("Users", testUsersAll) -} - -func TestCount(t *testing.T) { - t.Run("Users", testUsersCount) -} - -func TestInsert(t *testing.T) { - t.Run("Users", testUsersInsert) - t.Run("Users", testUsersInsertWhitelist) -} - -// TestToOne tests cannot be run in parallel -// or deadlocks can occur. -func TestToOne(t *testing.T) {} - -// TestOneToOne tests cannot be run in parallel -// or deadlocks can occur. -func TestOneToOne(t *testing.T) {} - -// TestToMany tests cannot be run in parallel -// or deadlocks can occur. -func TestToMany(t *testing.T) {} - -// TestToOneSet tests cannot be run in parallel -// or deadlocks can occur. -func TestToOneSet(t *testing.T) {} - -// TestToOneRemove tests cannot be run in parallel -// or deadlocks can occur. -func TestToOneRemove(t *testing.T) {} - -// TestOneToOneSet tests cannot be run in parallel -// or deadlocks can occur. -func TestOneToOneSet(t *testing.T) {} - -// TestOneToOneRemove tests cannot be run in parallel -// or deadlocks can occur. -func TestOneToOneRemove(t *testing.T) {} - -// TestToManyAdd tests cannot be run in parallel -// or deadlocks can occur. -func TestToManyAdd(t *testing.T) {} - -// TestToManySet tests cannot be run in parallel -// or deadlocks can occur. -func TestToManySet(t *testing.T) {} - -// TestToManyRemove tests cannot be run in parallel -// or deadlocks can occur. -func TestToManyRemove(t *testing.T) {} - -func TestReload(t *testing.T) { - t.Run("Users", testUsersReload) -} - -func TestReloadAll(t *testing.T) { - t.Run("Users", testUsersReloadAll) -} - -func TestSelect(t *testing.T) { - t.Run("Users", testUsersSelect) -} - -func TestUpdate(t *testing.T) { - t.Run("Users", testUsersUpdate) -} - -func TestSliceUpdateAll(t *testing.T) { - t.Run("Users", testUsersSliceUpdateAll) -} diff --git a/internal/dbmodels/defaultdb/boil_table_names.go b/internal/dbmodels/defaultdb/boil_table_names.go deleted file mode 100644 index 9490baed0..000000000 --- a/internal/dbmodels/defaultdb/boil_table_names.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -var TableNames = struct { - Users string -}{ - Users: "users", -} diff --git a/internal/dbmodels/defaultdb/mysql_main_test.go b/internal/dbmodels/defaultdb/mysql_main_test.go deleted file mode 100644 index 28c6a407c..000000000 --- a/internal/dbmodels/defaultdb/mysql_main_test.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "bytes" - "database/sql" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "regexp" - "strings" - - "github.com/friendsofgo/errors" - _ "github.com/go-sql-driver/mysql" - "github.com/kat-co/vala" - "github.com/spf13/viper" - "github.com/volatiletech/sqlboiler/drivers/sqlboiler-mysql/driver" - "github.com/volatiletech/sqlboiler/randomize" -) - -var rgxMySQLkey = regexp.MustCompile(`(?m)((,\n)?\s+CONSTRAINT.*?FOREIGN KEY.*?\n)+`) - -type mysqlTester struct { - dbConn *sql.DB - - dbName string - host string - user string - pass string - sslmode string - port int - - optionFile string - - testDBName string - skipSQLCmd bool -} - -func init() { - dbMain = &mysqlTester{} -} - -func (m *mysqlTester) setup() error { - var err error - - viper.SetDefault("mysql.sslmode", "true") - viper.SetDefault("mysql.port", 3306) - - m.dbName = viper.GetString("mysql.dbname") - m.host = viper.GetString("mysql.host") - m.user = viper.GetString("mysql.user") - m.pass = viper.GetString("mysql.pass") - m.port = viper.GetInt("mysql.port") - m.sslmode = viper.GetString("mysql.sslmode") - m.testDBName = viper.GetString("mysql.testdbname") - m.skipSQLCmd = viper.GetBool("mysql.skipsqlcmd") - - err = vala.BeginValidation().Validate( - vala.StringNotEmpty(m.user, "mysql.user"), - vala.StringNotEmpty(m.host, "mysql.host"), - vala.Not(vala.Equals(m.port, 0, "mysql.port")), - vala.StringNotEmpty(m.dbName, "mysql.dbname"), - vala.StringNotEmpty(m.sslmode, "mysql.sslmode"), - ).Check() - - if err != nil { - return err - } - - // Create a randomized db name. - if len(m.testDBName) == 0 { - m.testDBName = randomize.StableDBName(m.dbName) - } - - if err = m.makeOptionFile(); err != nil { - return errors.Wrap(err, "couldn't make option file") - } - - if !m.skipSQLCmd { - if err = m.dropTestDB(); err != nil { - return err - } - if err = m.createTestDB(); err != nil { - return err - } - - dumpCmd := exec.Command("mysqldump", m.defaultsFile(), "--no-data", m.dbName) - createCmd := exec.Command("mysql", m.defaultsFile(), "--database", m.testDBName) - - r, w := io.Pipe() - dumpCmdStderr := &bytes.Buffer{} - createCmdStderr := &bytes.Buffer{} - - dumpCmd.Stdout = w - dumpCmd.Stderr = dumpCmdStderr - - createCmd.Stdin = newFKeyDestroyer(rgxMySQLkey, r) - createCmd.Stderr = createCmdStderr - - if err = dumpCmd.Start(); err != nil { - return errors.Wrap(err, "failed to start mysqldump command") - } - if err = createCmd.Start(); err != nil { - return errors.Wrap(err, "failed to start mysql command") - } - - if err = dumpCmd.Wait(); err != nil { - fmt.Println(err) - fmt.Println(dumpCmdStderr.String()) - return errors.Wrap(err, "failed to wait for mysqldump command") - } - - _ = w.Close() // After dumpCmd is done, close the write end of the pipe - - if err = createCmd.Wait(); err != nil { - fmt.Println(err) - fmt.Println(createCmdStderr.String()) - return errors.Wrap(err, "failed to wait for mysql command") - } - } - - return nil -} - -func (m *mysqlTester) sslMode(mode string) string { - switch mode { - case "true": - return "REQUIRED" - case "false": - return "DISABLED" - default: - return "PREFERRED" - } -} - -func (m *mysqlTester) defaultsFile() string { - return fmt.Sprintf("--defaults-file=%s", m.optionFile) -} - -func (m *mysqlTester) makeOptionFile() error { - tmp, err := ioutil.TempFile("", "optionfile") - if err != nil { - return errors.Wrap(err, "failed to create option file") - } - - isTCP := false - _, err = os.Stat(m.host) - if os.IsNotExist(err) { - isTCP = true - } else if err != nil { - return errors.Wrap(err, "could not stat m.host") - } - - fmt.Fprintln(tmp, "[client]") - fmt.Fprintf(tmp, "host=%s\n", m.host) - fmt.Fprintf(tmp, "port=%d\n", m.port) - fmt.Fprintf(tmp, "user=%s\n", m.user) - if len(m.pass) != 0 { - fmt.Fprintf(tmp, "password=%s\n", m.pass) - } - fmt.Fprintf(tmp, "ssl-mode=%s\n", m.sslMode(m.sslmode)) - if isTCP { - fmt.Fprintln(tmp, "protocol=tcp") - } - - fmt.Fprintln(tmp, "[mysqldump]") - fmt.Fprintf(tmp, "host=%s\n", m.host) - fmt.Fprintf(tmp, "port=%d\n", m.port) - fmt.Fprintf(tmp, "user=%s\n", m.user) - if len(m.pass) != 0 { - fmt.Fprintf(tmp, "password=%s\n", m.pass) - } - fmt.Fprintf(tmp, "ssl-mode=%s\n", m.sslMode(m.sslmode)) - if isTCP { - fmt.Fprintln(tmp, "protocol=tcp") - } - - m.optionFile = tmp.Name() - - return tmp.Close() -} - -func (m *mysqlTester) createTestDB() error { - sql := fmt.Sprintf("create database %s;", m.testDBName) - return m.runCmd(sql, "mysql") -} - -func (m *mysqlTester) dropTestDB() error { - sql := fmt.Sprintf("drop database if exists %s;", m.testDBName) - return m.runCmd(sql, "mysql") -} - -func (m *mysqlTester) teardown() error { - if m.dbConn != nil { - return m.dbConn.Close() - } - - if !m.skipSQLCmd { - if err := m.dropTestDB(); err != nil { - return err - } - } - - return os.Remove(m.optionFile) -} - -func (m *mysqlTester) runCmd(stdin, command string, args ...string) error { - args = append([]string{m.defaultsFile()}, args...) - - cmd := exec.Command(command, args...) - cmd.Stdin = strings.NewReader(stdin) - - stdout := &bytes.Buffer{} - stderr := &bytes.Buffer{} - cmd.Stdout = stdout - cmd.Stderr = stderr - if err := cmd.Run(); err != nil { - fmt.Println("failed running:", command, args) - fmt.Println(stdout.String()) - fmt.Println(stderr.String()) - return err - } - - return nil -} - -func (m *mysqlTester) conn() (*sql.DB, error) { - if m.dbConn != nil { - return m.dbConn, nil - } - - var err error - m.dbConn, err = sql.Open("mysql", driver.MySQLBuildQueryString(m.user, m.pass, m.testDBName, m.host, m.port, m.sslmode)) - if err != nil { - return nil, err - } - - return m.dbConn, nil -} diff --git a/internal/dbmodels/defaultdb/mysql_suites_test.go b/internal/dbmodels/defaultdb/mysql_suites_test.go deleted file mode 100644 index 3270b6cea..000000000 --- a/internal/dbmodels/defaultdb/mysql_suites_test.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import "testing" - -func TestUpsert(t *testing.T) { - t.Run("Users", testUsersUpsert) -} diff --git a/internal/dbmodels/defaultdb/mysql_upsert.go b/internal/dbmodels/defaultdb/mysql_upsert.go deleted file mode 100644 index 6bc33bf4e..000000000 --- a/internal/dbmodels/defaultdb/mysql_upsert.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "fmt" - "strings" - - "github.com/volatiletech/sqlboiler/drivers" - "github.com/volatiletech/sqlboiler/strmangle" -) - -// buildUpsertQueryMySQL builds a SQL statement string using the upsertData provided. -func buildUpsertQueryMySQL(dia drivers.Dialect, tableName string, update, whitelist []string) string { - whitelist = strmangle.IdentQuoteSlice(dia.LQ, dia.RQ, whitelist) - tableName = strmangle.IdentQuote(dia.LQ, dia.RQ, tableName) - - buf := strmangle.GetBuffer() - defer strmangle.PutBuffer(buf) - - var columns string - if len(whitelist) != 0 { - columns = strings.Join(whitelist, ",") - } - - if len(update) == 0 { - fmt.Fprintf( - buf, - "INSERT IGNORE INTO %s (%s) VALUES (%s)", - tableName, - columns, - strmangle.Placeholders(dia.UseIndexPlaceholders, len(whitelist), 1, 1), - ) - return buf.String() - } - - fmt.Fprintf( - buf, - "INSERT INTO %s (%s) VALUES (%s) ON DUPLICATE KEY UPDATE ", - tableName, - columns, - strmangle.Placeholders(dia.UseIndexPlaceholders, len(whitelist), 1, 1), - ) - - for i, v := range update { - if i != 0 { - buf.WriteByte(',') - } - quoted := strmangle.IdentQuote(dia.LQ, dia.RQ, v) - buf.WriteString(quoted) - buf.WriteString(" = VALUES(") - buf.WriteString(quoted) - buf.WriteByte(')') - } - - return buf.String() -} diff --git a/internal/dbmodels/defaultdb/users.go b/internal/dbmodels/defaultdb/users.go deleted file mode 100644 index 7c73d3284..000000000 --- a/internal/dbmodels/defaultdb/users.go +++ /dev/null @@ -1,830 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "context" - "database/sql" - "fmt" - "reflect" - "strconv" - "strings" - "sync" - "time" - - "github.com/friendsofgo/errors" - "github.com/volatiletech/null" - "github.com/volatiletech/sqlboiler/boil" - "github.com/volatiletech/sqlboiler/queries" - "github.com/volatiletech/sqlboiler/queries/qm" - "github.com/volatiletech/sqlboiler/queries/qmhelper" - "github.com/volatiletech/sqlboiler/strmangle" -) - -// User is an object representing the database table. -type User struct { - ID string `boil:"id" json:"id" toml:"id" yaml:"id"` - DisplayName string `boil:"display_name" json:"displayName" toml:"displayName" yaml:"displayName"` - IconImagePath string `boil:"icon_image_path" json:"iconImagePath" toml:"iconImagePath" yaml:"iconImagePath"` - BackgroundImagePath string `boil:"background_image_path" json:"backgroundImagePath" toml:"backgroundImagePath" yaml:"backgroundImagePath"` - Profile null.String `boil:"profile" json:"profile,omitempty" toml:"profile" yaml:"profile,omitempty"` - Email null.String `boil:"email" json:"email,omitempty" toml:"email" yaml:"email,omitempty"` - CreatedAt time.Time `boil:"created_at" json:"createdAt" toml:"createdAt" yaml:"createdAt"` - UpdatedAt time.Time `boil:"updated_at" json:"updatedAt" toml:"updatedAt" yaml:"updatedAt"` - DeletedAt null.Time `boil:"deleted_at" json:"deletedAt,omitempty" toml:"deletedAt" yaml:"deletedAt,omitempty"` - - R *userR `boil:"-" json:"-" toml:"-" yaml:"-"` - L userL `boil:"-" json:"-" toml:"-" yaml:"-"` -} - -var UserColumns = struct { - ID string - DisplayName string - IconImagePath string - BackgroundImagePath string - Profile string - Email string - CreatedAt string - UpdatedAt string - DeletedAt string -}{ - ID: "id", - DisplayName: "display_name", - IconImagePath: "icon_image_path", - BackgroundImagePath: "background_image_path", - Profile: "profile", - Email: "email", - CreatedAt: "created_at", - UpdatedAt: "updated_at", - DeletedAt: "deleted_at", -} - -// Generated where - -type whereHelperstring struct{ field string } - -func (w whereHelperstring) EQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } -func (w whereHelperstring) NEQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } -func (w whereHelperstring) LT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } -func (w whereHelperstring) LTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } -func (w whereHelperstring) GT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } -func (w whereHelperstring) GTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } -func (w whereHelperstring) IN(slice []string) qm.QueryMod { - values := make([]interface{}, 0, len(slice)) - for _, value := range slice { - values = append(values, value) - } - return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) -} - -type whereHelpernull_String struct{ field string } - -func (w whereHelpernull_String) EQ(x null.String) qm.QueryMod { - return qmhelper.WhereNullEQ(w.field, false, x) -} -func (w whereHelpernull_String) NEQ(x null.String) qm.QueryMod { - return qmhelper.WhereNullEQ(w.field, true, x) -} -func (w whereHelpernull_String) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) } -func (w whereHelpernull_String) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) } -func (w whereHelpernull_String) LT(x null.String) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LT, x) -} -func (w whereHelpernull_String) LTE(x null.String) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LTE, x) -} -func (w whereHelpernull_String) GT(x null.String) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GT, x) -} -func (w whereHelpernull_String) GTE(x null.String) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GTE, x) -} - -type whereHelpertime_Time struct{ field string } - -func (w whereHelpertime_Time) EQ(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.EQ, x) -} -func (w whereHelpertime_Time) NEQ(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.NEQ, x) -} -func (w whereHelpertime_Time) LT(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LT, x) -} -func (w whereHelpertime_Time) LTE(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LTE, x) -} -func (w whereHelpertime_Time) GT(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GT, x) -} -func (w whereHelpertime_Time) GTE(x time.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GTE, x) -} - -type whereHelpernull_Time struct{ field string } - -func (w whereHelpernull_Time) EQ(x null.Time) qm.QueryMod { - return qmhelper.WhereNullEQ(w.field, false, x) -} -func (w whereHelpernull_Time) NEQ(x null.Time) qm.QueryMod { - return qmhelper.WhereNullEQ(w.field, true, x) -} -func (w whereHelpernull_Time) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) } -func (w whereHelpernull_Time) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) } -func (w whereHelpernull_Time) LT(x null.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LT, x) -} -func (w whereHelpernull_Time) LTE(x null.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.LTE, x) -} -func (w whereHelpernull_Time) GT(x null.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GT, x) -} -func (w whereHelpernull_Time) GTE(x null.Time) qm.QueryMod { - return qmhelper.Where(w.field, qmhelper.GTE, x) -} - -var UserWhere = struct { - ID whereHelperstring - DisplayName whereHelperstring - IconImagePath whereHelperstring - BackgroundImagePath whereHelperstring - Profile whereHelpernull_String - Email whereHelpernull_String - CreatedAt whereHelpertime_Time - UpdatedAt whereHelpertime_Time - DeletedAt whereHelpernull_Time -}{ - ID: whereHelperstring{field: "`users`.`id`"}, - DisplayName: whereHelperstring{field: "`users`.`display_name`"}, - IconImagePath: whereHelperstring{field: "`users`.`icon_image_path`"}, - BackgroundImagePath: whereHelperstring{field: "`users`.`background_image_path`"}, - Profile: whereHelpernull_String{field: "`users`.`profile`"}, - Email: whereHelpernull_String{field: "`users`.`email`"}, - CreatedAt: whereHelpertime_Time{field: "`users`.`created_at`"}, - UpdatedAt: whereHelpertime_Time{field: "`users`.`updated_at`"}, - DeletedAt: whereHelpernull_Time{field: "`users`.`deleted_at`"}, -} - -// UserRels is where relationship names are stored. -var UserRels = struct { -}{} - -// userR is where relationships are stored. -type userR struct { -} - -// NewStruct creates a new relationship struct -func (*userR) NewStruct() *userR { - return &userR{} -} - -// userL is where Load methods for each relationship are stored. -type userL struct{} - -var ( - userAllColumns = []string{"id", "display_name", "icon_image_path", "background_image_path", "profile", "email", "created_at", "updated_at", "deleted_at"} - userColumnsWithoutDefault = []string{"id", "display_name", "icon_image_path", "background_image_path", "profile", "email", "deleted_at"} - userColumnsWithDefault = []string{"created_at", "updated_at"} - userPrimaryKeyColumns = []string{"id"} -) - -type ( - // UserSlice is an alias for a slice of pointers to User. - // This should generally be used opposed to []User. - UserSlice []*User - - userQuery struct { - *queries.Query - } -) - -// Cache for insert, update and upsert -var ( - userType = reflect.TypeOf(&User{}) - userMapping = queries.MakeStructMapping(userType) - userPrimaryKeyMapping, _ = queries.BindMapping(userType, userMapping, userPrimaryKeyColumns) - userInsertCacheMut sync.RWMutex - userInsertCache = make(map[string]insertCache) - userUpdateCacheMut sync.RWMutex - userUpdateCache = make(map[string]updateCache) - userUpsertCacheMut sync.RWMutex - userUpsertCache = make(map[string]insertCache) -) - -var ( - // Force time package dependency for automated UpdatedAt/CreatedAt. - _ = time.Second - // Force qmhelper dependency for where clause generation (which doesn't - // always happen) - _ = qmhelper.Where -) - -// One returns a single user record from the query. -func (q userQuery) One(ctx context.Context, exec boil.ContextExecutor) (*User, error) { - o := &User{} - - queries.SetLimit(q.Query, 1) - - err := q.Bind(ctx, exec, o) - if err != nil { - if errors.Cause(err) == sql.ErrNoRows { - return nil, sql.ErrNoRows - } - return nil, errors.Wrap(err, "defaultdb: failed to execute a one query for users") - } - - return o, nil -} - -// All returns all User records from the query. -func (q userQuery) All(ctx context.Context, exec boil.ContextExecutor) (UserSlice, error) { - var o []*User - - err := q.Bind(ctx, exec, &o) - if err != nil { - return nil, errors.Wrap(err, "defaultdb: failed to assign all query results to User slice") - } - - return o, nil -} - -// Count returns the count of all User records in the query. -func (q userQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { - var count int64 - - queries.SetSelect(q.Query, nil) - queries.SetCount(q.Query) - - err := q.Query.QueryRowContext(ctx, exec).Scan(&count) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: failed to count users rows") - } - - return count, nil -} - -// Exists checks if the row exists in the table. -func (q userQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { - var count int64 - - queries.SetSelect(q.Query, nil) - queries.SetCount(q.Query) - queries.SetLimit(q.Query, 1) - - err := q.Query.QueryRowContext(ctx, exec).Scan(&count) - if err != nil { - return false, errors.Wrap(err, "defaultdb: failed to check if users exists") - } - - return count > 0, nil -} - -// Users retrieves all the records using an executor. -func Users(mods ...qm.QueryMod) userQuery { - mods = append(mods, qm.From("`users`")) - return userQuery{NewQuery(mods...)} -} - -// FindUser retrieves a single record by ID with an executor. -// If selectCols is empty Find will return all columns. -func FindUser(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*User, error) { - userObj := &User{} - - sel := "*" - if len(selectCols) > 0 { - sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") - } - query := fmt.Sprintf( - "select %s from `users` where `id`=?", sel, - ) - - q := queries.Raw(query, iD) - - err := q.Bind(ctx, exec, userObj) - if err != nil { - if errors.Cause(err) == sql.ErrNoRows { - return nil, sql.ErrNoRows - } - return nil, errors.Wrap(err, "defaultdb: unable to select from users") - } - - return userObj, nil -} - -// Insert a single record using an executor. -// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. -func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { - if o == nil { - return errors.New("defaultdb: no users provided for insertion") - } - - var err error - if !boil.TimestampsAreSkipped(ctx) { - currTime := time.Now().In(boil.GetLocation()) - - if o.CreatedAt.IsZero() { - o.CreatedAt = currTime - } - if o.UpdatedAt.IsZero() { - o.UpdatedAt = currTime - } - } - - nzDefaults := queries.NonZeroDefaultSet(userColumnsWithDefault, o) - - key := makeCacheKey(columns, nzDefaults) - userInsertCacheMut.RLock() - cache, cached := userInsertCache[key] - userInsertCacheMut.RUnlock() - - if !cached { - wl, returnColumns := columns.InsertColumnSet( - userAllColumns, - userColumnsWithDefault, - userColumnsWithoutDefault, - nzDefaults, - ) - - cache.valueMapping, err = queries.BindMapping(userType, userMapping, wl) - if err != nil { - return err - } - cache.retMapping, err = queries.BindMapping(userType, userMapping, returnColumns) - if err != nil { - return err - } - if len(wl) != 0 { - cache.query = fmt.Sprintf("INSERT INTO `users` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) - } else { - cache.query = "INSERT INTO `users` () VALUES ()%s%s" - } - - var queryOutput, queryReturning string - - if len(cache.retMapping) != 0 { - cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `users` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns)) - } - - cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) - } - - value := reflect.Indirect(reflect.ValueOf(o)) - vals := queries.ValuesFromMapping(value, cache.valueMapping) - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, cache.query) - fmt.Fprintln(writer, vals) - } - _, err = exec.ExecContext(ctx, cache.query, vals...) - - if err != nil { - return errors.Wrap(err, "defaultdb: unable to insert into users") - } - - var identifierCols []interface{} - - if len(cache.retMapping) == 0 { - goto CacheNoHooks - } - - identifierCols = []interface{}{ - o.ID, - } - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, cache.retQuery) - fmt.Fprintln(writer, identifierCols...) - } - err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) - if err != nil { - return errors.Wrap(err, "defaultdb: unable to populate default values for users") - } - -CacheNoHooks: - if !cached { - userInsertCacheMut.Lock() - userInsertCache[key] = cache - userInsertCacheMut.Unlock() - } - - return nil -} - -// Update uses an executor to update the User. -// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. -// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. -func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { - if !boil.TimestampsAreSkipped(ctx) { - currTime := time.Now().In(boil.GetLocation()) - - o.UpdatedAt = currTime - } - - var err error - key := makeCacheKey(columns, nil) - userUpdateCacheMut.RLock() - cache, cached := userUpdateCache[key] - userUpdateCacheMut.RUnlock() - - if !cached { - wl := columns.UpdateColumnSet( - userAllColumns, - userPrimaryKeyColumns, - ) - - if !columns.IsWhitelist() { - wl = strmangle.SetComplement(wl, []string{"created_at"}) - } - if len(wl) == 0 { - return 0, errors.New("defaultdb: unable to update users, could not build whitelist") - } - - cache.query = fmt.Sprintf("UPDATE `users` SET %s WHERE %s", - strmangle.SetParamNames("`", "`", 0, wl), - strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), - ) - cache.valueMapping, err = queries.BindMapping(userType, userMapping, append(wl, userPrimaryKeyColumns...)) - if err != nil { - return 0, err - } - } - - values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, cache.query) - fmt.Fprintln(writer, values) - } - var result sql.Result - result, err = exec.ExecContext(ctx, cache.query, values...) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to update users row") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: failed to get rows affected by update for users") - } - - if !cached { - userUpdateCacheMut.Lock() - userUpdateCache[key] = cache - userUpdateCacheMut.Unlock() - } - - return rowsAff, nil -} - -// UpdateAll updates all rows with the specified column values. -func (q userQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { - queries.SetUpdate(q.Query, cols) - - result, err := q.Query.ExecContext(ctx, exec) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to update all for users") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to retrieve rows affected for users") - } - - return rowsAff, nil -} - -// UpdateAll updates all rows with the specified column values, using an executor. -func (o UserSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { - ln := int64(len(o)) - if ln == 0 { - return 0, nil - } - - if len(cols) == 0 { - return 0, errors.New("defaultdb: update all requires at least one column argument") - } - - colNames := make([]string, len(cols)) - args := make([]interface{}, len(cols)) - - i := 0 - for name, value := range cols { - colNames[i] = name - args[i] = value - i++ - } - - // Append all of the primary key values for each column - for _, obj := range o { - pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) - args = append(args, pkeyArgs...) - } - - sql := fmt.Sprintf("UPDATE `users` SET %s WHERE %s", - strmangle.SetParamNames("`", "`", 0, colNames), - strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(o))) - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, sql) - fmt.Fprintln(writer, args...) - } - result, err := exec.ExecContext(ctx, sql, args...) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to update all in user slice") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to retrieve rows affected all in update all user") - } - return rowsAff, nil -} - -var mySQLUserUniqueColumns = []string{ - "id", -} - -// Upsert attempts an insert using an executor, and does an update or ignore on conflict. -// See boil.Columns documentation for how to properly use updateColumns and insertColumns. -func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateColumns, insertColumns boil.Columns) error { - if o == nil { - return errors.New("defaultdb: no users provided for upsert") - } - if !boil.TimestampsAreSkipped(ctx) { - currTime := time.Now().In(boil.GetLocation()) - - if o.CreatedAt.IsZero() { - o.CreatedAt = currTime - } - o.UpdatedAt = currTime - } - - nzDefaults := queries.NonZeroDefaultSet(userColumnsWithDefault, o) - nzUniques := queries.NonZeroDefaultSet(mySQLUserUniqueColumns, o) - - if len(nzUniques) == 0 { - return errors.New("cannot upsert with a table that cannot conflict on a unique column") - } - - // Build cache key in-line uglily - mysql vs psql problems - buf := strmangle.GetBuffer() - buf.WriteString(strconv.Itoa(updateColumns.Kind)) - for _, c := range updateColumns.Cols { - buf.WriteString(c) - } - buf.WriteByte('.') - buf.WriteString(strconv.Itoa(insertColumns.Kind)) - for _, c := range insertColumns.Cols { - buf.WriteString(c) - } - buf.WriteByte('.') - for _, c := range nzDefaults { - buf.WriteString(c) - } - buf.WriteByte('.') - for _, c := range nzUniques { - buf.WriteString(c) - } - key := buf.String() - strmangle.PutBuffer(buf) - - userUpsertCacheMut.RLock() - cache, cached := userUpsertCache[key] - userUpsertCacheMut.RUnlock() - - var err error - - if !cached { - insert, ret := insertColumns.InsertColumnSet( - userAllColumns, - userColumnsWithDefault, - userColumnsWithoutDefault, - nzDefaults, - ) - update := updateColumns.UpdateColumnSet( - userAllColumns, - userPrimaryKeyColumns, - ) - - if len(update) == 0 { - return errors.New("defaultdb: unable to upsert users, could not build update column list") - } - - ret = strmangle.SetComplement(ret, nzUniques) - cache.query = buildUpsertQueryMySQL(dialect, "users", update, insert) - cache.retQuery = fmt.Sprintf( - "SELECT %s FROM `users` WHERE %s", - strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, ret), ","), - strmangle.WhereClause("`", "`", 0, nzUniques), - ) - - cache.valueMapping, err = queries.BindMapping(userType, userMapping, insert) - if err != nil { - return err - } - if len(ret) != 0 { - cache.retMapping, err = queries.BindMapping(userType, userMapping, ret) - if err != nil { - return err - } - } - } - - value := reflect.Indirect(reflect.ValueOf(o)) - vals := queries.ValuesFromMapping(value, cache.valueMapping) - var returns []interface{} - if len(cache.retMapping) != 0 { - returns = queries.PtrsFromMapping(value, cache.retMapping) - } - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, cache.query) - fmt.Fprintln(writer, vals) - } - _, err = exec.ExecContext(ctx, cache.query, vals...) - - if err != nil { - return errors.Wrap(err, "defaultdb: unable to upsert for users") - } - - var uniqueMap []uint64 - var nzUniqueCols []interface{} - - if len(cache.retMapping) == 0 { - goto CacheNoHooks - } - - uniqueMap, err = queries.BindMapping(userType, userMapping, nzUniques) - if err != nil { - return errors.Wrap(err, "defaultdb: unable to retrieve unique values for users") - } - nzUniqueCols = queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), uniqueMap) - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, cache.retQuery) - fmt.Fprintln(writer, nzUniqueCols...) - } - err = exec.QueryRowContext(ctx, cache.retQuery, nzUniqueCols...).Scan(returns...) - if err != nil { - return errors.Wrap(err, "defaultdb: unable to populate default values for users") - } - -CacheNoHooks: - if !cached { - userUpsertCacheMut.Lock() - userUpsertCache[key] = cache - userUpsertCacheMut.Unlock() - } - - return nil -} - -// Delete deletes a single User record with an executor. -// Delete will match against the primary key column to find the record to delete. -func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { - if o == nil { - return 0, errors.New("defaultdb: no User provided for delete") - } - - args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), userPrimaryKeyMapping) - sql := "DELETE FROM `users` WHERE `id`=?" - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, sql) - fmt.Fprintln(writer, args...) - } - result, err := exec.ExecContext(ctx, sql, args...) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to delete from users") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: failed to get rows affected by delete for users") - } - - return rowsAff, nil -} - -// DeleteAll deletes all matching rows. -func (q userQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { - if q.Query == nil { - return 0, errors.New("defaultdb: no userQuery provided for delete all") - } - - queries.SetDelete(q.Query) - - result, err := q.Query.ExecContext(ctx, exec) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to delete all from users") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: failed to get rows affected by deleteall for users") - } - - return rowsAff, nil -} - -// DeleteAll deletes all rows in the slice, using an executor. -func (o UserSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { - if len(o) == 0 { - return 0, nil - } - - var args []interface{} - for _, obj := range o { - pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) - args = append(args, pkeyArgs...) - } - - sql := "DELETE FROM `users` WHERE " + - strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(o)) - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, sql) - fmt.Fprintln(writer, args) - } - result, err := exec.ExecContext(ctx, sql, args...) - if err != nil { - return 0, errors.Wrap(err, "defaultdb: unable to delete all from user slice") - } - - rowsAff, err := result.RowsAffected() - if err != nil { - return 0, errors.Wrap(err, "defaultdb: failed to get rows affected by deleteall for users") - } - - return rowsAff, nil -} - -// Reload refetches the object from the database -// using the primary keys with an executor. -func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error { - ret, err := FindUser(ctx, exec, o.ID) - if err != nil { - return err - } - - *o = *ret - return nil -} - -// ReloadAll refetches every row with matching primary key column values -// and overwrites the original object slice with the newly updated slice. -func (o *UserSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { - if o == nil || len(*o) == 0 { - return nil - } - - slice := UserSlice{} - var args []interface{} - for _, obj := range *o { - pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) - args = append(args, pkeyArgs...) - } - - sql := "SELECT `users`.* FROM `users` WHERE " + - strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(*o)) - - q := queries.Raw(sql, args...) - - err := q.Bind(ctx, exec, &slice) - if err != nil { - return errors.Wrap(err, "defaultdb: unable to reload all in UserSlice") - } - - *o = slice - - return nil -} - -// UserExists checks if the User row exists. -func UserExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { - var exists bool - sql := "select exists(select 1 from `users` where `id`=? limit 1)" - - if boil.IsDebug(ctx) { - writer := boil.DebugWriterFrom(ctx) - fmt.Fprintln(writer, sql) - fmt.Fprintln(writer, iD) - } - row := exec.QueryRowContext(ctx, sql, iD) - - err := row.Scan(&exists) - if err != nil { - return false, errors.Wrap(err, "defaultdb: unable to check if users exists") - } - - return exists, nil -} diff --git a/internal/dbmodels/defaultdb/users_test.go b/internal/dbmodels/defaultdb/users_test.go deleted file mode 100644 index ee0c6bd59..000000000 --- a/internal/dbmodels/defaultdb/users_test.go +++ /dev/null @@ -1,594 +0,0 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. -// This file is meant to be re-generated in place and/or deleted at any time. - -package defaultdb - -import ( - "bytes" - "context" - "reflect" - "testing" - - "github.com/volatiletech/sqlboiler/boil" - "github.com/volatiletech/sqlboiler/queries" - "github.com/volatiletech/sqlboiler/randomize" - "github.com/volatiletech/sqlboiler/strmangle" -) - -var ( - // Relationships sometimes use the reflection helper queries.Equal/queries.Assign - // so force a package dependency in case they don't. - _ = queries.Equal -) - -func testUsers(t *testing.T) { - t.Parallel() - - query := Users() - - if query.Query == nil { - t.Error("expected a query, got nothing") - } -} - -func testUsersDelete(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - if rowsAff, err := o.Delete(ctx, tx); err != nil { - t.Error(err) - } else if rowsAff != 1 { - t.Error("should only have deleted one row, but affected:", rowsAff) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 0 { - t.Error("want zero records, got:", count) - } -} - -func testUsersQueryDeleteAll(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - if rowsAff, err := Users().DeleteAll(ctx, tx); err != nil { - t.Error(err) - } else if rowsAff != 1 { - t.Error("should only have deleted one row, but affected:", rowsAff) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 0 { - t.Error("want zero records, got:", count) - } -} - -func testUsersSliceDeleteAll(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - slice := UserSlice{o} - - if rowsAff, err := slice.DeleteAll(ctx, tx); err != nil { - t.Error(err) - } else if rowsAff != 1 { - t.Error("should only have deleted one row, but affected:", rowsAff) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 0 { - t.Error("want zero records, got:", count) - } -} - -func testUsersExists(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - e, err := UserExists(ctx, tx, o.ID) - if err != nil { - t.Errorf("Unable to check if User exists: %s", err) - } - if !e { - t.Errorf("Expected UserExists to return true, but got false.") - } -} - -func testUsersFind(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - userFound, err := FindUser(ctx, tx, o.ID) - if err != nil { - t.Error(err) - } - - if userFound == nil { - t.Error("want a record, got nil") - } -} - -func testUsersBind(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - if err = Users().Bind(ctx, tx, o); err != nil { - t.Error(err) - } -} - -func testUsersOne(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - if x, err := Users().One(ctx, tx); err != nil { - t.Error(err) - } else if x == nil { - t.Error("expected to get a non nil record") - } -} - -func testUsersAll(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - userOne := &User{} - userTwo := &User{} - if err = randomize.Struct(seed, userOne, userDBTypes, false, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - if err = randomize.Struct(seed, userTwo, userDBTypes, false, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = userOne.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - if err = userTwo.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - slice, err := Users().All(ctx, tx) - if err != nil { - t.Error(err) - } - - if len(slice) != 2 { - t.Error("want 2 records, got:", len(slice)) - } -} - -func testUsersCount(t *testing.T) { - t.Parallel() - - var err error - seed := randomize.NewSeed() - userOne := &User{} - userTwo := &User{} - if err = randomize.Struct(seed, userOne, userDBTypes, false, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - if err = randomize.Struct(seed, userTwo, userDBTypes, false, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = userOne.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - if err = userTwo.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 2 { - t.Error("want 2 records, got:", count) - } -} - -func testUsersInsert(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 1 { - t.Error("want one record, got:", count) - } -} - -func testUsersInsertWhitelist(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Whitelist(userColumnsWithoutDefault...)); err != nil { - t.Error(err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 1 { - t.Error("want one record, got:", count) - } -} - -func testUsersReload(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - if err = o.Reload(ctx, tx); err != nil { - t.Error(err) - } -} - -func testUsersReloadAll(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - slice := UserSlice{o} - - if err = slice.ReloadAll(ctx, tx); err != nil { - t.Error(err) - } -} - -func testUsersSelect(t *testing.T) { - t.Parallel() - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - slice, err := Users().All(ctx, tx) - if err != nil { - t.Error(err) - } - - if len(slice) != 1 { - t.Error("want one record, got:", len(slice)) - } -} - -var ( - userDBTypes = map[string]string{`ID`: `varchar`, `DisplayName`: `varchar`, `IconImagePath`: `varchar`, `BackgroundImagePath`: `varchar`, `Profile`: `varchar`, `Email`: `varchar`, `CreatedAt`: `timestamp`, `UpdatedAt`: `timestamp`, `DeletedAt`: `timestamp`} - _ = bytes.MinRead -) - -func testUsersUpdate(t *testing.T) { - t.Parallel() - - if 0 == len(userPrimaryKeyColumns) { - t.Skip("Skipping table with no primary key columns") - } - if len(userAllColumns) == len(userPrimaryKeyColumns) { - t.Skip("Skipping table with only primary key columns") - } - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 1 { - t.Error("want one record, got:", count) - } - - if err = randomize.Struct(seed, o, userDBTypes, true, userPrimaryKeyColumns...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - if rowsAff, err := o.Update(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } else if rowsAff != 1 { - t.Error("should only affect one row but affected", rowsAff) - } -} - -func testUsersSliceUpdateAll(t *testing.T) { - t.Parallel() - - if len(userAllColumns) == len(userPrimaryKeyColumns) { - t.Skip("Skipping table with only primary key columns") - } - - seed := randomize.NewSeed() - var err error - o := &User{} - if err = randomize.Struct(seed, o, userDBTypes, true, userColumnsWithDefault...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Insert(ctx, tx, boil.Infer()); err != nil { - t.Error(err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - - if count != 1 { - t.Error("want one record, got:", count) - } - - if err = randomize.Struct(seed, o, userDBTypes, true, userPrimaryKeyColumns...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - // Remove Primary keys and unique columns from what we plan to update - var fields []string - if strmangle.StringSliceMatch(userAllColumns, userPrimaryKeyColumns) { - fields = userAllColumns - } else { - fields = strmangle.SetComplement( - userAllColumns, - userPrimaryKeyColumns, - ) - } - - value := reflect.Indirect(reflect.ValueOf(o)) - typ := reflect.TypeOf(o).Elem() - n := typ.NumField() - - updateMap := M{} - for _, col := range fields { - for i := 0; i < n; i++ { - f := typ.Field(i) - if f.Tag.Get("boil") == col { - updateMap[col] = value.Field(i).Interface() - } - } - } - - slice := UserSlice{o} - if rowsAff, err := slice.UpdateAll(ctx, tx, updateMap); err != nil { - t.Error(err) - } else if rowsAff != 1 { - t.Error("wanted one record updated but got", rowsAff) - } -} - -func testUsersUpsert(t *testing.T) { - t.Parallel() - - if len(userAllColumns) == len(userPrimaryKeyColumns) { - t.Skip("Skipping table with only primary key columns") - } - if len(mySQLUserUniqueColumns) == 0 { - t.Skip("Skipping table with no unique columns to conflict on") - } - - seed := randomize.NewSeed() - var err error - // Attempt the INSERT side of an UPSERT - o := User{} - if err = randomize.Struct(seed, &o, userDBTypes, false); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - ctx := context.Background() - tx := MustTx(boil.BeginTx(ctx, nil)) - defer func() { _ = tx.Rollback() }() - if err = o.Upsert(ctx, tx, boil.Infer(), boil.Infer()); err != nil { - t.Errorf("Unable to upsert User: %s", err) - } - - count, err := Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - if count != 1 { - t.Error("want one record, got:", count) - } - - // Attempt the UPDATE side of an UPSERT - if err = randomize.Struct(seed, &o, userDBTypes, false, userPrimaryKeyColumns...); err != nil { - t.Errorf("Unable to randomize User struct: %s", err) - } - - if err = o.Upsert(ctx, tx, boil.Infer(), boil.Infer()); err != nil { - t.Errorf("Unable to upsert User: %s", err) - } - - count, err = Users().Count(ctx, tx) - if err != nil { - t.Error(err) - } - if count != 1 { - t.Error("want one record, got:", count) - } -} diff --git a/internal/default-grpc/domain/model/testdata/test_data.go b/internal/default-grpc/domain/model/testdata/test_data.go deleted file mode 100644 index 8c5d9208d..000000000 --- a/internal/default-grpc/domain/model/testdata/test_data.go +++ /dev/null @@ -1,28 +0,0 @@ -package testdata - -import ( - "time" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - "github.com/bxcodec/faker" -) - -// NewDomainModel : -func NewDomainModel() *struct { - User *model.User -} { - - user := &model.User{} - if err := faker.FakeData(user); err != nil { - panic(err) - } - - user.CreatedAt = time.Time{} - user.UpdatedAt = time.Time{} - - return &struct { - User *model.User - }{ - User: user, - } -} diff --git a/internal/default-grpc/domain/model/user.go b/internal/default-grpc/domain/model/user.go deleted file mode 100644 index d736e513a..000000000 --- a/internal/default-grpc/domain/model/user.go +++ /dev/null @@ -1,20 +0,0 @@ -package model - -import "time" - -// User ... user model -type User struct { - ID string `json:"id"` - DisplayName string `json:"display_name"` - IconImagePath string `json:"icon_image_path"` - BackgroundImagePath string `json:"background_image_path"` - Profile *string `json:"profile"` - Email *string `json:"email"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` -} - -// Exist ... check exist or not -func (user *User) Exist() bool { - return user != nil -} diff --git a/internal/default-grpc/domain/repository/mock/user.go b/internal/default-grpc/domain/repository/mock/user.go deleted file mode 100644 index 56f5abfe1..000000000 --- a/internal/default-grpc/domain/repository/mock/user.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default-grpc/domain/repository/user.go - -// Package mock_repository is a generated GoMock package. -package mock_repository - -import ( - context "context" - reflect "reflect" - - model "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - gomock "github.com/golang/mock/gomock" -) - -// MockUser is a mock of User interface -type MockUser struct { - ctrl *gomock.Controller - recorder *MockUserMockRecorder -} - -// MockUserMockRecorder is the mock recorder for MockUser -type MockUserMockRecorder struct { - mock *MockUser -} - -// NewMockUser creates a new mock instance -func NewMockUser(ctrl *gomock.Controller) *MockUser { - mock := &MockUser{ctrl: ctrl} - mock.recorder = &MockUserMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockUser) EXPECT() *MockUserMockRecorder { - return m.recorder -} - -// Get mocks base method -func (m *MockUser) Get(ctx context.Context, userID string, orFail bool) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, userID, orFail) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get -func (mr *MockUserMockRecorder) Get(ctx, userID, orFail interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUser)(nil).Get), ctx, userID, orFail) -} - -// Create mocks base method -func (m *MockUser) Create(ctx context.Context, user *model.User) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", ctx, user) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create -func (mr *MockUserMockRecorder) Create(ctx, user interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUser)(nil).Create), ctx, user) -} diff --git a/internal/default-grpc/domain/service/.gitkeep b/internal/default-grpc/domain/service/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default-grpc/handler/user.go b/internal/default-grpc/handler/user.go deleted file mode 100644 index a45470b8d..000000000 --- a/internal/default-grpc/handler/user.go +++ /dev/null @@ -1,38 +0,0 @@ -package handler - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/usecase" - pb "github.com/abyssparanoia/rapid-go/proto/default" -) - -// UserHandler ... -type UserHandler struct { - userUsecase usecase.User -} - -// GetUser ... -func (h *UserHandler) GetUser( - ctx context.Context, - req *pb.GetUserRequest, -) (*pb.User, error) { - user, err := h.userUsecase.Get(ctx, req.GetUserId()) - if err != nil { - return nil, err - } - - return &pb.User{ - Id: user.ID, - DisplayName: user.DisplayName, - IconImagePath: user.IconImagePath, - BackgroundImagePath: user.BackgroundImagePath, - }, nil -} - -// NewUserHandler ... -func NewUserHandler( - userUsecase usecase.User, -) *UserHandler { - return &UserHandler{userUsecase} -} diff --git a/internal/default-grpc/infrastructure/entity/user.go b/internal/default-grpc/infrastructure/entity/user.go deleted file mode 100644 index f3a6b2cc8..000000000 --- a/internal/default-grpc/infrastructure/entity/user.go +++ /dev/null @@ -1,52 +0,0 @@ -package entity - -import ( - "github.com/abyssparanoia/rapid-go/internal/dbmodels/defaultdb" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - "github.com/volatiletech/null" -) - -// User ... user entity -type User struct { - defaultdb.User -} - -// OutputModel ... output model from entity -func (e *User) OutputModel() *model.User { - return &model.User{ - ID: e.ID, - DisplayName: e.DisplayName, - IconImagePath: e.IconImagePath, - BackgroundImagePath: e.BackgroundImagePath, - Profile: e.Profile.Ptr(), - Email: e.Email.Ptr(), - } -} - -// NewUserFromModel ... new user from model -func NewUserFromModel(m *model.User) *User { - e := &User{} - e.ID = m.ID - e.DisplayName = m.DisplayName - e.IconImagePath = m.IconImagePath - e.BackgroundImagePath = m.BackgroundImagePath - e.Profile = null.StringFromPtr(m.Profile) - e.Email = null.StringFromPtr(m.Email) - return e -} - -// OutputUsers ... output multi user models from entities -func OutputUsers(dsts []*User) []*model.User { - - users := []*model.User{} - for _, dst := range dsts { - users = append(users, dst.OutputModel()) - } - - return users -} - -// UserTableName ... get user table name -func UserTableName() string { - return "users" -} diff --git a/internal/default-grpc/infrastructure/repository/user_impl.go b/internal/default-grpc/infrastructure/repository/user_impl.go deleted file mode 100644 index 1ea30001d..000000000 --- a/internal/default-grpc/infrastructure/repository/user_impl.go +++ /dev/null @@ -1,57 +0,0 @@ -package repository - -import ( - "context" - "database/sql" - - "github.com/abyssparanoia/rapid-go/internal/dbmodels/defaultdb" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/repository" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/infrastructure/entity" - "github.com/abyssparanoia/rapid-go/internal/pkg/error/grpcerror" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluesqlboiler" - "github.com/volatiletech/sqlboiler/boil" -) - -type user struct { -} - -func (r *user) Get( - ctx context.Context, - userID string, - orFail bool, -) (*model.User, error) { - - dbUser, err := defaultdb.Users( - defaultdb.UserWhere.ID.EQ(userID), - ).One(ctx, gluesqlboiler.GetContextExecutor(ctx)) - - if err != nil { - if err == sql.ErrNoRows && orFail { - return nil, grpcerror.UserNotFoundErr.New() - } - return nil, grpcerror.DBInternalErr.Wrap(err) - } - - user := entity.User{User: *dbUser} - return user.OutputModel(), nil -} - -func (r *user) Create( - ctx context.Context, - user *model.User, -) (*model.User, error) { - dbUser := entity.NewUserFromModel(user) - - err := dbUser.Insert(ctx, gluesqlboiler.GetContextExecutor(ctx), boil.Infer()) - if err != nil { - return nil, grpcerror.DBInternalErr.Wrap(err) - } - - return dbUser.OutputModel(), nil -} - -// NewUser ... get user repository -func NewUser() repository.User { - return &user{} -} diff --git a/internal/default-grpc/usecase/input/.gitkeep b/internal/default-grpc/usecase/input/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default-grpc/usecase/mock/error_message.go b/internal/default-grpc/usecase/mock/error_message.go deleted file mode 100644 index 40a94fa99..000000000 --- a/internal/default-grpc/usecase/mock/error_message.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default-grpc/usecase/error_message.go - -// Package mock_usecase is a generated GoMock package. -package mock_usecase diff --git a/internal/default-grpc/usecase/mock/user.go b/internal/default-grpc/usecase/mock/user.go deleted file mode 100644 index 9be6bf73c..000000000 --- a/internal/default-grpc/usecase/mock/user.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default-grpc/usecase/user.go - -// Package mock_usecase is a generated GoMock package. -package mock_usecase - -import ( - context "context" - reflect "reflect" - - model "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - gomock "github.com/golang/mock/gomock" -) - -// MockUser is a mock of User interface -type MockUser struct { - ctrl *gomock.Controller - recorder *MockUserMockRecorder -} - -// MockUserMockRecorder is the mock recorder for MockUser -type MockUserMockRecorder struct { - mock *MockUser -} - -// NewMockUser creates a new mock instance -func NewMockUser(ctrl *gomock.Controller) *MockUser { - mock := &MockUser{ctrl: ctrl} - mock.recorder = &MockUserMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockUser) EXPECT() *MockUserMockRecorder { - return m.recorder -} - -// Get mocks base method -func (m *MockUser) Get(ctx context.Context, userID string) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, userID) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get -func (mr *MockUserMockRecorder) Get(ctx, userID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUser)(nil).Get), ctx, userID) -} diff --git a/internal/default-grpc/usecase/output/.gitkeep b/internal/default-grpc/usecase/output/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default-grpc/usecase/test/test_suit_test.go b/internal/default-grpc/usecase/test/test_suit_test.go deleted file mode 100644 index 43e41e4a3..000000000 --- a/internal/default-grpc/usecase/test/test_suit_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package test - -import ( - "database/sql" - "testing" - - "github.com/abyssparanoia/rapid-go/internal/testutil" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var testDB *sql.DB - -var _ = BeforeSuite(func() { - testDB = testutil.PrepareDefaultTestDB() -}) - -var _ = AfterSuite(func() { - testDB.Close() -}) - -var _ = AfterEach(func() { - testutil.TruncatDefaultTestDB(testDB) -}) - -func TestTest(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Usecase Test Suite") -} diff --git a/internal/default-grpc/usecase/test/user_impl_test.go b/internal/default-grpc/usecase/test/user_impl_test.go deleted file mode 100644 index 826e4ea53..000000000 --- a/internal/default-grpc/usecase/test/user_impl_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package test - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model/testdata" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/repository" - repository_impl "github.com/abyssparanoia/rapid-go/internal/default-grpc/infrastructure/repository" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/usecase" - "github.com/abyssparanoia/rapid-go/internal/testutil" - "github.com/golang/mock/gomock" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("User", func() { - - var ctx context.Context - var mockCtrl *gomock.Controller - var userRepository repository.User - - BeforeEach(func() { - mockCtrl = gomock.NewController(GinkgoT()) - }) - - AfterEach(func() { - mockCtrl.Finish() - }) - - var _ = Describe("Get", func() { - - var user *model.User - - var prepareData = func() { - ctx = testutil.Context() - td := testdata.NewDomainModel() - user = td.User - } - - var prepareRepositories = func() { - userRepository = repository_impl.NewUser() - _, err := userRepository.Create(ctx, user) - Expect(err).To(BeNil()) - } - - BeforeEach(func() { - prepareData() - prepareRepositories() - }) - - var subject = func() usecase.User { - return usecase.NewUser(userRepository) - } - - It("success: get correct user data", func() { - out, err := subject().Get(ctx, user.ID) - Expect(err).To(BeNil()) - Expect(out.DisplayName).To(Equal(user.DisplayName)) - Expect(out.Email).To(Equal(user.Email)) - }) - }) - -}) diff --git a/internal/default-grpc/usecase/user.go b/internal/default-grpc/usecase/user.go deleted file mode 100644 index 7f380a9dc..000000000 --- a/internal/default-grpc/usecase/user.go +++ /dev/null @@ -1,12 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" -) - -// User ... inteface of User usecase -type User interface { - Get(ctx context.Context, userID string) (*model.User, error) -} diff --git a/internal/default-grpc/usecase/user_impl.go b/internal/default-grpc/usecase/user_impl.go deleted file mode 100644 index 68da00d23..000000000 --- a/internal/default-grpc/usecase/user_impl.go +++ /dev/null @@ -1,26 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/repository" -) - -type user struct { - userRepo repository.User -} - -func (s *user) Get(ctx context.Context, userID string) (*model.User, error) { - user, err := s.userRepo.Get(ctx, userID, true) - if err != nil { - return nil, err - } - - return user, nil -} - -// NewUser ... get User usecase -func NewUser(userRepo repository.User) User { - return &user{userRepo} -} diff --git a/internal/default/config/const.go b/internal/default/config/const.go deleted file mode 100644 index 695bdec09..000000000 --- a/internal/default/config/const.go +++ /dev/null @@ -1,8 +0,0 @@ -package config - -import "time" - -const ( - // HTTPRequestTimeout ... timeout for http request - HTTPRequestTimeout time.Duration = 20 -) diff --git a/internal/default/config/env.go b/internal/default/config/env.go deleted file mode 100644 index 5ce5e15ac..000000000 --- a/internal/default/config/env.go +++ /dev/null @@ -1,20 +0,0 @@ -package config - -import ( - "os" -) - -// IsEnvDeveloping ... development -func IsEnvDeveloping() bool { - return os.Getenv("ENV") == "develop" -} - -// IsEnvStaging ... staging -func IsEnvStaging() bool { - return os.Getenv("ENV") == "staging" -} - -// IsEnvProduction ... production -func IsEnvProduction() bool { - return os.Getenv("ENV") == "production" -} diff --git a/internal/default/domain/model/testdata/test_data.go b/internal/default/domain/model/testdata/test_data.go deleted file mode 100644 index d4873ba78..000000000 --- a/internal/default/domain/model/testdata/test_data.go +++ /dev/null @@ -1,28 +0,0 @@ -package testdata - -import ( - "time" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/bxcodec/faker" -) - -// NewDomainModel : -func NewDomainModel() *struct { - User *model.User -} { - - user := &model.User{} - if err := faker.FakeData(user); err != nil { - panic(err) - } - - user.CreatedAt = time.Time{} - user.UpdatedAt = time.Time{} - - return &struct { - User *model.User - }{ - User: user, - } -} diff --git a/internal/default/domain/model/user.go b/internal/default/domain/model/user.go deleted file mode 100644 index 507565e21..000000000 --- a/internal/default/domain/model/user.go +++ /dev/null @@ -1,41 +0,0 @@ -package model - -import "time" - -// User ... user model -type User struct { - ID string `json:"id"` - DisplayName string `json:"display_name"` - IconImagePath string `json:"icon_image_path"` - BackgroundImagePath string `json:"background_image_path"` - Profile *string `json:"profile"` - Email *string `json:"email"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` -} - -// Exist ... check exist or not -func (user *User) Exist() bool { - return user != nil -} - -func NewUser( - id, - displayName, - iconImagePath, - backgroundImagePath, - profile, - email string, -) *User { - - return &User{ - ID: id, - DisplayName: displayName, - IconImagePath: iconImagePath, - BackgroundImagePath: backgroundImagePath, - Profile: &profile, - Email: &email, - CreatedAt: time.Time{}, - UpdatedAt: time.Time{}, - } -} diff --git a/internal/default/domain/repository/mock/user.go b/internal/default/domain/repository/mock/user.go deleted file mode 100644 index cfa3bdcb3..000000000 --- a/internal/default/domain/repository/mock/user.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default/domain/repository/user.go - -// Package mock_repository is a generated GoMock package. -package mock_repository - -import ( - context "context" - reflect "reflect" - - model "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - gomock "github.com/golang/mock/gomock" -) - -// MockUser is a mock of User interface -type MockUser struct { - ctrl *gomock.Controller - recorder *MockUserMockRecorder -} - -// MockUserMockRecorder is the mock recorder for MockUser -type MockUserMockRecorder struct { - mock *MockUser -} - -// NewMockUser creates a new mock instance -func NewMockUser(ctrl *gomock.Controller) *MockUser { - mock := &MockUser{ctrl: ctrl} - mock.recorder = &MockUserMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockUser) EXPECT() *MockUserMockRecorder { - return m.recorder -} - -// Get mocks base method -func (m *MockUser) Get(ctx context.Context, userID string) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, userID) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get -func (mr *MockUserMockRecorder) Get(ctx, userID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUser)(nil).Get), ctx, userID) -} - -// Create mocks base method -func (m *MockUser) Create(ctx context.Context, user *model.User) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", ctx, user) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Create indicates an expected call of Create -func (mr *MockUserMockRecorder) Create(ctx, user interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUser)(nil).Create), ctx, user) -} diff --git a/internal/default/domain/repository/user.go b/internal/default/domain/repository/user.go deleted file mode 100644 index eb17156c1..000000000 --- a/internal/default/domain/repository/user.go +++ /dev/null @@ -1,19 +0,0 @@ -package repository - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" -) - -// User ... user interface -type User interface { - Get( - ctx context.Context, - userID string, - ) (*model.User, error) - Create( - ctx context.Context, - user *model.User, - ) (*model.User, error) -} diff --git a/internal/default/domain/service/.gitkeep b/internal/default/domain/service/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default/handler/api/user.go b/internal/default/handler/api/user.go deleted file mode 100644 index cbe19e2fe..000000000 --- a/internal/default/handler/api/user.go +++ /dev/null @@ -1,51 +0,0 @@ -package api - -import ( - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default/usecase" - "github.com/abyssparanoia/rapid-go/internal/pkg/parameter" - "github.com/abyssparanoia/rapid-go/internal/pkg/renderer" - validator "github.com/go-playground/validator" -) - -// UserHandler ... user handler -type UserHandler struct { - userUsecase usecase.User -} - -type userHandlerGetRequestParam struct { - UserID string `validate:"required"` -} - -type userHandlerGetResponse struct { - User *model.User `json:"user"` -} - -// Get ... get user -func (h *UserHandler) Get(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - var param userHandlerGetRequestParam - param.UserID = parameter.GetURL(r, "userID") - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - user, err := h.userUsecase.Get(ctx, param.UserID) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.JSON(ctx, w, http.StatusOK, userHandlerGetResponse{User: user}) -} - -// NewUserHandler ... get user handler -func NewUserHandler(userUsecase usecase.User) *UserHandler { - return &UserHandler{userUsecase} -} diff --git a/internal/default/handler/empty.go b/internal/default/handler/empty.go deleted file mode 100644 index 7e0625bf9..000000000 --- a/internal/default/handler/empty.go +++ /dev/null @@ -1,7 +0,0 @@ -package handler - -import "net/http" - -// Empty ... empty handler -func Empty(w http.ResponseWriter, r *http.Request) { -} diff --git a/internal/default/handler/ping.go b/internal/default/handler/ping.go deleted file mode 100644 index 27485212f..000000000 --- a/internal/default/handler/ping.go +++ /dev/null @@ -1,11 +0,0 @@ -package handler - -import ( - "net/http" -) - -// Ping ... confirmation survival -func Ping(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.Write([]byte("pongpong")) -} diff --git a/internal/default/infrastructure/entity/user.go b/internal/default/infrastructure/entity/user.go deleted file mode 100644 index 214d64fa1..000000000 --- a/internal/default/infrastructure/entity/user.go +++ /dev/null @@ -1,51 +0,0 @@ -package entity - -import ( - "github.com/abyssparanoia/rapid-go/internal/dbmodels/defaultdb" - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/volatiletech/null" -) - -// User ... user entity -type User struct { - defaultdb.User -} - -// OutputModel ... output model from entity -func (e *User) OutputModel() *model.User { - return &model.User{ - ID: e.ID, - DisplayName: e.DisplayName, - IconImagePath: e.IconImagePath, - BackgroundImagePath: e.BackgroundImagePath, - Profile: e.Profile.Ptr(), - Email: e.Email.Ptr(), - CreatedAt: e.CreatedAt, - UpdatedAt: e.UpdatedAt, - } -} - -// NewUserFromModel ... new user from model -func NewUserFromModel(m *model.User) *User { - e := &User{} - e.ID = m.ID - e.DisplayName = m.DisplayName - e.IconImagePath = m.IconImagePath - e.BackgroundImagePath = m.BackgroundImagePath - e.Profile = null.StringFromPtr(m.Profile) - e.Email = null.StringFromPtr(m.Email) - e.CreatedAt = m.CreatedAt - e.UpdatedAt = m.UpdatedAt - return e -} - -// OutputUsers ... output multi user models from entities -func OutputUsers(dsts []*User) []*model.User { - - users := []*model.User{} - for _, dst := range dsts { - users = append(users, dst.OutputModel()) - } - - return users -} diff --git a/internal/default/infrastructure/repository/user_impl.go b/internal/default/infrastructure/repository/user_impl.go deleted file mode 100644 index 4084027d4..000000000 --- a/internal/default/infrastructure/repository/user_impl.go +++ /dev/null @@ -1,54 +0,0 @@ -package repository - -import ( - "context" - "database/sql" - - "github.com/volatiletech/sqlboiler/boil" - - "github.com/abyssparanoia/rapid-go/internal/dbmodels/defaultdb" - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default/domain/repository" - "github.com/abyssparanoia/rapid-go/internal/default/infrastructure/entity" - "github.com/abyssparanoia/rapid-go/internal/pkg/error/httperror" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluesqlboiler" -) - -type user struct { -} - -func (r *user) Get(ctx context.Context, userID string) (*model.User, error) { - - dbUser, err := defaultdb.Users( - defaultdb.UserWhere.ID.EQ(userID), - ).One(ctx, gluesqlboiler.GetContextExecutor(ctx)) - - if err != nil { - if err == sql.ErrNoRows { - return nil, httperror.UserNotFoundErr.New() - } - return nil, err - } - - user := entity.User{User: *dbUser} - return user.OutputModel(), nil -} - -func (r *user) Create( - ctx context.Context, - user *model.User, -) (*model.User, error) { - dbUser := entity.NewUserFromModel(user) - - err := dbUser.Insert(ctx, gluesqlboiler.GetContextExecutor(ctx), boil.Infer()) - if err != nil { - return nil, err - } - - return dbUser.OutputModel(), nil -} - -// NewUser ... get user repository -func NewUser() repository.User { - return &user{} -} diff --git a/internal/default/usecase/input/.gitkeep b/internal/default/usecase/input/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default/usecase/mock/error_message.go b/internal/default/usecase/mock/error_message.go deleted file mode 100644 index 6f4cae87c..000000000 --- a/internal/default/usecase/mock/error_message.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default/usecase/error_message.go - -// Package mock_usecase is a generated GoMock package. -package mock_usecase diff --git a/internal/default/usecase/mock/user.go b/internal/default/usecase/mock/user.go deleted file mode 100644 index 091e1c707..000000000 --- a/internal/default/usecase/mock/user.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./internal/default/usecase/user.go - -// Package mock_usecase is a generated GoMock package. -package mock_usecase - -import ( - context "context" - reflect "reflect" - - model "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - gomock "github.com/golang/mock/gomock" -) - -// MockUser is a mock of User interface -type MockUser struct { - ctrl *gomock.Controller - recorder *MockUserMockRecorder -} - -// MockUserMockRecorder is the mock recorder for MockUser -type MockUserMockRecorder struct { - mock *MockUser -} - -// NewMockUser creates a new mock instance -func NewMockUser(ctrl *gomock.Controller) *MockUser { - mock := &MockUser{ctrl: ctrl} - mock.recorder = &MockUserMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockUser) EXPECT() *MockUserMockRecorder { - return m.recorder -} - -// Get mocks base method -func (m *MockUser) Get(ctx context.Context, userID string) (*model.User, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, userID) - ret0, _ := ret[0].(*model.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get -func (mr *MockUserMockRecorder) Get(ctx, userID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUser)(nil).Get), ctx, userID) -} diff --git a/internal/default/usecase/output/.gitkeep b/internal/default/usecase/output/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/default/usecase/test/test_suit_test.go b/internal/default/usecase/test/test_suit_test.go deleted file mode 100644 index 43e41e4a3..000000000 --- a/internal/default/usecase/test/test_suit_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package test - -import ( - "database/sql" - "testing" - - "github.com/abyssparanoia/rapid-go/internal/testutil" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var testDB *sql.DB - -var _ = BeforeSuite(func() { - testDB = testutil.PrepareDefaultTestDB() -}) - -var _ = AfterSuite(func() { - testDB.Close() -}) - -var _ = AfterEach(func() { - testutil.TruncatDefaultTestDB(testDB) -}) - -func TestTest(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Usecase Test Suite") -} diff --git a/internal/default/usecase/test/user_impl_test.go b/internal/default/usecase/test/user_impl_test.go deleted file mode 100644 index bbf41e109..000000000 --- a/internal/default/usecase/test/user_impl_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package test - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default/domain/model/testdata" - "github.com/abyssparanoia/rapid-go/internal/default/domain/repository" - repository_impl "github.com/abyssparanoia/rapid-go/internal/default/infrastructure/repository" - "github.com/abyssparanoia/rapid-go/internal/default/usecase" - "github.com/abyssparanoia/rapid-go/internal/testutil" - "github.com/golang/mock/gomock" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("User", func() { - - var ctx context.Context - var mockCtrl *gomock.Controller - var userRepository repository.User - - BeforeEach(func() { - mockCtrl = gomock.NewController(GinkgoT()) - }) - - AfterEach(func() { - mockCtrl.Finish() - }) - - var _ = Describe("Get", func() { - - var user *model.User - - var prepareData = func() { - ctx = testutil.Context() - td := testdata.NewDomainModel() - user = td.User - } - - var prepareRepositories = func() { - userRepository = repository_impl.NewUser() - _, err := userRepository.Create(ctx, user) - Expect(err).To(BeNil()) - } - - BeforeEach(func() { - prepareData() - prepareRepositories() - }) - - var subject = func() usecase.User { - return usecase.NewUser(userRepository) - } - - It("success: get correct user data", func() { - out, err := subject().Get(ctx, user.ID) - Expect(err).To(BeNil()) - Expect(out.DisplayName).To(Equal(user.DisplayName)) - Expect(out.Email).To(Equal(user.Email)) - }) - }) - -}) diff --git a/internal/default/usecase/user.go b/internal/default/usecase/user.go deleted file mode 100644 index 2a16aaee3..000000000 --- a/internal/default/usecase/user.go +++ /dev/null @@ -1,12 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" -) - -// User ... inteface of User usecase -type User interface { - Get(ctx context.Context, userID string) (*model.User, error) -} diff --git a/internal/default/usecase/user_impl.go b/internal/default/usecase/user_impl.go deleted file mode 100644 index b34cb45ae..000000000 --- a/internal/default/usecase/user_impl.go +++ /dev/null @@ -1,26 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/default/domain/model" - "github.com/abyssparanoia/rapid-go/internal/default/domain/repository" -) - -type user struct { - userRepo repository.User -} - -func (s *user) Get(ctx context.Context, userID string) (*model.User, error) { - user, err := s.userRepo.Get(ctx, userID) - if err != nil { - return nil, err - } - - return user, nil -} - -// NewUser ... get User usecase -func NewUser(userRepo repository.User) User { - return &user{userRepo} -} diff --git a/internal/domain/model/claims.go b/internal/domain/model/claims.go new file mode 100644 index 000000000..c724682ee --- /dev/null +++ b/internal/domain/model/claims.go @@ -0,0 +1,30 @@ +package model + +import "github.com/volatiletech/null/v8" + +type Claims struct { + AuthUID string + TenantID null.String + UserID null.String + UserRole UserRole +} + +func NewClaims( + authUID string, +) *Claims { + return &Claims{ + AuthUID: authUID, + } +} + +func (m *Claims) SetTenantID(tenantID string) { + m.TenantID = null.StringFrom(tenantID) +} + +func (m *Claims) SetUserID(userID string) { + m.UserID = null.StringFrom(userID) +} + +func (m *Claims) SetUserRole(userRole UserRole) { + m.UserRole = userRole +} diff --git a/internal/domain/model/factory/factory.go b/internal/domain/model/factory/factory.go new file mode 100644 index 000000000..060d411ec --- /dev/null +++ b/internal/domain/model/factory/factory.go @@ -0,0 +1,25 @@ +package factory + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/pkg/now" + "github.com/bxcodec/faker" +) + +func NewFactory() struct { + Tenant *model.Tenant +} { + n := now.Now() + + tenant := &model.Tenant{} + if err := faker.FakeData(tenant); err != nil { + panic(err) + } + + tenant.CreatedAt = n + tenant.UpdatedAt = n + + return struct{ Tenant *model.Tenant }{ + Tenant: tenant, + } +} diff --git a/internal/domain/model/pagination.go b/internal/domain/model/pagination.go new file mode 100644 index 000000000..0dc5457cb --- /dev/null +++ b/internal/domain/model/pagination.go @@ -0,0 +1,39 @@ +package model + +import "math" + +type Pagination struct { + CurrentPage uint64 + PrevPage uint64 + NextPage uint64 + TotalPage uint64 + TotalCount uint64 + HasNext bool +} + +func NewPagination( + page uint64, + limit uint64, + totalCount uint64, +) *Pagination { + pagination := &Pagination{ + TotalCount: totalCount, + } + + if page <= 0 { + pagination.CurrentPage = 1 + pagination.TotalPage = 1 + pagination.HasNext = false + } else { + pagination.CurrentPage = page + pagination.PrevPage = page - 1 + pagination.TotalPage = uint64(math.Ceil(float64(totalCount) / float64(limit))) + pagination.HasNext = page*limit < totalCount + + if page < pagination.TotalPage { + pagination.NextPage = page + 1 + } + } + + return pagination +} diff --git a/internal/domain/model/tenant.go b/internal/domain/model/tenant.go new file mode 100644 index 000000000..0c055fef9 --- /dev/null +++ b/internal/domain/model/tenant.go @@ -0,0 +1,38 @@ +package model + +import ( + "time" + + "github.com/abyssparanoia/rapid-go/internal/pkg/ulid" + "github.com/volatiletech/null/v8" +) + +type Tenant struct { + ID string + Name string + CreatedAt time.Time + UpdatedAt time.Time +} + +func NewTenant( + name string, + t time.Time, +) *Tenant { + return &Tenant{ + ID: ulid.New(), + Name: name, + CreatedAt: t, + UpdatedAt: t, + } +} + +func (m *Tenant) Update( + name null.String, + t time.Time, +) { + if name.Valid { + m.Name = name.String + } + + m.UpdatedAt = t +} diff --git a/internal/domain/model/user.go b/internal/domain/model/user.go new file mode 100644 index 000000000..e394b9e41 --- /dev/null +++ b/internal/domain/model/user.go @@ -0,0 +1,47 @@ +package model + +import ( + "time" + + "github.com/abyssparanoia/rapid-go/internal/pkg/ulid" +) + +type User struct { + ID string + Tenant *Tenant + Role UserRole + AuthUID string + DisplayName string + ImagePath string + Email string + CreatedAt time.Time + UpdatedAt time.Time +} + +func NewUser( + tenantID string, + role UserRole, + authUID string, + displayName string, + imagePath string, + email string, + t time.Time, +) *User { + return &User{ + ID: ulid.New(), + Tenant: &Tenant{ + ID: tenantID, + }, + Role: role, + AuthUID: authUID, + DisplayName: displayName, + ImagePath: imagePath, + Email: email, + CreatedAt: t, + UpdatedAt: t, + } +} + +func (m *User) Exist() bool { + return m != nil +} diff --git a/internal/domain/model/user_role.go b/internal/domain/model/user_role.go new file mode 100644 index 000000000..89d487149 --- /dev/null +++ b/internal/domain/model/user_role.go @@ -0,0 +1,31 @@ +package model + +type UserRole string + +const ( + UserRoleUnknown UserRole = "unknown" + UserRoleNormal UserRole = "normal" + UserRoleAdmin UserRole = "admin" +) + +func NewUserRole(role string) UserRole { + switch role { + case UserRoleNormal.String(), + UserRoleAdmin.String(): + return UserRole(role) + default: + return UserRoleUnknown + } +} + +func (m UserRole) String() string { + return string(m) +} + +func (m UserRole) IsAdmin() bool { + return m == UserRoleAdmin +} + +func (m UserRole) Valid() bool { + return m != UserRoleUnknown && m != "" +} diff --git a/internal/domain/repository/authentication.go b/internal/domain/repository/authentication.go new file mode 100644 index 000000000..45139d75a --- /dev/null +++ b/internal/domain/repository/authentication.go @@ -0,0 +1,43 @@ +package repository + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/volatiletech/null/v8" +) + +type Authentication interface { + VerifyIDToken( + ctx context.Context, + idToken string, + ) (*model.Claims, error) + GetUserByEmail( + ctx context.Context, + email string, + ) (*AuthenticationGetUserByEmailResult, error) + CreateUser( + ctx context.Context, + param AuthenticationCreateUserParam, + ) (string, error) + StoreClaims( + ctx context.Context, + authUID string, + claims *model.Claims, + ) error + CreateCustomToken( + ctx context.Context, + authUID string, + ) (string, error) +} + +type AuthenticationCreateUserParam struct { + Email string + Password null.String +} + +type AuthenticationGetUserByEmailResult struct { + AuthUID string + Claims *model.Claims + Exist bool +} diff --git a/internal/domain/repository/mock/tenant.go b/internal/domain/repository/mock/tenant.go new file mode 100644 index 000000000..b2316a76d --- /dev/null +++ b/internal/domain/repository/mock/tenant.go @@ -0,0 +1,126 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: tenant.go + +// Package mock_repository is a generated GoMock package. +package mock_repository + +import ( + context "context" + reflect "reflect" + + model "github.com/abyssparanoia/rapid-go/internal/domain/model" + repository "github.com/abyssparanoia/rapid-go/internal/domain/repository" + gomock "github.com/golang/mock/gomock" +) + +// MockTenant is a mock of Tenant interface. +type MockTenant struct { + ctrl *gomock.Controller + recorder *MockTenantMockRecorder +} + +// MockTenantMockRecorder is the mock recorder for MockTenant. +type MockTenantMockRecorder struct { + mock *MockTenant +} + +// NewMockTenant creates a new mock instance. +func NewMockTenant(ctrl *gomock.Controller) *MockTenant { + mock := &MockTenant{ctrl: ctrl} + mock.recorder = &MockTenantMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTenant) EXPECT() *MockTenantMockRecorder { + return m.recorder +} + +// Count mocks base method. +func (m *MockTenant) Count(ctx context.Context, query repository.CountTenantsQuery) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Count", ctx, query) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Count indicates an expected call of Count. +func (mr *MockTenantMockRecorder) Count(ctx, query interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockTenant)(nil).Count), ctx, query) +} + +// Create mocks base method. +func (m *MockTenant) Create(ctx context.Context, tenant *model.Tenant) (*model.Tenant, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Create", ctx, tenant) + ret0, _ := ret[0].(*model.Tenant) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Create indicates an expected call of Create. +func (mr *MockTenantMockRecorder) Create(ctx, tenant interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockTenant)(nil).Create), ctx, tenant) +} + +// Delete mocks base method. +func (m *MockTenant) Delete(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// Delete indicates an expected call of Delete. +func (mr *MockTenantMockRecorder) Delete(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTenant)(nil).Delete), ctx, id) +} + +// Get mocks base method. +func (m *MockTenant) Get(ctx context.Context, id string, orFail bool) (*model.Tenant, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", ctx, id, orFail) + ret0, _ := ret[0].(*model.Tenant) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockTenantMockRecorder) Get(ctx, id, orFail interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockTenant)(nil).Get), ctx, id, orFail) +} + +// List mocks base method. +func (m *MockTenant) List(ctx context.Context, query repository.ListTenantsQuery) ([]*model.Tenant, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "List", ctx, query) + ret0, _ := ret[0].([]*model.Tenant) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// List indicates an expected call of List. +func (mr *MockTenantMockRecorder) List(ctx, query interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockTenant)(nil).List), ctx, query) +} + +// Update mocks base method. +func (m *MockTenant) Update(ctx context.Context, tenant *model.Tenant) (*model.Tenant, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Update", ctx, tenant) + ret0, _ := ret[0].(*model.Tenant) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Update indicates an expected call of Update. +func (mr *MockTenantMockRecorder) Update(ctx, tenant interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockTenant)(nil).Update), ctx, tenant) +} diff --git a/internal/domain/repository/mock/transactable.go b/internal/domain/repository/mock/transactable.go new file mode 100644 index 000000000..01f672126 --- /dev/null +++ b/internal/domain/repository/mock/transactable.go @@ -0,0 +1,49 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: transactable.go + +// Package mock_repository is a generated GoMock package. +package mock_repository + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" +) + +// MockTransactable is a mock of Transactable interface. +type MockTransactable struct { + ctrl *gomock.Controller + recorder *MockTransactableMockRecorder +} + +// MockTransactableMockRecorder is the mock recorder for MockTransactable. +type MockTransactableMockRecorder struct { + mock *MockTransactable +} + +// NewMockTransactable creates a new mock instance. +func NewMockTransactable(ctrl *gomock.Controller) *MockTransactable { + mock := &MockTransactable{ctrl: ctrl} + mock.recorder = &MockTransactableMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTransactable) EXPECT() *MockTransactableMockRecorder { + return m.recorder +} + +// RWTx mocks base method. +func (m *MockTransactable) RWTx(ctx context.Context, fn func(context.Context) error) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RWTx", ctx, fn) + ret0, _ := ret[0].(error) + return ret0 +} + +// RWTx indicates an expected call of RWTx. +func (mr *MockTransactableMockRecorder) RWTx(ctx, fn interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RWTx", reflect.TypeOf((*MockTransactable)(nil).RWTx), ctx, fn) +} diff --git a/internal/domain/repository/mock/transactable_util.go b/internal/domain/repository/mock/transactable_util.go new file mode 100644 index 000000000..3ed41c5a3 --- /dev/null +++ b/internal/domain/repository/mock/transactable_util.go @@ -0,0 +1,17 @@ +package mock_repository + +import ( + context "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/repository" +) + +type mockTx struct{} + +func (mock *mockTx) RWTx(ctx context.Context, fn func(ctx context.Context) error) error { + return fn(ctx) +} + +func TestMockTransactable() repository.Transactable { + return &mockTx{} +} diff --git a/internal/domain/repository/tenant.go b/internal/domain/repository/tenant.go new file mode 100644 index 000000000..9b0c3ea69 --- /dev/null +++ b/internal/domain/repository/tenant.go @@ -0,0 +1,46 @@ +package repository + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/volatiletech/null/v8" +) + +//go:generate mockgen -source=$GOFILE -destination=mock/$GOFILE -package=mock_repository +type Tenant interface { + Get( + ctx context.Context, + id string, + orFail bool, + ) (*model.Tenant, error) + List( + ctx context.Context, + query ListTenantsQuery, + ) ([]*model.Tenant, error) + Count( + ctx context.Context, + query CountTenantsQuery, + ) (uint64, error) + Create( + ctx context.Context, + tenant *model.Tenant, + ) (*model.Tenant, error) + Update( + ctx context.Context, + tenant *model.Tenant, + ) (*model.Tenant, error) + Delete( + ctx context.Context, + id string, + ) error +} + +type ListTenantsQuery struct { + Page null.Uint64 + Limit null.Uint64 + CountTenantsQuery +} + +type CountTenantsQuery struct { +} diff --git a/internal/domain/repository/transactable.go b/internal/domain/repository/transactable.go new file mode 100644 index 000000000..d54172b4d --- /dev/null +++ b/internal/domain/repository/transactable.go @@ -0,0 +1,8 @@ +package repository + +import "context" + +//go:generate mockgen -source=$GOFILE -destination=mock/$GOFILE -package=mock_repository +type Transactable interface { + RWTx(ctx context.Context, fn func(ctx context.Context) error) error +} diff --git a/internal/default-grpc/domain/repository/user.go b/internal/domain/repository/user.go similarity index 50% rename from internal/default-grpc/domain/repository/user.go rename to internal/domain/repository/user.go index 16c99a516..0141b69d4 100644 --- a/internal/default-grpc/domain/repository/user.go +++ b/internal/domain/repository/user.go @@ -3,18 +3,24 @@ package repository import ( "context" - "github.com/abyssparanoia/rapid-go/internal/default-grpc/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/volatiletech/null/v8" ) -// User ... user interface type User interface { Get( ctx context.Context, - userID string, + query GetUserQuery, orFail bool, + preload bool, ) (*model.User, error) Create( ctx context.Context, user *model.User, ) (*model.User, error) } + +type GetUserQuery struct { + ID null.String + AuthUID null.String +} diff --git a/internal/infrastructure/cmd/internal/http_server_cmd/cmd.go b/internal/infrastructure/cmd/internal/http_server_cmd/cmd.go new file mode 100644 index 000000000..86d2164a6 --- /dev/null +++ b/internal/infrastructure/cmd/internal/http_server_cmd/cmd.go @@ -0,0 +1,26 @@ +package http_server_cmd + +import ( + "github.com/abyssparanoia/rapid-go/internal/infrastructure/http" + "github.com/spf13/cobra" +) + +func NewHTTPServerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "http-server", + Short: "cli http server", + Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + cmd.HelpFunc()(cmd, args) + } + }, + } + cmd.AddCommand(&cobra.Command{ + Use: "run", + Short: "running http server", + Run: func(cmd *cobra.Command, args []string) { + http.Run() + }, + }) + return cmd +} diff --git a/internal/infrastructure/cmd/internal/task_cmd/cmd.go b/internal/infrastructure/cmd/internal/task_cmd/cmd.go new file mode 100644 index 000000000..26e4b1886 --- /dev/null +++ b/internal/infrastructure/cmd/internal/task_cmd/cmd.go @@ -0,0 +1,20 @@ +package task_cmd + +import ( + "github.com/abyssparanoia/rapid-go/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd" + "github.com/spf13/cobra" +) + +func NewTaskCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "task", + Short: "cli task", + Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + cmd.HelpFunc()(cmd, args) + } + }, + } + cmd.AddCommand(create_root_user_cmd.NewCreateRootUserCmd()) + return cmd +} diff --git a/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/cmd.go b/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/cmd.go new file mode 100644 index 000000000..2261b72fa --- /dev/null +++ b/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/cmd.go @@ -0,0 +1,44 @@ +package create_root_user_cmd + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/dependency" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/environment" + "github.com/abyssparanoia/rapid-go/internal/pkg/logger" + "github.com/caarlos0/env/v6" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "github.com/spf13/cobra" +) + +func NewCreateRootUserCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-root-user", + Short: "create root user", + Run: func(cmd *cobra.Command, args []string) { + ctx := context.Background() + + e := &environment.Environment{} + if err := env.Parse(e); err != nil { + panic(err) + } + + logger := logger.New() + ctx = ctxzap.ToContext(ctx, logger) + + d := &dependency.Dependency{} + d.Inject(ctx, e) + + c := &CMD{ + ctx, + d.UserInteractor, + } + if err := c.CreateRootUser(cmd); err != nil { + panic(err) + } + }, + } + cmd.Flags().StringP("email", "e", "", "email address") + cmd.Flags().StringP("password", "p", "", "password") + return cmd +} diff --git a/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/create_root_user.go b/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/create_root_user.go new file mode 100644 index 000000000..57978132b --- /dev/null +++ b/internal/infrastructure/cmd/internal/task_cmd/create_root_user_cmd/create_root_user.go @@ -0,0 +1,47 @@ +package create_root_user_cmd + +import ( + "context" + "errors" + + "github.com/abyssparanoia/rapid-go/internal/pkg/now" + "github.com/abyssparanoia/rapid-go/internal/usecase" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/spf13/cobra" +) + +type CMD struct { + ctx context.Context + userInteractor usecase.UserInteractor +} + +func (c *CMD) CreateRootUser(cmd *cobra.Command) error { + email, err := cmd.Flags().GetString("email") + if err != nil { + return err + } + if email == "" { + return errors.New("email is required") + } + + password, err := cmd.Flags().GetString("password") + if err != nil { + return err + } + if password == "" { + return errors.New("password is required") + } + + if err := c.userInteractor.CreateRoot( + c.ctx, + input.NewCreateRootUser( + email, + password, + now.Now(), + ), + ); err != nil { + return err + } + + return nil +} diff --git a/internal/infrastructure/cmd/root.go b/internal/infrastructure/cmd/root.go new file mode 100644 index 000000000..30030f4ab --- /dev/null +++ b/internal/infrastructure/cmd/root.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/abyssparanoia/rapid-go/internal/infrastructure/cmd/internal/http_server_cmd" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/cmd/internal/task_cmd" + "github.com/spf13/cobra" +) + +func NewCmdRoot() *cobra.Command { + cmd := &cobra.Command{ + Use: "app", + Short: "cli tool for app", + Long: "cli tool for app", + Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + cmd.HelpFunc()(cmd, args) + } + }, + } + cmd.AddCommand(http_server_cmd.NewHTTPServerCmd()) + cmd.AddCommand(task_cmd.NewTaskCmd()) + return cmd +} diff --git a/internal/pkg/gluemysql/client.go b/internal/infrastructure/database/client.go similarity index 85% rename from internal/pkg/gluemysql/client.go rename to internal/infrastructure/database/client.go index f97679c38..77b55c3db 100644 --- a/internal/pkg/gluemysql/client.go +++ b/internal/infrastructure/database/client.go @@ -1,4 +1,4 @@ -package gluemysql +package database import ( "database/sql" @@ -6,7 +6,7 @@ import ( "time" _ "github.com/go-sql-driver/mysql" - "github.com/volatiletech/sqlboiler/boil" + "github.com/volatiletech/sqlboiler/v4/boil" ) // Client ... client @@ -32,6 +32,7 @@ func NewClient( } boil.SetLocation(time.Local) boil.SetDB(db) + boil.DebugMode = true return &Client{ DB: db, } diff --git a/internal/dbmodels/defaultdb/boil_queries.go b/internal/infrastructure/database/internal/dbmodel/boil_queries.go similarity index 70% rename from internal/dbmodels/defaultdb/boil_queries.go rename to internal/infrastructure/database/internal/dbmodel/boil_queries.go index d9e251e27..3cfba008f 100644 --- a/internal/dbmodels/defaultdb/boil_queries.go +++ b/internal/infrastructure/database/internal/dbmodel/boil_queries.go @@ -1,12 +1,12 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. -package defaultdb +package dbmodel import ( - "github.com/volatiletech/sqlboiler/drivers" - "github.com/volatiletech/sqlboiler/queries" - "github.com/volatiletech/sqlboiler/queries/qm" + "github.com/volatiletech/sqlboiler/v4/drivers" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" ) var dialect = drivers.Dialect{ diff --git a/internal/infrastructure/database/internal/dbmodel/boil_table_names.go b/internal/infrastructure/database/internal/dbmodel/boil_table_names.go new file mode 100644 index 000000000..db4253077 --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/boil_table_names.go @@ -0,0 +1,16 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +var TableNames = struct { + GooseDBVersion string + Tenants string + UserRoles string + Users string +}{ + GooseDBVersion: "goose_db_version", + Tenants: "tenants", + UserRoles: "user_roles", + Users: "users", +} diff --git a/internal/dbmodels/defaultdb/boil_types.go b/internal/infrastructure/database/internal/dbmodel/boil_types.go similarity index 78% rename from internal/dbmodels/defaultdb/boil_types.go rename to internal/infrastructure/database/internal/dbmodel/boil_types.go index a8da0b6dc..18d7f91d2 100644 --- a/internal/dbmodels/defaultdb/boil_types.go +++ b/internal/infrastructure/database/internal/dbmodel/boil_types.go @@ -1,14 +1,14 @@ -// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. -package defaultdb +package dbmodel import ( "strconv" "github.com/friendsofgo/errors" - "github.com/volatiletech/sqlboiler/boil" - "github.com/volatiletech/sqlboiler/strmangle" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/strmangle" ) // M type is for providing columns and column values to UpdateAll. @@ -17,7 +17,7 @@ type M map[string]interface{} // ErrSyncFail occurs during insert when the record could not be retrieved in // order to populate default value information. This usually happens when LastInsertId // fails or there was a primary key configuration that was not resolvable. -var ErrSyncFail = errors.New("defaultdb: failed to synchronize data after insert") +var ErrSyncFail = errors.New("dbmodel: failed to synchronize data after insert") type insertCache struct { query string diff --git a/internal/infrastructure/database/internal/dbmodel/boil_view_names.go b/internal/infrastructure/database/internal/dbmodel/boil_view_names.go new file mode 100644 index 000000000..ae72fdbe2 --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/boil_view_names.go @@ -0,0 +1,7 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +var ViewNames = struct { +}{} diff --git a/internal/infrastructure/database/internal/dbmodel/goose_db_version.go b/internal/infrastructure/database/internal/dbmodel/goose_db_version.go new file mode 100644 index 000000000..369922730 --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/goose_db_version.go @@ -0,0 +1,1273 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// GooseDBVersion is an object representing the database table. +type GooseDBVersion struct { + ID uint64 `boil:"id" json:"id" toml:"id" yaml:"id"` + VersionID int64 `boil:"version_id" json:"version_id" toml:"version_id" yaml:"version_id"` + IsApplied bool `boil:"is_applied" json:"is_applied" toml:"is_applied" yaml:"is_applied"` + Tstamp null.Time `boil:"tstamp" json:"tstamp,omitempty" toml:"tstamp" yaml:"tstamp,omitempty"` + + R *gooseDBVersionR `boil:"-" json:"-" toml:"-" yaml:"-"` + L gooseDBVersionL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var GooseDBVersionColumns = struct { + ID string + VersionID string + IsApplied string + Tstamp string +}{ + ID: "id", + VersionID: "version_id", + IsApplied: "is_applied", + Tstamp: "tstamp", +} + +var GooseDBVersionTableColumns = struct { + ID string + VersionID string + IsApplied string + Tstamp string +}{ + ID: "goose_db_version.id", + VersionID: "goose_db_version.version_id", + IsApplied: "goose_db_version.is_applied", + Tstamp: "goose_db_version.tstamp", +} + +// Generated where + +type whereHelperuint64 struct{ field string } + +func (w whereHelperuint64) EQ(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperuint64) NEQ(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperuint64) LT(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperuint64) LTE(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperuint64) GT(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperuint64) GTE(x uint64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } +func (w whereHelperuint64) IN(slice []uint64) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) +} +func (w whereHelperuint64) NIN(slice []uint64) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...) +} + +type whereHelperint64 struct{ field string } + +func (w whereHelperint64) EQ(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperint64) NEQ(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperint64) LT(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperint64) LTE(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperint64) GT(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperint64) GTE(x int64) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } +func (w whereHelperint64) IN(slice []int64) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) +} +func (w whereHelperint64) NIN(slice []int64) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...) +} + +type whereHelperbool struct{ field string } + +func (w whereHelperbool) EQ(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperbool) NEQ(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperbool) LT(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperbool) LTE(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperbool) GT(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperbool) GTE(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } + +type whereHelpernull_Time struct{ field string } + +func (w whereHelpernull_Time) EQ(x null.Time) qm.QueryMod { + return qmhelper.WhereNullEQ(w.field, false, x) +} +func (w whereHelpernull_Time) NEQ(x null.Time) qm.QueryMod { + return qmhelper.WhereNullEQ(w.field, true, x) +} +func (w whereHelpernull_Time) LT(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LT, x) +} +func (w whereHelpernull_Time) LTE(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LTE, x) +} +func (w whereHelpernull_Time) GT(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GT, x) +} +func (w whereHelpernull_Time) GTE(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GTE, x) +} + +func (w whereHelpernull_Time) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) } +func (w whereHelpernull_Time) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) } + +var GooseDBVersionWhere = struct { + ID whereHelperuint64 + VersionID whereHelperint64 + IsApplied whereHelperbool + Tstamp whereHelpernull_Time +}{ + ID: whereHelperuint64{field: "`goose_db_version`.`id`"}, + VersionID: whereHelperint64{field: "`goose_db_version`.`version_id`"}, + IsApplied: whereHelperbool{field: "`goose_db_version`.`is_applied`"}, + Tstamp: whereHelpernull_Time{field: "`goose_db_version`.`tstamp`"}, +} + +// GooseDBVersionRels is where relationship names are stored. +var GooseDBVersionRels = struct { +}{} + +// gooseDBVersionR is where relationships are stored. +type gooseDBVersionR struct { +} + +// NewStruct creates a new relationship struct +func (*gooseDBVersionR) NewStruct() *gooseDBVersionR { + return &gooseDBVersionR{} +} + +// gooseDBVersionL is where Load methods for each relationship are stored. +type gooseDBVersionL struct{} + +var ( + gooseDBVersionAllColumns = []string{"id", "version_id", "is_applied", "tstamp"} + gooseDBVersionColumnsWithoutDefault = []string{"version_id", "is_applied"} + gooseDBVersionColumnsWithDefault = []string{"id", "tstamp"} + gooseDBVersionPrimaryKeyColumns = []string{"id"} + gooseDBVersionGeneratedColumns = []string{} +) + +type ( + // GooseDBVersionSlice is an alias for a slice of pointers to GooseDBVersion. + // This should almost always be used instead of []GooseDBVersion. + GooseDBVersionSlice []*GooseDBVersion + // GooseDBVersionHook is the signature for custom GooseDBVersion hook methods + GooseDBVersionHook func(context.Context, boil.ContextExecutor, *GooseDBVersion) error + + gooseDBVersionQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + gooseDBVersionType = reflect.TypeOf(&GooseDBVersion{}) + gooseDBVersionMapping = queries.MakeStructMapping(gooseDBVersionType) + gooseDBVersionPrimaryKeyMapping, _ = queries.BindMapping(gooseDBVersionType, gooseDBVersionMapping, gooseDBVersionPrimaryKeyColumns) + gooseDBVersionInsertCacheMut sync.RWMutex + gooseDBVersionInsertCache = make(map[string]insertCache) + gooseDBVersionUpdateCacheMut sync.RWMutex + gooseDBVersionUpdateCache = make(map[string]updateCache) + gooseDBVersionUpsertCacheMut sync.RWMutex + gooseDBVersionUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var gooseDBVersionAfterSelectHooks []GooseDBVersionHook + +var gooseDBVersionBeforeInsertHooks []GooseDBVersionHook +var gooseDBVersionAfterInsertHooks []GooseDBVersionHook + +var gooseDBVersionBeforeUpdateHooks []GooseDBVersionHook +var gooseDBVersionAfterUpdateHooks []GooseDBVersionHook + +var gooseDBVersionBeforeDeleteHooks []GooseDBVersionHook +var gooseDBVersionAfterDeleteHooks []GooseDBVersionHook + +var gooseDBVersionBeforeUpsertHooks []GooseDBVersionHook +var gooseDBVersionAfterUpsertHooks []GooseDBVersionHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *GooseDBVersion) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *GooseDBVersion) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *GooseDBVersion) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *GooseDBVersion) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *GooseDBVersion) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *GooseDBVersion) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *GooseDBVersion) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *GooseDBVersion) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *GooseDBVersion) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range gooseDBVersionAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddGooseDBVersionHook registers your hook function for all future operations. +func AddGooseDBVersionHook(hookPoint boil.HookPoint, gooseDBVersionHook GooseDBVersionHook) { + switch hookPoint { + case boil.AfterSelectHook: + gooseDBVersionAfterSelectHooks = append(gooseDBVersionAfterSelectHooks, gooseDBVersionHook) + case boil.BeforeInsertHook: + gooseDBVersionBeforeInsertHooks = append(gooseDBVersionBeforeInsertHooks, gooseDBVersionHook) + case boil.AfterInsertHook: + gooseDBVersionAfterInsertHooks = append(gooseDBVersionAfterInsertHooks, gooseDBVersionHook) + case boil.BeforeUpdateHook: + gooseDBVersionBeforeUpdateHooks = append(gooseDBVersionBeforeUpdateHooks, gooseDBVersionHook) + case boil.AfterUpdateHook: + gooseDBVersionAfterUpdateHooks = append(gooseDBVersionAfterUpdateHooks, gooseDBVersionHook) + case boil.BeforeDeleteHook: + gooseDBVersionBeforeDeleteHooks = append(gooseDBVersionBeforeDeleteHooks, gooseDBVersionHook) + case boil.AfterDeleteHook: + gooseDBVersionAfterDeleteHooks = append(gooseDBVersionAfterDeleteHooks, gooseDBVersionHook) + case boil.BeforeUpsertHook: + gooseDBVersionBeforeUpsertHooks = append(gooseDBVersionBeforeUpsertHooks, gooseDBVersionHook) + case boil.AfterUpsertHook: + gooseDBVersionAfterUpsertHooks = append(gooseDBVersionAfterUpsertHooks, gooseDBVersionHook) + } +} + +// OneG returns a single gooseDBVersion record from the query using the global executor. +func (q gooseDBVersionQuery) OneG(ctx context.Context) (*GooseDBVersion, error) { + return q.One(ctx, boil.GetContextDB()) +} + +// OneGP returns a single gooseDBVersion record from the query using the global executor, and panics on error. +func (q gooseDBVersionQuery) OneGP(ctx context.Context) *GooseDBVersion { + o, err := q.One(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// OneP returns a single gooseDBVersion record from the query, and panics on error. +func (q gooseDBVersionQuery) OneP(ctx context.Context, exec boil.ContextExecutor) *GooseDBVersion { + o, err := q.One(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// One returns a single gooseDBVersion record from the query. +func (q gooseDBVersionQuery) One(ctx context.Context, exec boil.ContextExecutor) (*GooseDBVersion, error) { + o := &GooseDBVersion{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: failed to execute a one query for goose_db_version") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// AllG returns all GooseDBVersion records from the query using the global executor. +func (q gooseDBVersionQuery) AllG(ctx context.Context) (GooseDBVersionSlice, error) { + return q.All(ctx, boil.GetContextDB()) +} + +// AllGP returns all GooseDBVersion records from the query using the global executor, and panics on error. +func (q gooseDBVersionQuery) AllGP(ctx context.Context) GooseDBVersionSlice { + o, err := q.All(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// AllP returns all GooseDBVersion records from the query, and panics on error. +func (q gooseDBVersionQuery) AllP(ctx context.Context, exec boil.ContextExecutor) GooseDBVersionSlice { + o, err := q.All(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// All returns all GooseDBVersion records from the query. +func (q gooseDBVersionQuery) All(ctx context.Context, exec boil.ContextExecutor) (GooseDBVersionSlice, error) { + var o []*GooseDBVersion + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "dbmodel: failed to assign all query results to GooseDBVersion slice") + } + + if len(gooseDBVersionAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// CountG returns the count of all GooseDBVersion records in the query using the global executor +func (q gooseDBVersionQuery) CountG(ctx context.Context) (int64, error) { + return q.Count(ctx, boil.GetContextDB()) +} + +// CountGP returns the count of all GooseDBVersion records in the query using the global executor, and panics on error. +func (q gooseDBVersionQuery) CountGP(ctx context.Context) int64 { + c, err := q.Count(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// CountP returns the count of all GooseDBVersion records in the query, and panics on error. +func (q gooseDBVersionQuery) CountP(ctx context.Context, exec boil.ContextExecutor) int64 { + c, err := q.Count(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// Count returns the count of all GooseDBVersion records in the query. +func (q gooseDBVersionQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to count goose_db_version rows") + } + + return count, nil +} + +// ExistsG checks if the row exists in the table using the global executor. +func (q gooseDBVersionQuery) ExistsG(ctx context.Context) (bool, error) { + return q.Exists(ctx, boil.GetContextDB()) +} + +// ExistsGP checks if the row exists in the table using the global executor, and panics on error. +func (q gooseDBVersionQuery) ExistsGP(ctx context.Context) bool { + e, err := q.Exists(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// ExistsP checks if the row exists in the table, and panics on error. +func (q gooseDBVersionQuery) ExistsP(ctx context.Context, exec boil.ContextExecutor) bool { + e, err := q.Exists(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// Exists checks if the row exists in the table. +func (q gooseDBVersionQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "dbmodel: failed to check if goose_db_version exists") + } + + return count > 0, nil +} + +// GooseDBVersions retrieves all the records using an executor. +func GooseDBVersions(mods ...qm.QueryMod) gooseDBVersionQuery { + mods = append(mods, qm.From("`goose_db_version`")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"`goose_db_version`.*"}) + } + + return gooseDBVersionQuery{q} +} + +// FindGooseDBVersionG retrieves a single record by ID. +func FindGooseDBVersionG(ctx context.Context, iD uint64, selectCols ...string) (*GooseDBVersion, error) { + return FindGooseDBVersion(ctx, boil.GetContextDB(), iD, selectCols...) +} + +// FindGooseDBVersionP retrieves a single record by ID with an executor, and panics on error. +func FindGooseDBVersionP(ctx context.Context, exec boil.ContextExecutor, iD uint64, selectCols ...string) *GooseDBVersion { + retobj, err := FindGooseDBVersion(ctx, exec, iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindGooseDBVersionGP retrieves a single record by ID, and panics on error. +func FindGooseDBVersionGP(ctx context.Context, iD uint64, selectCols ...string) *GooseDBVersion { + retobj, err := FindGooseDBVersion(ctx, boil.GetContextDB(), iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindGooseDBVersion retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindGooseDBVersion(ctx context.Context, exec boil.ContextExecutor, iD uint64, selectCols ...string) (*GooseDBVersion, error) { + gooseDBVersionObj := &GooseDBVersion{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from `goose_db_version` where `id`=?", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, gooseDBVersionObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: unable to select from goose_db_version") + } + + if err = gooseDBVersionObj.doAfterSelectHooks(ctx, exec); err != nil { + return gooseDBVersionObj, err + } + + return gooseDBVersionObj, nil +} + +// InsertG a single record. See Insert for whitelist behavior description. +func (o *GooseDBVersion) InsertG(ctx context.Context, columns boil.Columns) error { + return o.Insert(ctx, boil.GetContextDB(), columns) +} + +// InsertP a single record using an executor, and panics on error. See Insert +// for whitelist behavior description. +func (o *GooseDBVersion) InsertP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) { + if err := o.Insert(ctx, exec, columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// InsertGP a single record, and panics on error. See Insert for whitelist +// behavior description. +func (o *GooseDBVersion) InsertGP(ctx context.Context, columns boil.Columns) { + if err := o.Insert(ctx, boil.GetContextDB(), columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *GooseDBVersion) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("dbmodel: no goose_db_version provided for insertion") + } + + var err error + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(gooseDBVersionColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + gooseDBVersionInsertCacheMut.RLock() + cache, cached := gooseDBVersionInsertCache[key] + gooseDBVersionInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + gooseDBVersionAllColumns, + gooseDBVersionColumnsWithDefault, + gooseDBVersionColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(gooseDBVersionType, gooseDBVersionMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(gooseDBVersionType, gooseDBVersionMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO `goose_db_version` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO `goose_db_version` () VALUES ()%s%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `goose_db_version` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, gooseDBVersionPrimaryKeyColumns)) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + result, err := exec.ExecContext(ctx, cache.query, vals...) + + if err != nil { + return errors.Wrap(err, "dbmodel: unable to insert into goose_db_version") + } + + var lastID int64 + var identifierCols []interface{} + + if len(cache.retMapping) == 0 { + goto CacheNoHooks + } + + lastID, err = result.LastInsertId() + if err != nil { + return ErrSyncFail + } + + o.ID = uint64(lastID) + if lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == gooseDBVersionMapping["id"] { + goto CacheNoHooks + } + + identifierCols = []interface{}{ + o.ID, + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.retQuery) + fmt.Fprintln(writer, identifierCols...) + } + err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to populate default values for goose_db_version") + } + +CacheNoHooks: + if !cached { + gooseDBVersionInsertCacheMut.Lock() + gooseDBVersionInsertCache[key] = cache + gooseDBVersionInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// UpdateG a single GooseDBVersion record using the global executor. +// See Update for more documentation. +func (o *GooseDBVersion) UpdateG(ctx context.Context, columns boil.Columns) (int64, error) { + return o.Update(ctx, boil.GetContextDB(), columns) +} + +// UpdateP uses an executor to update the GooseDBVersion, and panics on error. +// See Update for more documentation. +func (o *GooseDBVersion) UpdateP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, exec, columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateGP a single GooseDBVersion record using the global executor. Panics on error. +// See Update for more documentation. +func (o *GooseDBVersion) UpdateGP(ctx context.Context, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, boil.GetContextDB(), columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Update uses an executor to update the GooseDBVersion. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *GooseDBVersion) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + gooseDBVersionUpdateCacheMut.RLock() + cache, cached := gooseDBVersionUpdateCache[key] + gooseDBVersionUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + gooseDBVersionAllColumns, + gooseDBVersionPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("dbmodel: unable to update goose_db_version, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE `goose_db_version` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, wl), + strmangle.WhereClause("`", "`", 0, gooseDBVersionPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(gooseDBVersionType, gooseDBVersionMapping, append(wl, gooseDBVersionPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update goose_db_version row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by update for goose_db_version") + } + + if !cached { + gooseDBVersionUpdateCacheMut.Lock() + gooseDBVersionUpdateCache[key] = cache + gooseDBVersionUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAllP updates all rows with matching column names, and panics on error. +func (q gooseDBVersionQuery) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllG updates all rows with the specified column values. +func (q gooseDBVersionQuery) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return q.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (q gooseDBVersionQuery) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values. +func (q gooseDBVersionQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all for goose_db_version") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected for goose_db_version") + } + + return rowsAff, nil +} + +// UpdateAllG updates all rows with the specified column values. +func (o GooseDBVersionSlice) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return o.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (o GooseDBVersionSlice) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllP updates all rows with the specified column values, and panics on error. +func (o GooseDBVersionSlice) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o GooseDBVersionSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("dbmodel: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), gooseDBVersionPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE `goose_db_version` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, gooseDBVersionPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all in gooseDBVersion slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected all in update all gooseDBVersion") + } + return rowsAff, nil +} + +// DeleteG deletes a single GooseDBVersion record. +// DeleteG will match against the primary key column to find the record to delete. +func (o *GooseDBVersion) DeleteG(ctx context.Context) (int64, error) { + return o.Delete(ctx, boil.GetContextDB()) +} + +// DeleteP deletes a single GooseDBVersion record with an executor. +// DeleteP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *GooseDBVersion) DeleteP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.Delete(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteGP deletes a single GooseDBVersion record. +// DeleteGP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *GooseDBVersion) DeleteGP(ctx context.Context) int64 { + rowsAff, err := o.Delete(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Delete deletes a single GooseDBVersion record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *GooseDBVersion) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("dbmodel: no GooseDBVersion provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), gooseDBVersionPrimaryKeyMapping) + sql := "DELETE FROM `goose_db_version` WHERE `id`=?" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete from goose_db_version") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by delete for goose_db_version") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +func (q gooseDBVersionQuery) DeleteAllG(ctx context.Context) (int64, error) { + return q.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows, and panics on error. +func (q gooseDBVersionQuery) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := q.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows, and panics on error. +func (q gooseDBVersionQuery) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := q.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all matching rows. +func (q gooseDBVersionQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("dbmodel: no gooseDBVersionQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from goose_db_version") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for goose_db_version") + } + + return rowsAff, nil +} + +// DeleteAllG deletes all rows in the slice. +func (o GooseDBVersionSlice) DeleteAllG(ctx context.Context) (int64, error) { + return o.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows in the slice, using an executor, and panics on error. +func (o GooseDBVersionSlice) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows in the slice, and panics on error. +func (o GooseDBVersionSlice) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := o.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o GooseDBVersionSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(gooseDBVersionBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), gooseDBVersionPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM `goose_db_version` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, gooseDBVersionPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from gooseDBVersion slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for goose_db_version") + } + + if len(gooseDBVersionAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// ReloadG refetches the object from the database using the primary keys. +func (o *GooseDBVersion) ReloadG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: no GooseDBVersion provided for reload") + } + + return o.Reload(ctx, boil.GetContextDB()) +} + +// ReloadP refetches the object from the database with an executor. Panics on error. +func (o *GooseDBVersion) ReloadP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.Reload(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadGP refetches the object from the database and panics on error. +func (o *GooseDBVersion) ReloadGP(ctx context.Context) { + if err := o.Reload(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *GooseDBVersion) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindGooseDBVersion(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAllG refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *GooseDBVersionSlice) ReloadAllG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: empty GooseDBVersionSlice provided for reload all") + } + + return o.ReloadAll(ctx, boil.GetContextDB()) +} + +// ReloadAllP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *GooseDBVersionSlice) ReloadAllP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.ReloadAll(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAllGP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *GooseDBVersionSlice) ReloadAllGP(ctx context.Context) { + if err := o.ReloadAll(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *GooseDBVersionSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := GooseDBVersionSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), gooseDBVersionPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT `goose_db_version`.* FROM `goose_db_version` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, gooseDBVersionPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to reload all in GooseDBVersionSlice") + } + + *o = slice + + return nil +} + +// GooseDBVersionExistsG checks if the GooseDBVersion row exists. +func GooseDBVersionExistsG(ctx context.Context, iD uint64) (bool, error) { + return GooseDBVersionExists(ctx, boil.GetContextDB(), iD) +} + +// GooseDBVersionExistsP checks if the GooseDBVersion row exists. Panics on error. +func GooseDBVersionExistsP(ctx context.Context, exec boil.ContextExecutor, iD uint64) bool { + e, err := GooseDBVersionExists(ctx, exec, iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// GooseDBVersionExistsGP checks if the GooseDBVersion row exists. Panics on error. +func GooseDBVersionExistsGP(ctx context.Context, iD uint64) bool { + e, err := GooseDBVersionExists(ctx, boil.GetContextDB(), iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// GooseDBVersionExists checks if the GooseDBVersion row exists. +func GooseDBVersionExists(ctx context.Context, exec boil.ContextExecutor, iD uint64) (bool, error) { + var exists bool + sql := "select exists(select 1 from `goose_db_version` where `id`=? limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "dbmodel: unable to check if goose_db_version exists") + } + + return exists, nil +} diff --git a/internal/infrastructure/database/internal/dbmodel/tenants.go b/internal/infrastructure/database/internal/dbmodel/tenants.go new file mode 100644 index 000000000..e48d9d8cc --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/tenants.go @@ -0,0 +1,1468 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// Tenant is an object representing the database table. +type Tenant struct { // id + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + // name + Name string `boil:"name" json:"name" toml:"name" yaml:"name"` + // created date + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + // update date + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + + R *tenantR `boil:"-" json:"-" toml:"-" yaml:"-"` + L tenantL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var TenantColumns = struct { + ID string + Name string + CreatedAt string + UpdatedAt string +}{ + ID: "id", + Name: "name", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +var TenantTableColumns = struct { + ID string + Name string + CreatedAt string + UpdatedAt string +}{ + ID: "tenants.id", + Name: "tenants.name", + CreatedAt: "tenants.created_at", + UpdatedAt: "tenants.updated_at", +} + +// Generated where + +type whereHelperstring struct{ field string } + +func (w whereHelperstring) EQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperstring) NEQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperstring) LT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperstring) LTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperstring) GT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperstring) GTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } +func (w whereHelperstring) IN(slice []string) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) +} +func (w whereHelperstring) NIN(slice []string) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...) +} + +type whereHelpertime_Time struct{ field string } + +func (w whereHelpertime_Time) EQ(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.EQ, x) +} +func (w whereHelpertime_Time) NEQ(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.NEQ, x) +} +func (w whereHelpertime_Time) LT(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LT, x) +} +func (w whereHelpertime_Time) LTE(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LTE, x) +} +func (w whereHelpertime_Time) GT(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GT, x) +} +func (w whereHelpertime_Time) GTE(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GTE, x) +} + +var TenantWhere = struct { + ID whereHelperstring + Name whereHelperstring + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time +}{ + ID: whereHelperstring{field: "`tenants`.`id`"}, + Name: whereHelperstring{field: "`tenants`.`name`"}, + CreatedAt: whereHelpertime_Time{field: "`tenants`.`created_at`"}, + UpdatedAt: whereHelpertime_Time{field: "`tenants`.`updated_at`"}, +} + +// TenantRels is where relationship names are stored. +var TenantRels = struct { + Users string +}{ + Users: "Users", +} + +// tenantR is where relationships are stored. +type tenantR struct { + Users UserSlice `boil:"Users" json:"Users" toml:"Users" yaml:"Users"` +} + +// NewStruct creates a new relationship struct +func (*tenantR) NewStruct() *tenantR { + return &tenantR{} +} + +func (r *tenantR) GetUsers() UserSlice { + if r == nil { + return nil + } + return r.Users +} + +// tenantL is where Load methods for each relationship are stored. +type tenantL struct{} + +var ( + tenantAllColumns = []string{"id", "name", "created_at", "updated_at"} + tenantColumnsWithoutDefault = []string{"id", "name", "created_at", "updated_at"} + tenantColumnsWithDefault = []string{} + tenantPrimaryKeyColumns = []string{"id"} + tenantGeneratedColumns = []string{} +) + +type ( + // TenantSlice is an alias for a slice of pointers to Tenant. + // This should almost always be used instead of []Tenant. + TenantSlice []*Tenant + // TenantHook is the signature for custom Tenant hook methods + TenantHook func(context.Context, boil.ContextExecutor, *Tenant) error + + tenantQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + tenantType = reflect.TypeOf(&Tenant{}) + tenantMapping = queries.MakeStructMapping(tenantType) + tenantPrimaryKeyMapping, _ = queries.BindMapping(tenantType, tenantMapping, tenantPrimaryKeyColumns) + tenantInsertCacheMut sync.RWMutex + tenantInsertCache = make(map[string]insertCache) + tenantUpdateCacheMut sync.RWMutex + tenantUpdateCache = make(map[string]updateCache) + tenantUpsertCacheMut sync.RWMutex + tenantUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var tenantAfterSelectHooks []TenantHook + +var tenantBeforeInsertHooks []TenantHook +var tenantAfterInsertHooks []TenantHook + +var tenantBeforeUpdateHooks []TenantHook +var tenantAfterUpdateHooks []TenantHook + +var tenantBeforeDeleteHooks []TenantHook +var tenantAfterDeleteHooks []TenantHook + +var tenantBeforeUpsertHooks []TenantHook +var tenantAfterUpsertHooks []TenantHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *Tenant) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *Tenant) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *Tenant) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *Tenant) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *Tenant) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *Tenant) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *Tenant) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *Tenant) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *Tenant) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range tenantAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddTenantHook registers your hook function for all future operations. +func AddTenantHook(hookPoint boil.HookPoint, tenantHook TenantHook) { + switch hookPoint { + case boil.AfterSelectHook: + tenantAfterSelectHooks = append(tenantAfterSelectHooks, tenantHook) + case boil.BeforeInsertHook: + tenantBeforeInsertHooks = append(tenantBeforeInsertHooks, tenantHook) + case boil.AfterInsertHook: + tenantAfterInsertHooks = append(tenantAfterInsertHooks, tenantHook) + case boil.BeforeUpdateHook: + tenantBeforeUpdateHooks = append(tenantBeforeUpdateHooks, tenantHook) + case boil.AfterUpdateHook: + tenantAfterUpdateHooks = append(tenantAfterUpdateHooks, tenantHook) + case boil.BeforeDeleteHook: + tenantBeforeDeleteHooks = append(tenantBeforeDeleteHooks, tenantHook) + case boil.AfterDeleteHook: + tenantAfterDeleteHooks = append(tenantAfterDeleteHooks, tenantHook) + case boil.BeforeUpsertHook: + tenantBeforeUpsertHooks = append(tenantBeforeUpsertHooks, tenantHook) + case boil.AfterUpsertHook: + tenantAfterUpsertHooks = append(tenantAfterUpsertHooks, tenantHook) + } +} + +// OneG returns a single tenant record from the query using the global executor. +func (q tenantQuery) OneG(ctx context.Context) (*Tenant, error) { + return q.One(ctx, boil.GetContextDB()) +} + +// OneGP returns a single tenant record from the query using the global executor, and panics on error. +func (q tenantQuery) OneGP(ctx context.Context) *Tenant { + o, err := q.One(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// OneP returns a single tenant record from the query, and panics on error. +func (q tenantQuery) OneP(ctx context.Context, exec boil.ContextExecutor) *Tenant { + o, err := q.One(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// One returns a single tenant record from the query. +func (q tenantQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Tenant, error) { + o := &Tenant{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: failed to execute a one query for tenants") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// AllG returns all Tenant records from the query using the global executor. +func (q tenantQuery) AllG(ctx context.Context) (TenantSlice, error) { + return q.All(ctx, boil.GetContextDB()) +} + +// AllGP returns all Tenant records from the query using the global executor, and panics on error. +func (q tenantQuery) AllGP(ctx context.Context) TenantSlice { + o, err := q.All(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// AllP returns all Tenant records from the query, and panics on error. +func (q tenantQuery) AllP(ctx context.Context, exec boil.ContextExecutor) TenantSlice { + o, err := q.All(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// All returns all Tenant records from the query. +func (q tenantQuery) All(ctx context.Context, exec boil.ContextExecutor) (TenantSlice, error) { + var o []*Tenant + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "dbmodel: failed to assign all query results to Tenant slice") + } + + if len(tenantAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// CountG returns the count of all Tenant records in the query using the global executor +func (q tenantQuery) CountG(ctx context.Context) (int64, error) { + return q.Count(ctx, boil.GetContextDB()) +} + +// CountGP returns the count of all Tenant records in the query using the global executor, and panics on error. +func (q tenantQuery) CountGP(ctx context.Context) int64 { + c, err := q.Count(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// CountP returns the count of all Tenant records in the query, and panics on error. +func (q tenantQuery) CountP(ctx context.Context, exec boil.ContextExecutor) int64 { + c, err := q.Count(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// Count returns the count of all Tenant records in the query. +func (q tenantQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to count tenants rows") + } + + return count, nil +} + +// ExistsG checks if the row exists in the table using the global executor. +func (q tenantQuery) ExistsG(ctx context.Context) (bool, error) { + return q.Exists(ctx, boil.GetContextDB()) +} + +// ExistsGP checks if the row exists in the table using the global executor, and panics on error. +func (q tenantQuery) ExistsGP(ctx context.Context) bool { + e, err := q.Exists(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// ExistsP checks if the row exists in the table, and panics on error. +func (q tenantQuery) ExistsP(ctx context.Context, exec boil.ContextExecutor) bool { + e, err := q.Exists(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// Exists checks if the row exists in the table. +func (q tenantQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "dbmodel: failed to check if tenants exists") + } + + return count > 0, nil +} + +// Users retrieves all the user's Users with an executor. +func (o *Tenant) Users(mods ...qm.QueryMod) userQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("`users`.`tenant_id`=?", o.ID), + ) + + return Users(queryMods...) +} + +// LoadUsers allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (tenantL) LoadUsers(ctx context.Context, e boil.ContextExecutor, singular bool, maybeTenant interface{}, mods queries.Applicator) error { + var slice []*Tenant + var object *Tenant + + if singular { + var ok bool + object, ok = maybeTenant.(*Tenant) + if !ok { + object = new(Tenant) + ok = queries.SetFromEmbeddedStruct(&object, &maybeTenant) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeTenant)) + } + } + } else { + s, ok := maybeTenant.(*[]*Tenant) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeTenant) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeTenant)) + } + } + } + + args := make([]interface{}, 0, 1) + if singular { + if object.R == nil { + object.R = &tenantR{} + } + args = append(args, object.ID) + } else { + Outer: + for _, obj := range slice { + if obj.R == nil { + obj.R = &tenantR{} + } + + for _, a := range args { + if a == obj.ID { + continue Outer + } + } + + args = append(args, obj.ID) + } + } + + if len(args) == 0 { + return nil + } + + query := NewQuery( + qm.From(`users`), + qm.WhereIn(`users.tenant_id in ?`, args...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load users") + } + + var resultSlice []*User + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice users") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on users") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for users") + } + + if len(userAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.Users = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &userR{} + } + foreign.R.Tenant = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.TenantID { + local.R.Users = append(local.R.Users, foreign) + if foreign.R == nil { + foreign.R = &userR{} + } + foreign.R.Tenant = local + break + } + } + } + + return nil +} + +// AddUsersG adds the given related objects to the existing relationships +// of the tenant, optionally inserting them as new records. +// Appends related to o.R.Users. +// Sets related.R.Tenant appropriately. +// Uses the global database handle. +func (o *Tenant) AddUsersG(ctx context.Context, insert bool, related ...*User) error { + return o.AddUsers(ctx, boil.GetContextDB(), insert, related...) +} + +// AddUsersP adds the given related objects to the existing relationships +// of the tenant, optionally inserting them as new records. +// Appends related to o.R.Users. +// Sets related.R.Tenant appropriately. +// Panics on error. +func (o *Tenant) AddUsersP(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) { + if err := o.AddUsers(ctx, exec, insert, related...); err != nil { + panic(boil.WrapErr(err)) + } +} + +// AddUsersGP adds the given related objects to the existing relationships +// of the tenant, optionally inserting them as new records. +// Appends related to o.R.Users. +// Sets related.R.Tenant appropriately. +// Uses the global database handle and panics on error. +func (o *Tenant) AddUsersGP(ctx context.Context, insert bool, related ...*User) { + if err := o.AddUsers(ctx, boil.GetContextDB(), insert, related...); err != nil { + panic(boil.WrapErr(err)) + } +} + +// AddUsers adds the given related objects to the existing relationships +// of the tenant, optionally inserting them as new records. +// Appends related to o.R.Users. +// Sets related.R.Tenant appropriately. +func (o *Tenant) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error { + var err error + for _, rel := range related { + if insert { + rel.TenantID = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, []string{"tenant_id"}), + strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.TenantID = o.ID + } + } + + if o.R == nil { + o.R = &tenantR{ + Users: related, + } + } else { + o.R.Users = append(o.R.Users, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &userR{ + Tenant: o, + } + } else { + rel.R.Tenant = o + } + } + return nil +} + +// Tenants retrieves all the records using an executor. +func Tenants(mods ...qm.QueryMod) tenantQuery { + mods = append(mods, qm.From("`tenants`")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"`tenants`.*"}) + } + + return tenantQuery{q} +} + +// FindTenantG retrieves a single record by ID. +func FindTenantG(ctx context.Context, iD string, selectCols ...string) (*Tenant, error) { + return FindTenant(ctx, boil.GetContextDB(), iD, selectCols...) +} + +// FindTenantP retrieves a single record by ID with an executor, and panics on error. +func FindTenantP(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) *Tenant { + retobj, err := FindTenant(ctx, exec, iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindTenantGP retrieves a single record by ID, and panics on error. +func FindTenantGP(ctx context.Context, iD string, selectCols ...string) *Tenant { + retobj, err := FindTenant(ctx, boil.GetContextDB(), iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindTenant retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindTenant(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Tenant, error) { + tenantObj := &Tenant{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from `tenants` where `id`=?", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, tenantObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: unable to select from tenants") + } + + if err = tenantObj.doAfterSelectHooks(ctx, exec); err != nil { + return tenantObj, err + } + + return tenantObj, nil +} + +// InsertG a single record. See Insert for whitelist behavior description. +func (o *Tenant) InsertG(ctx context.Context, columns boil.Columns) error { + return o.Insert(ctx, boil.GetContextDB(), columns) +} + +// InsertP a single record using an executor, and panics on error. See Insert +// for whitelist behavior description. +func (o *Tenant) InsertP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) { + if err := o.Insert(ctx, exec, columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// InsertGP a single record, and panics on error. See Insert for whitelist +// behavior description. +func (o *Tenant) InsertGP(ctx context.Context, columns boil.Columns) { + if err := o.Insert(ctx, boil.GetContextDB(), columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *Tenant) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("dbmodel: no tenants provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(tenantColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + tenantInsertCacheMut.RLock() + cache, cached := tenantInsertCache[key] + tenantInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + tenantAllColumns, + tenantColumnsWithDefault, + tenantColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(tenantType, tenantMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(tenantType, tenantMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO `tenants` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO `tenants` () VALUES ()%s%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `tenants` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, tenantPrimaryKeyColumns)) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + _, err = exec.ExecContext(ctx, cache.query, vals...) + + if err != nil { + return errors.Wrap(err, "dbmodel: unable to insert into tenants") + } + + var identifierCols []interface{} + + if len(cache.retMapping) == 0 { + goto CacheNoHooks + } + + identifierCols = []interface{}{ + o.ID, + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.retQuery) + fmt.Fprintln(writer, identifierCols...) + } + err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to populate default values for tenants") + } + +CacheNoHooks: + if !cached { + tenantInsertCacheMut.Lock() + tenantInsertCache[key] = cache + tenantInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// UpdateG a single Tenant record using the global executor. +// See Update for more documentation. +func (o *Tenant) UpdateG(ctx context.Context, columns boil.Columns) (int64, error) { + return o.Update(ctx, boil.GetContextDB(), columns) +} + +// UpdateP uses an executor to update the Tenant, and panics on error. +// See Update for more documentation. +func (o *Tenant) UpdateP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, exec, columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateGP a single Tenant record using the global executor. Panics on error. +// See Update for more documentation. +func (o *Tenant) UpdateGP(ctx context.Context, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, boil.GetContextDB(), columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Update uses an executor to update the Tenant. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *Tenant) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + tenantUpdateCacheMut.RLock() + cache, cached := tenantUpdateCache[key] + tenantUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + tenantAllColumns, + tenantPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("dbmodel: unable to update tenants, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE `tenants` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, wl), + strmangle.WhereClause("`", "`", 0, tenantPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(tenantType, tenantMapping, append(wl, tenantPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update tenants row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by update for tenants") + } + + if !cached { + tenantUpdateCacheMut.Lock() + tenantUpdateCache[key] = cache + tenantUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAllP updates all rows with matching column names, and panics on error. +func (q tenantQuery) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllG updates all rows with the specified column values. +func (q tenantQuery) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return q.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (q tenantQuery) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values. +func (q tenantQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all for tenants") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected for tenants") + } + + return rowsAff, nil +} + +// UpdateAllG updates all rows with the specified column values. +func (o TenantSlice) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return o.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (o TenantSlice) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllP updates all rows with the specified column values, and panics on error. +func (o TenantSlice) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o TenantSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("dbmodel: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), tenantPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE `tenants` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, tenantPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all in tenant slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected all in update all tenant") + } + return rowsAff, nil +} + +// DeleteG deletes a single Tenant record. +// DeleteG will match against the primary key column to find the record to delete. +func (o *Tenant) DeleteG(ctx context.Context) (int64, error) { + return o.Delete(ctx, boil.GetContextDB()) +} + +// DeleteP deletes a single Tenant record with an executor. +// DeleteP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *Tenant) DeleteP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.Delete(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteGP deletes a single Tenant record. +// DeleteGP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *Tenant) DeleteGP(ctx context.Context) int64 { + rowsAff, err := o.Delete(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Delete deletes a single Tenant record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *Tenant) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("dbmodel: no Tenant provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), tenantPrimaryKeyMapping) + sql := "DELETE FROM `tenants` WHERE `id`=?" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete from tenants") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by delete for tenants") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +func (q tenantQuery) DeleteAllG(ctx context.Context) (int64, error) { + return q.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows, and panics on error. +func (q tenantQuery) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := q.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows, and panics on error. +func (q tenantQuery) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := q.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all matching rows. +func (q tenantQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("dbmodel: no tenantQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from tenants") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for tenants") + } + + return rowsAff, nil +} + +// DeleteAllG deletes all rows in the slice. +func (o TenantSlice) DeleteAllG(ctx context.Context) (int64, error) { + return o.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows in the slice, using an executor, and panics on error. +func (o TenantSlice) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows in the slice, and panics on error. +func (o TenantSlice) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := o.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o TenantSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(tenantBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), tenantPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM `tenants` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, tenantPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from tenant slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for tenants") + } + + if len(tenantAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// ReloadG refetches the object from the database using the primary keys. +func (o *Tenant) ReloadG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: no Tenant provided for reload") + } + + return o.Reload(ctx, boil.GetContextDB()) +} + +// ReloadP refetches the object from the database with an executor. Panics on error. +func (o *Tenant) ReloadP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.Reload(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadGP refetches the object from the database and panics on error. +func (o *Tenant) ReloadGP(ctx context.Context) { + if err := o.Reload(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *Tenant) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindTenant(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAllG refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *TenantSlice) ReloadAllG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: empty TenantSlice provided for reload all") + } + + return o.ReloadAll(ctx, boil.GetContextDB()) +} + +// ReloadAllP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *TenantSlice) ReloadAllP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.ReloadAll(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAllGP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *TenantSlice) ReloadAllGP(ctx context.Context) { + if err := o.ReloadAll(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *TenantSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := TenantSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), tenantPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT `tenants`.* FROM `tenants` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, tenantPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to reload all in TenantSlice") + } + + *o = slice + + return nil +} + +// TenantExistsG checks if the Tenant row exists. +func TenantExistsG(ctx context.Context, iD string) (bool, error) { + return TenantExists(ctx, boil.GetContextDB(), iD) +} + +// TenantExistsP checks if the Tenant row exists. Panics on error. +func TenantExistsP(ctx context.Context, exec boil.ContextExecutor, iD string) bool { + e, err := TenantExists(ctx, exec, iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// TenantExistsGP checks if the Tenant row exists. Panics on error. +func TenantExistsGP(ctx context.Context, iD string) bool { + e, err := TenantExists(ctx, boil.GetContextDB(), iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// TenantExists checks if the Tenant row exists. +func TenantExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from `tenants` where `id`=? limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "dbmodel: unable to check if tenants exists") + } + + return exists, nil +} diff --git a/internal/infrastructure/database/internal/dbmodel/user_roles.go b/internal/infrastructure/database/internal/dbmodel/user_roles.go new file mode 100644 index 000000000..5c6512a71 --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/user_roles.go @@ -0,0 +1,1384 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// UserRole is an object representing the database table. +type UserRole struct { // id + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + + R *userRoleR `boil:"-" json:"-" toml:"-" yaml:"-"` + L userRoleL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var UserRoleColumns = struct { + ID string +}{ + ID: "id", +} + +var UserRoleTableColumns = struct { + ID string +}{ + ID: "user_roles.id", +} + +// Generated where + +var UserRoleWhere = struct { + ID whereHelperstring +}{ + ID: whereHelperstring{field: "`user_roles`.`id`"}, +} + +// UserRoleRels is where relationship names are stored. +var UserRoleRels = struct { + RoleUsers string +}{ + RoleUsers: "RoleUsers", +} + +// userRoleR is where relationships are stored. +type userRoleR struct { + RoleUsers UserSlice `boil:"RoleUsers" json:"RoleUsers" toml:"RoleUsers" yaml:"RoleUsers"` +} + +// NewStruct creates a new relationship struct +func (*userRoleR) NewStruct() *userRoleR { + return &userRoleR{} +} + +func (r *userRoleR) GetRoleUsers() UserSlice { + if r == nil { + return nil + } + return r.RoleUsers +} + +// userRoleL is where Load methods for each relationship are stored. +type userRoleL struct{} + +var ( + userRoleAllColumns = []string{"id"} + userRoleColumnsWithoutDefault = []string{"id"} + userRoleColumnsWithDefault = []string{} + userRolePrimaryKeyColumns = []string{"id"} + userRoleGeneratedColumns = []string{} +) + +type ( + // UserRoleSlice is an alias for a slice of pointers to UserRole. + // This should almost always be used instead of []UserRole. + UserRoleSlice []*UserRole + // UserRoleHook is the signature for custom UserRole hook methods + UserRoleHook func(context.Context, boil.ContextExecutor, *UserRole) error + + userRoleQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + userRoleType = reflect.TypeOf(&UserRole{}) + userRoleMapping = queries.MakeStructMapping(userRoleType) + userRolePrimaryKeyMapping, _ = queries.BindMapping(userRoleType, userRoleMapping, userRolePrimaryKeyColumns) + userRoleInsertCacheMut sync.RWMutex + userRoleInsertCache = make(map[string]insertCache) + userRoleUpdateCacheMut sync.RWMutex + userRoleUpdateCache = make(map[string]updateCache) + userRoleUpsertCacheMut sync.RWMutex + userRoleUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var userRoleAfterSelectHooks []UserRoleHook + +var userRoleBeforeInsertHooks []UserRoleHook +var userRoleAfterInsertHooks []UserRoleHook + +var userRoleBeforeUpdateHooks []UserRoleHook +var userRoleAfterUpdateHooks []UserRoleHook + +var userRoleBeforeDeleteHooks []UserRoleHook +var userRoleAfterDeleteHooks []UserRoleHook + +var userRoleBeforeUpsertHooks []UserRoleHook +var userRoleAfterUpsertHooks []UserRoleHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *UserRole) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *UserRole) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *UserRole) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *UserRole) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *UserRole) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *UserRole) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *UserRole) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *UserRole) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *UserRole) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userRoleAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddUserRoleHook registers your hook function for all future operations. +func AddUserRoleHook(hookPoint boil.HookPoint, userRoleHook UserRoleHook) { + switch hookPoint { + case boil.AfterSelectHook: + userRoleAfterSelectHooks = append(userRoleAfterSelectHooks, userRoleHook) + case boil.BeforeInsertHook: + userRoleBeforeInsertHooks = append(userRoleBeforeInsertHooks, userRoleHook) + case boil.AfterInsertHook: + userRoleAfterInsertHooks = append(userRoleAfterInsertHooks, userRoleHook) + case boil.BeforeUpdateHook: + userRoleBeforeUpdateHooks = append(userRoleBeforeUpdateHooks, userRoleHook) + case boil.AfterUpdateHook: + userRoleAfterUpdateHooks = append(userRoleAfterUpdateHooks, userRoleHook) + case boil.BeforeDeleteHook: + userRoleBeforeDeleteHooks = append(userRoleBeforeDeleteHooks, userRoleHook) + case boil.AfterDeleteHook: + userRoleAfterDeleteHooks = append(userRoleAfterDeleteHooks, userRoleHook) + case boil.BeforeUpsertHook: + userRoleBeforeUpsertHooks = append(userRoleBeforeUpsertHooks, userRoleHook) + case boil.AfterUpsertHook: + userRoleAfterUpsertHooks = append(userRoleAfterUpsertHooks, userRoleHook) + } +} + +// OneG returns a single userRole record from the query using the global executor. +func (q userRoleQuery) OneG(ctx context.Context) (*UserRole, error) { + return q.One(ctx, boil.GetContextDB()) +} + +// OneGP returns a single userRole record from the query using the global executor, and panics on error. +func (q userRoleQuery) OneGP(ctx context.Context) *UserRole { + o, err := q.One(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// OneP returns a single userRole record from the query, and panics on error. +func (q userRoleQuery) OneP(ctx context.Context, exec boil.ContextExecutor) *UserRole { + o, err := q.One(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// One returns a single userRole record from the query. +func (q userRoleQuery) One(ctx context.Context, exec boil.ContextExecutor) (*UserRole, error) { + o := &UserRole{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: failed to execute a one query for user_roles") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// AllG returns all UserRole records from the query using the global executor. +func (q userRoleQuery) AllG(ctx context.Context) (UserRoleSlice, error) { + return q.All(ctx, boil.GetContextDB()) +} + +// AllGP returns all UserRole records from the query using the global executor, and panics on error. +func (q userRoleQuery) AllGP(ctx context.Context) UserRoleSlice { + o, err := q.All(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// AllP returns all UserRole records from the query, and panics on error. +func (q userRoleQuery) AllP(ctx context.Context, exec boil.ContextExecutor) UserRoleSlice { + o, err := q.All(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// All returns all UserRole records from the query. +func (q userRoleQuery) All(ctx context.Context, exec boil.ContextExecutor) (UserRoleSlice, error) { + var o []*UserRole + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "dbmodel: failed to assign all query results to UserRole slice") + } + + if len(userRoleAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// CountG returns the count of all UserRole records in the query using the global executor +func (q userRoleQuery) CountG(ctx context.Context) (int64, error) { + return q.Count(ctx, boil.GetContextDB()) +} + +// CountGP returns the count of all UserRole records in the query using the global executor, and panics on error. +func (q userRoleQuery) CountGP(ctx context.Context) int64 { + c, err := q.Count(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// CountP returns the count of all UserRole records in the query, and panics on error. +func (q userRoleQuery) CountP(ctx context.Context, exec boil.ContextExecutor) int64 { + c, err := q.Count(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// Count returns the count of all UserRole records in the query. +func (q userRoleQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to count user_roles rows") + } + + return count, nil +} + +// ExistsG checks if the row exists in the table using the global executor. +func (q userRoleQuery) ExistsG(ctx context.Context) (bool, error) { + return q.Exists(ctx, boil.GetContextDB()) +} + +// ExistsGP checks if the row exists in the table using the global executor, and panics on error. +func (q userRoleQuery) ExistsGP(ctx context.Context) bool { + e, err := q.Exists(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// ExistsP checks if the row exists in the table, and panics on error. +func (q userRoleQuery) ExistsP(ctx context.Context, exec boil.ContextExecutor) bool { + e, err := q.Exists(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// Exists checks if the row exists in the table. +func (q userRoleQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "dbmodel: failed to check if user_roles exists") + } + + return count > 0, nil +} + +// RoleUsers retrieves all the user's Users with an executor via role column. +func (o *UserRole) RoleUsers(mods ...qm.QueryMod) userQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("`users`.`role`=?", o.ID), + ) + + return Users(queryMods...) +} + +// LoadRoleUsers allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (userRoleL) LoadRoleUsers(ctx context.Context, e boil.ContextExecutor, singular bool, maybeUserRole interface{}, mods queries.Applicator) error { + var slice []*UserRole + var object *UserRole + + if singular { + var ok bool + object, ok = maybeUserRole.(*UserRole) + if !ok { + object = new(UserRole) + ok = queries.SetFromEmbeddedStruct(&object, &maybeUserRole) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeUserRole)) + } + } + } else { + s, ok := maybeUserRole.(*[]*UserRole) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeUserRole) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeUserRole)) + } + } + } + + args := make([]interface{}, 0, 1) + if singular { + if object.R == nil { + object.R = &userRoleR{} + } + args = append(args, object.ID) + } else { + Outer: + for _, obj := range slice { + if obj.R == nil { + obj.R = &userRoleR{} + } + + for _, a := range args { + if a == obj.ID { + continue Outer + } + } + + args = append(args, obj.ID) + } + } + + if len(args) == 0 { + return nil + } + + query := NewQuery( + qm.From(`users`), + qm.WhereIn(`users.role in ?`, args...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load users") + } + + var resultSlice []*User + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice users") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on users") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for users") + } + + if len(userAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.RoleUsers = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &userR{} + } + foreign.R.RoleUserRole = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.Role { + local.R.RoleUsers = append(local.R.RoleUsers, foreign) + if foreign.R == nil { + foreign.R = &userR{} + } + foreign.R.RoleUserRole = local + break + } + } + } + + return nil +} + +// AddRoleUsersG adds the given related objects to the existing relationships +// of the user_role, optionally inserting them as new records. +// Appends related to o.R.RoleUsers. +// Sets related.R.RoleUserRole appropriately. +// Uses the global database handle. +func (o *UserRole) AddRoleUsersG(ctx context.Context, insert bool, related ...*User) error { + return o.AddRoleUsers(ctx, boil.GetContextDB(), insert, related...) +} + +// AddRoleUsersP adds the given related objects to the existing relationships +// of the user_role, optionally inserting them as new records. +// Appends related to o.R.RoleUsers. +// Sets related.R.RoleUserRole appropriately. +// Panics on error. +func (o *UserRole) AddRoleUsersP(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) { + if err := o.AddRoleUsers(ctx, exec, insert, related...); err != nil { + panic(boil.WrapErr(err)) + } +} + +// AddRoleUsersGP adds the given related objects to the existing relationships +// of the user_role, optionally inserting them as new records. +// Appends related to o.R.RoleUsers. +// Sets related.R.RoleUserRole appropriately. +// Uses the global database handle and panics on error. +func (o *UserRole) AddRoleUsersGP(ctx context.Context, insert bool, related ...*User) { + if err := o.AddRoleUsers(ctx, boil.GetContextDB(), insert, related...); err != nil { + panic(boil.WrapErr(err)) + } +} + +// AddRoleUsers adds the given related objects to the existing relationships +// of the user_role, optionally inserting them as new records. +// Appends related to o.R.RoleUsers. +// Sets related.R.RoleUserRole appropriately. +func (o *UserRole) AddRoleUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error { + var err error + for _, rel := range related { + if insert { + rel.Role = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, []string{"role"}), + strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.Role = o.ID + } + } + + if o.R == nil { + o.R = &userRoleR{ + RoleUsers: related, + } + } else { + o.R.RoleUsers = append(o.R.RoleUsers, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &userR{ + RoleUserRole: o, + } + } else { + rel.R.RoleUserRole = o + } + } + return nil +} + +// UserRoles retrieves all the records using an executor. +func UserRoles(mods ...qm.QueryMod) userRoleQuery { + mods = append(mods, qm.From("`user_roles`")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"`user_roles`.*"}) + } + + return userRoleQuery{q} +} + +// FindUserRoleG retrieves a single record by ID. +func FindUserRoleG(ctx context.Context, iD string, selectCols ...string) (*UserRole, error) { + return FindUserRole(ctx, boil.GetContextDB(), iD, selectCols...) +} + +// FindUserRoleP retrieves a single record by ID with an executor, and panics on error. +func FindUserRoleP(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) *UserRole { + retobj, err := FindUserRole(ctx, exec, iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindUserRoleGP retrieves a single record by ID, and panics on error. +func FindUserRoleGP(ctx context.Context, iD string, selectCols ...string) *UserRole { + retobj, err := FindUserRole(ctx, boil.GetContextDB(), iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindUserRole retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindUserRole(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*UserRole, error) { + userRoleObj := &UserRole{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from `user_roles` where `id`=?", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, userRoleObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: unable to select from user_roles") + } + + if err = userRoleObj.doAfterSelectHooks(ctx, exec); err != nil { + return userRoleObj, err + } + + return userRoleObj, nil +} + +// InsertG a single record. See Insert for whitelist behavior description. +func (o *UserRole) InsertG(ctx context.Context, columns boil.Columns) error { + return o.Insert(ctx, boil.GetContextDB(), columns) +} + +// InsertP a single record using an executor, and panics on error. See Insert +// for whitelist behavior description. +func (o *UserRole) InsertP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) { + if err := o.Insert(ctx, exec, columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// InsertGP a single record, and panics on error. See Insert for whitelist +// behavior description. +func (o *UserRole) InsertGP(ctx context.Context, columns boil.Columns) { + if err := o.Insert(ctx, boil.GetContextDB(), columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *UserRole) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("dbmodel: no user_roles provided for insertion") + } + + var err error + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(userRoleColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + userRoleInsertCacheMut.RLock() + cache, cached := userRoleInsertCache[key] + userRoleInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + userRoleAllColumns, + userRoleColumnsWithDefault, + userRoleColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(userRoleType, userRoleMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(userRoleType, userRoleMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO `user_roles` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO `user_roles` () VALUES ()%s%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `user_roles` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, userRolePrimaryKeyColumns)) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + _, err = exec.ExecContext(ctx, cache.query, vals...) + + if err != nil { + return errors.Wrap(err, "dbmodel: unable to insert into user_roles") + } + + var identifierCols []interface{} + + if len(cache.retMapping) == 0 { + goto CacheNoHooks + } + + identifierCols = []interface{}{ + o.ID, + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.retQuery) + fmt.Fprintln(writer, identifierCols...) + } + err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to populate default values for user_roles") + } + +CacheNoHooks: + if !cached { + userRoleInsertCacheMut.Lock() + userRoleInsertCache[key] = cache + userRoleInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// UpdateG a single UserRole record using the global executor. +// See Update for more documentation. +func (o *UserRole) UpdateG(ctx context.Context, columns boil.Columns) (int64, error) { + return o.Update(ctx, boil.GetContextDB(), columns) +} + +// UpdateP uses an executor to update the UserRole, and panics on error. +// See Update for more documentation. +func (o *UserRole) UpdateP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, exec, columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateGP a single UserRole record using the global executor. Panics on error. +// See Update for more documentation. +func (o *UserRole) UpdateGP(ctx context.Context, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, boil.GetContextDB(), columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Update uses an executor to update the UserRole. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *UserRole) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + userRoleUpdateCacheMut.RLock() + cache, cached := userRoleUpdateCache[key] + userRoleUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + userRoleAllColumns, + userRolePrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("dbmodel: unable to update user_roles, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE `user_roles` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, wl), + strmangle.WhereClause("`", "`", 0, userRolePrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(userRoleType, userRoleMapping, append(wl, userRolePrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update user_roles row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by update for user_roles") + } + + if !cached { + userRoleUpdateCacheMut.Lock() + userRoleUpdateCache[key] = cache + userRoleUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAllP updates all rows with matching column names, and panics on error. +func (q userRoleQuery) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllG updates all rows with the specified column values. +func (q userRoleQuery) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return q.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (q userRoleQuery) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values. +func (q userRoleQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all for user_roles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected for user_roles") + } + + return rowsAff, nil +} + +// UpdateAllG updates all rows with the specified column values. +func (o UserRoleSlice) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return o.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (o UserRoleSlice) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllP updates all rows with the specified column values, and panics on error. +func (o UserRoleSlice) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o UserRoleSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("dbmodel: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userRolePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE `user_roles` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userRolePrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all in userRole slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected all in update all userRole") + } + return rowsAff, nil +} + +// DeleteG deletes a single UserRole record. +// DeleteG will match against the primary key column to find the record to delete. +func (o *UserRole) DeleteG(ctx context.Context) (int64, error) { + return o.Delete(ctx, boil.GetContextDB()) +} + +// DeleteP deletes a single UserRole record with an executor. +// DeleteP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *UserRole) DeleteP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.Delete(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteGP deletes a single UserRole record. +// DeleteGP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *UserRole) DeleteGP(ctx context.Context) int64 { + rowsAff, err := o.Delete(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Delete deletes a single UserRole record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *UserRole) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("dbmodel: no UserRole provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), userRolePrimaryKeyMapping) + sql := "DELETE FROM `user_roles` WHERE `id`=?" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete from user_roles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by delete for user_roles") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +func (q userRoleQuery) DeleteAllG(ctx context.Context) (int64, error) { + return q.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows, and panics on error. +func (q userRoleQuery) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := q.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows, and panics on error. +func (q userRoleQuery) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := q.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all matching rows. +func (q userRoleQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("dbmodel: no userRoleQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from user_roles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for user_roles") + } + + return rowsAff, nil +} + +// DeleteAllG deletes all rows in the slice. +func (o UserRoleSlice) DeleteAllG(ctx context.Context) (int64, error) { + return o.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows in the slice, using an executor, and panics on error. +func (o UserRoleSlice) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows in the slice, and panics on error. +func (o UserRoleSlice) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := o.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o UserRoleSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(userRoleBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userRolePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM `user_roles` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userRolePrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from userRole slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for user_roles") + } + + if len(userRoleAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// ReloadG refetches the object from the database using the primary keys. +func (o *UserRole) ReloadG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: no UserRole provided for reload") + } + + return o.Reload(ctx, boil.GetContextDB()) +} + +// ReloadP refetches the object from the database with an executor. Panics on error. +func (o *UserRole) ReloadP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.Reload(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadGP refetches the object from the database and panics on error. +func (o *UserRole) ReloadGP(ctx context.Context) { + if err := o.Reload(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *UserRole) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindUserRole(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAllG refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *UserRoleSlice) ReloadAllG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: empty UserRoleSlice provided for reload all") + } + + return o.ReloadAll(ctx, boil.GetContextDB()) +} + +// ReloadAllP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *UserRoleSlice) ReloadAllP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.ReloadAll(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAllGP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *UserRoleSlice) ReloadAllGP(ctx context.Context) { + if err := o.ReloadAll(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *UserRoleSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := UserRoleSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userRolePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT `user_roles`.* FROM `user_roles` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userRolePrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to reload all in UserRoleSlice") + } + + *o = slice + + return nil +} + +// UserRoleExistsG checks if the UserRole row exists. +func UserRoleExistsG(ctx context.Context, iD string) (bool, error) { + return UserRoleExists(ctx, boil.GetContextDB(), iD) +} + +// UserRoleExistsP checks if the UserRole row exists. Panics on error. +func UserRoleExistsP(ctx context.Context, exec boil.ContextExecutor, iD string) bool { + e, err := UserRoleExists(ctx, exec, iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// UserRoleExistsGP checks if the UserRole row exists. Panics on error. +func UserRoleExistsGP(ctx context.Context, iD string) bool { + e, err := UserRoleExists(ctx, boil.GetContextDB(), iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// UserRoleExists checks if the UserRole row exists. +func UserRoleExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from `user_roles` where `id`=? limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "dbmodel: unable to check if user_roles exists") + } + + return exists, nil +} diff --git a/internal/infrastructure/database/internal/dbmodel/users.go b/internal/infrastructure/database/internal/dbmodel/users.go new file mode 100644 index 000000000..8ea5a7e5d --- /dev/null +++ b/internal/infrastructure/database/internal/dbmodel/users.go @@ -0,0 +1,1674 @@ +// Code generated by SQLBoiler 4.13.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package dbmodel + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// User is an object representing the database table. +type User struct { // id + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + // tenant_id + TenantID string `boil:"tenant_id" json:"tenant_id" toml:"tenant_id" yaml:"tenant_id"` + // role + Role string `boil:"role" json:"role" toml:"role" yaml:"role"` + // auth_uid + AuthUID string `boil:"auth_uid" json:"auth_uid" toml:"auth_uid" yaml:"auth_uid"` + // display_name + DisplayName string `boil:"display_name" json:"display_name" toml:"display_name" yaml:"display_name"` + // auth_uid + ImagePath string `boil:"image_path" json:"image_path" toml:"image_path" yaml:"image_path"` + // email + Email string `boil:"email" json:"email" toml:"email" yaml:"email"` + // created date + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + // update date + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + + R *userR `boil:"-" json:"-" toml:"-" yaml:"-"` + L userL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var UserColumns = struct { + ID string + TenantID string + Role string + AuthUID string + DisplayName string + ImagePath string + Email string + CreatedAt string + UpdatedAt string +}{ + ID: "id", + TenantID: "tenant_id", + Role: "role", + AuthUID: "auth_uid", + DisplayName: "display_name", + ImagePath: "image_path", + Email: "email", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +var UserTableColumns = struct { + ID string + TenantID string + Role string + AuthUID string + DisplayName string + ImagePath string + Email string + CreatedAt string + UpdatedAt string +}{ + ID: "users.id", + TenantID: "users.tenant_id", + Role: "users.role", + AuthUID: "users.auth_uid", + DisplayName: "users.display_name", + ImagePath: "users.image_path", + Email: "users.email", + CreatedAt: "users.created_at", + UpdatedAt: "users.updated_at", +} + +// Generated where + +var UserWhere = struct { + ID whereHelperstring + TenantID whereHelperstring + Role whereHelperstring + AuthUID whereHelperstring + DisplayName whereHelperstring + ImagePath whereHelperstring + Email whereHelperstring + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time +}{ + ID: whereHelperstring{field: "`users`.`id`"}, + TenantID: whereHelperstring{field: "`users`.`tenant_id`"}, + Role: whereHelperstring{field: "`users`.`role`"}, + AuthUID: whereHelperstring{field: "`users`.`auth_uid`"}, + DisplayName: whereHelperstring{field: "`users`.`display_name`"}, + ImagePath: whereHelperstring{field: "`users`.`image_path`"}, + Email: whereHelperstring{field: "`users`.`email`"}, + CreatedAt: whereHelpertime_Time{field: "`users`.`created_at`"}, + UpdatedAt: whereHelpertime_Time{field: "`users`.`updated_at`"}, +} + +// UserRels is where relationship names are stored. +var UserRels = struct { + RoleUserRole string + Tenant string +}{ + RoleUserRole: "RoleUserRole", + Tenant: "Tenant", +} + +// userR is where relationships are stored. +type userR struct { + RoleUserRole *UserRole `boil:"RoleUserRole" json:"RoleUserRole" toml:"RoleUserRole" yaml:"RoleUserRole"` + Tenant *Tenant `boil:"Tenant" json:"Tenant" toml:"Tenant" yaml:"Tenant"` +} + +// NewStruct creates a new relationship struct +func (*userR) NewStruct() *userR { + return &userR{} +} + +func (r *userR) GetRoleUserRole() *UserRole { + if r == nil { + return nil + } + return r.RoleUserRole +} + +func (r *userR) GetTenant() *Tenant { + if r == nil { + return nil + } + return r.Tenant +} + +// userL is where Load methods for each relationship are stored. +type userL struct{} + +var ( + userAllColumns = []string{"id", "tenant_id", "role", "auth_uid", "display_name", "image_path", "email", "created_at", "updated_at"} + userColumnsWithoutDefault = []string{"id", "tenant_id", "role", "auth_uid", "display_name", "image_path", "email", "created_at", "updated_at"} + userColumnsWithDefault = []string{} + userPrimaryKeyColumns = []string{"id"} + userGeneratedColumns = []string{} +) + +type ( + // UserSlice is an alias for a slice of pointers to User. + // This should almost always be used instead of []User. + UserSlice []*User + // UserHook is the signature for custom User hook methods + UserHook func(context.Context, boil.ContextExecutor, *User) error + + userQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + userType = reflect.TypeOf(&User{}) + userMapping = queries.MakeStructMapping(userType) + userPrimaryKeyMapping, _ = queries.BindMapping(userType, userMapping, userPrimaryKeyColumns) + userInsertCacheMut sync.RWMutex + userInsertCache = make(map[string]insertCache) + userUpdateCacheMut sync.RWMutex + userUpdateCache = make(map[string]updateCache) + userUpsertCacheMut sync.RWMutex + userUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var userAfterSelectHooks []UserHook + +var userBeforeInsertHooks []UserHook +var userAfterInsertHooks []UserHook + +var userBeforeUpdateHooks []UserHook +var userAfterUpdateHooks []UserHook + +var userBeforeDeleteHooks []UserHook +var userAfterDeleteHooks []UserHook + +var userBeforeUpsertHooks []UserHook +var userAfterUpsertHooks []UserHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *User) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *User) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *User) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *User) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *User) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *User) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *User) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *User) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *User) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range userAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddUserHook registers your hook function for all future operations. +func AddUserHook(hookPoint boil.HookPoint, userHook UserHook) { + switch hookPoint { + case boil.AfterSelectHook: + userAfterSelectHooks = append(userAfterSelectHooks, userHook) + case boil.BeforeInsertHook: + userBeforeInsertHooks = append(userBeforeInsertHooks, userHook) + case boil.AfterInsertHook: + userAfterInsertHooks = append(userAfterInsertHooks, userHook) + case boil.BeforeUpdateHook: + userBeforeUpdateHooks = append(userBeforeUpdateHooks, userHook) + case boil.AfterUpdateHook: + userAfterUpdateHooks = append(userAfterUpdateHooks, userHook) + case boil.BeforeDeleteHook: + userBeforeDeleteHooks = append(userBeforeDeleteHooks, userHook) + case boil.AfterDeleteHook: + userAfterDeleteHooks = append(userAfterDeleteHooks, userHook) + case boil.BeforeUpsertHook: + userBeforeUpsertHooks = append(userBeforeUpsertHooks, userHook) + case boil.AfterUpsertHook: + userAfterUpsertHooks = append(userAfterUpsertHooks, userHook) + } +} + +// OneG returns a single user record from the query using the global executor. +func (q userQuery) OneG(ctx context.Context) (*User, error) { + return q.One(ctx, boil.GetContextDB()) +} + +// OneGP returns a single user record from the query using the global executor, and panics on error. +func (q userQuery) OneGP(ctx context.Context) *User { + o, err := q.One(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// OneP returns a single user record from the query, and panics on error. +func (q userQuery) OneP(ctx context.Context, exec boil.ContextExecutor) *User { + o, err := q.One(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// One returns a single user record from the query. +func (q userQuery) One(ctx context.Context, exec boil.ContextExecutor) (*User, error) { + o := &User{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: failed to execute a one query for users") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// AllG returns all User records from the query using the global executor. +func (q userQuery) AllG(ctx context.Context) (UserSlice, error) { + return q.All(ctx, boil.GetContextDB()) +} + +// AllGP returns all User records from the query using the global executor, and panics on error. +func (q userQuery) AllGP(ctx context.Context) UserSlice { + o, err := q.All(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// AllP returns all User records from the query, and panics on error. +func (q userQuery) AllP(ctx context.Context, exec boil.ContextExecutor) UserSlice { + o, err := q.All(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return o +} + +// All returns all User records from the query. +func (q userQuery) All(ctx context.Context, exec boil.ContextExecutor) (UserSlice, error) { + var o []*User + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "dbmodel: failed to assign all query results to User slice") + } + + if len(userAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// CountG returns the count of all User records in the query using the global executor +func (q userQuery) CountG(ctx context.Context) (int64, error) { + return q.Count(ctx, boil.GetContextDB()) +} + +// CountGP returns the count of all User records in the query using the global executor, and panics on error. +func (q userQuery) CountGP(ctx context.Context) int64 { + c, err := q.Count(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// CountP returns the count of all User records in the query, and panics on error. +func (q userQuery) CountP(ctx context.Context, exec boil.ContextExecutor) int64 { + c, err := q.Count(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return c +} + +// Count returns the count of all User records in the query. +func (q userQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to count users rows") + } + + return count, nil +} + +// ExistsG checks if the row exists in the table using the global executor. +func (q userQuery) ExistsG(ctx context.Context) (bool, error) { + return q.Exists(ctx, boil.GetContextDB()) +} + +// ExistsGP checks if the row exists in the table using the global executor, and panics on error. +func (q userQuery) ExistsGP(ctx context.Context) bool { + e, err := q.Exists(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// ExistsP checks if the row exists in the table, and panics on error. +func (q userQuery) ExistsP(ctx context.Context, exec boil.ContextExecutor) bool { + e, err := q.Exists(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// Exists checks if the row exists in the table. +func (q userQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "dbmodel: failed to check if users exists") + } + + return count > 0, nil +} + +// RoleUserRole pointed to by the foreign key. +func (o *User) RoleUserRole(mods ...qm.QueryMod) userRoleQuery { + queryMods := []qm.QueryMod{ + qm.Where("`id` = ?", o.Role), + } + + queryMods = append(queryMods, mods...) + + return UserRoles(queryMods...) +} + +// Tenant pointed to by the foreign key. +func (o *User) Tenant(mods ...qm.QueryMod) tenantQuery { + queryMods := []qm.QueryMod{ + qm.Where("`id` = ?", o.TenantID), + } + + queryMods = append(queryMods, mods...) + + return Tenants(queryMods...) +} + +// LoadRoleUserRole allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (userL) LoadRoleUserRole(ctx context.Context, e boil.ContextExecutor, singular bool, maybeUser interface{}, mods queries.Applicator) error { + var slice []*User + var object *User + + if singular { + var ok bool + object, ok = maybeUser.(*User) + if !ok { + object = new(User) + ok = queries.SetFromEmbeddedStruct(&object, &maybeUser) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeUser)) + } + } + } else { + s, ok := maybeUser.(*[]*User) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeUser) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeUser)) + } + } + } + + args := make([]interface{}, 0, 1) + if singular { + if object.R == nil { + object.R = &userR{} + } + args = append(args, object.Role) + + } else { + Outer: + for _, obj := range slice { + if obj.R == nil { + obj.R = &userR{} + } + + for _, a := range args { + if a == obj.Role { + continue Outer + } + } + + args = append(args, obj.Role) + + } + } + + if len(args) == 0 { + return nil + } + + query := NewQuery( + qm.From(`user_roles`), + qm.WhereIn(`user_roles.id in ?`, args...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load UserRole") + } + + var resultSlice []*UserRole + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice UserRole") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for user_roles") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for user_roles") + } + + if len(userAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.RoleUserRole = foreign + if foreign.R == nil { + foreign.R = &userRoleR{} + } + foreign.R.RoleUsers = append(foreign.R.RoleUsers, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.Role == foreign.ID { + local.R.RoleUserRole = foreign + if foreign.R == nil { + foreign.R = &userRoleR{} + } + foreign.R.RoleUsers = append(foreign.R.RoleUsers, local) + break + } + } + } + + return nil +} + +// LoadTenant allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (userL) LoadTenant(ctx context.Context, e boil.ContextExecutor, singular bool, maybeUser interface{}, mods queries.Applicator) error { + var slice []*User + var object *User + + if singular { + var ok bool + object, ok = maybeUser.(*User) + if !ok { + object = new(User) + ok = queries.SetFromEmbeddedStruct(&object, &maybeUser) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeUser)) + } + } + } else { + s, ok := maybeUser.(*[]*User) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeUser) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeUser)) + } + } + } + + args := make([]interface{}, 0, 1) + if singular { + if object.R == nil { + object.R = &userR{} + } + args = append(args, object.TenantID) + + } else { + Outer: + for _, obj := range slice { + if obj.R == nil { + obj.R = &userR{} + } + + for _, a := range args { + if a == obj.TenantID { + continue Outer + } + } + + args = append(args, obj.TenantID) + + } + } + + if len(args) == 0 { + return nil + } + + query := NewQuery( + qm.From(`tenants`), + qm.WhereIn(`tenants.id in ?`, args...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load Tenant") + } + + var resultSlice []*Tenant + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice Tenant") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for tenants") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for tenants") + } + + if len(userAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.Tenant = foreign + if foreign.R == nil { + foreign.R = &tenantR{} + } + foreign.R.Users = append(foreign.R.Users, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.TenantID == foreign.ID { + local.R.Tenant = foreign + if foreign.R == nil { + foreign.R = &tenantR{} + } + foreign.R.Users = append(foreign.R.Users, local) + break + } + } + } + + return nil +} + +// SetRoleUserRoleG of the user to the related item. +// Sets o.R.RoleUserRole to related. +// Adds o to related.R.RoleUsers. +// Uses the global database handle. +func (o *User) SetRoleUserRoleG(ctx context.Context, insert bool, related *UserRole) error { + return o.SetRoleUserRole(ctx, boil.GetContextDB(), insert, related) +} + +// SetRoleUserRoleP of the user to the related item. +// Sets o.R.RoleUserRole to related. +// Adds o to related.R.RoleUsers. +// Panics on error. +func (o *User) SetRoleUserRoleP(ctx context.Context, exec boil.ContextExecutor, insert bool, related *UserRole) { + if err := o.SetRoleUserRole(ctx, exec, insert, related); err != nil { + panic(boil.WrapErr(err)) + } +} + +// SetRoleUserRoleGP of the user to the related item. +// Sets o.R.RoleUserRole to related. +// Adds o to related.R.RoleUsers. +// Uses the global database handle and panics on error. +func (o *User) SetRoleUserRoleGP(ctx context.Context, insert bool, related *UserRole) { + if err := o.SetRoleUserRole(ctx, boil.GetContextDB(), insert, related); err != nil { + panic(boil.WrapErr(err)) + } +} + +// SetRoleUserRole of the user to the related item. +// Sets o.R.RoleUserRole to related. +// Adds o to related.R.RoleUsers. +func (o *User) SetRoleUserRole(ctx context.Context, exec boil.ContextExecutor, insert bool, related *UserRole) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, []string{"role"}), + strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.Role = related.ID + if o.R == nil { + o.R = &userR{ + RoleUserRole: related, + } + } else { + o.R.RoleUserRole = related + } + + if related.R == nil { + related.R = &userRoleR{ + RoleUsers: UserSlice{o}, + } + } else { + related.R.RoleUsers = append(related.R.RoleUsers, o) + } + + return nil +} + +// SetTenantG of the user to the related item. +// Sets o.R.Tenant to related. +// Adds o to related.R.Users. +// Uses the global database handle. +func (o *User) SetTenantG(ctx context.Context, insert bool, related *Tenant) error { + return o.SetTenant(ctx, boil.GetContextDB(), insert, related) +} + +// SetTenantP of the user to the related item. +// Sets o.R.Tenant to related. +// Adds o to related.R.Users. +// Panics on error. +func (o *User) SetTenantP(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Tenant) { + if err := o.SetTenant(ctx, exec, insert, related); err != nil { + panic(boil.WrapErr(err)) + } +} + +// SetTenantGP of the user to the related item. +// Sets o.R.Tenant to related. +// Adds o to related.R.Users. +// Uses the global database handle and panics on error. +func (o *User) SetTenantGP(ctx context.Context, insert bool, related *Tenant) { + if err := o.SetTenant(ctx, boil.GetContextDB(), insert, related); err != nil { + panic(boil.WrapErr(err)) + } +} + +// SetTenant of the user to the related item. +// Sets o.R.Tenant to related. +// Adds o to related.R.Users. +func (o *User) SetTenant(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Tenant) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, []string{"tenant_id"}), + strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.TenantID = related.ID + if o.R == nil { + o.R = &userR{ + Tenant: related, + } + } else { + o.R.Tenant = related + } + + if related.R == nil { + related.R = &tenantR{ + Users: UserSlice{o}, + } + } else { + related.R.Users = append(related.R.Users, o) + } + + return nil +} + +// Users retrieves all the records using an executor. +func Users(mods ...qm.QueryMod) userQuery { + mods = append(mods, qm.From("`users`")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"`users`.*"}) + } + + return userQuery{q} +} + +// FindUserG retrieves a single record by ID. +func FindUserG(ctx context.Context, iD string, selectCols ...string) (*User, error) { + return FindUser(ctx, boil.GetContextDB(), iD, selectCols...) +} + +// FindUserP retrieves a single record by ID with an executor, and panics on error. +func FindUserP(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) *User { + retobj, err := FindUser(ctx, exec, iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindUserGP retrieves a single record by ID, and panics on error. +func FindUserGP(ctx context.Context, iD string, selectCols ...string) *User { + retobj, err := FindUser(ctx, boil.GetContextDB(), iD, selectCols...) + if err != nil { + panic(boil.WrapErr(err)) + } + + return retobj +} + +// FindUser retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindUser(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*User, error) { + userObj := &User{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from `users` where `id`=?", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, userObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "dbmodel: unable to select from users") + } + + if err = userObj.doAfterSelectHooks(ctx, exec); err != nil { + return userObj, err + } + + return userObj, nil +} + +// InsertG a single record. See Insert for whitelist behavior description. +func (o *User) InsertG(ctx context.Context, columns boil.Columns) error { + return o.Insert(ctx, boil.GetContextDB(), columns) +} + +// InsertP a single record using an executor, and panics on error. See Insert +// for whitelist behavior description. +func (o *User) InsertP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) { + if err := o.Insert(ctx, exec, columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// InsertGP a single record, and panics on error. See Insert for whitelist +// behavior description. +func (o *User) InsertGP(ctx context.Context, columns boil.Columns) { + if err := o.Insert(ctx, boil.GetContextDB(), columns); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("dbmodel: no users provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(userColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + userInsertCacheMut.RLock() + cache, cached := userInsertCache[key] + userInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + userAllColumns, + userColumnsWithDefault, + userColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(userType, userMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(userType, userMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO `users` (`%s`) %%sVALUES (%s)%%s", strings.Join(wl, "`,`"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO `users` () VALUES ()%s%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + cache.retQuery = fmt.Sprintf("SELECT `%s` FROM `users` WHERE %s", strings.Join(returnColumns, "`,`"), strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns)) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + _, err = exec.ExecContext(ctx, cache.query, vals...) + + if err != nil { + return errors.Wrap(err, "dbmodel: unable to insert into users") + } + + var identifierCols []interface{} + + if len(cache.retMapping) == 0 { + goto CacheNoHooks + } + + identifierCols = []interface{}{ + o.ID, + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.retQuery) + fmt.Fprintln(writer, identifierCols...) + } + err = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to populate default values for users") + } + +CacheNoHooks: + if !cached { + userInsertCacheMut.Lock() + userInsertCache[key] = cache + userInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// UpdateG a single User record using the global executor. +// See Update for more documentation. +func (o *User) UpdateG(ctx context.Context, columns boil.Columns) (int64, error) { + return o.Update(ctx, boil.GetContextDB(), columns) +} + +// UpdateP uses an executor to update the User, and panics on error. +// See Update for more documentation. +func (o *User) UpdateP(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, exec, columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateGP a single User record using the global executor. Panics on error. +// See Update for more documentation. +func (o *User) UpdateGP(ctx context.Context, columns boil.Columns) int64 { + rowsAff, err := o.Update(ctx, boil.GetContextDB(), columns) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Update uses an executor to update the User. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + userUpdateCacheMut.RLock() + cache, cached := userUpdateCache[key] + userUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + userAllColumns, + userPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("dbmodel: unable to update users, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, wl), + strmangle.WhereClause("`", "`", 0, userPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(userType, userMapping, append(wl, userPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update users row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by update for users") + } + + if !cached { + userUpdateCacheMut.Lock() + userUpdateCache[key] = cache + userUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAllP updates all rows with matching column names, and panics on error. +func (q userQuery) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllG updates all rows with the specified column values. +func (q userQuery) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return q.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (q userQuery) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := q.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values. +func (q userQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all for users") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected for users") + } + + return rowsAff, nil +} + +// UpdateAllG updates all rows with the specified column values. +func (o UserSlice) UpdateAllG(ctx context.Context, cols M) (int64, error) { + return o.UpdateAll(ctx, boil.GetContextDB(), cols) +} + +// UpdateAllGP updates all rows with the specified column values, and panics on error. +func (o UserSlice) UpdateAllGP(ctx context.Context, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, boil.GetContextDB(), cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAllP updates all rows with the specified column values, and panics on error. +func (o UserSlice) UpdateAllP(ctx context.Context, exec boil.ContextExecutor, cols M) int64 { + rowsAff, err := o.UpdateAll(ctx, exec, cols) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o UserSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("dbmodel: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE `users` SET %s WHERE %s", + strmangle.SetParamNames("`", "`", 0, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to update all in user slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to retrieve rows affected all in update all user") + } + return rowsAff, nil +} + +// DeleteG deletes a single User record. +// DeleteG will match against the primary key column to find the record to delete. +func (o *User) DeleteG(ctx context.Context) (int64, error) { + return o.Delete(ctx, boil.GetContextDB()) +} + +// DeleteP deletes a single User record with an executor. +// DeleteP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *User) DeleteP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.Delete(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteGP deletes a single User record. +// DeleteGP will match against the primary key column to find the record to delete. +// Panics on error. +func (o *User) DeleteGP(ctx context.Context) int64 { + rowsAff, err := o.Delete(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// Delete deletes a single User record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("dbmodel: no User provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), userPrimaryKeyMapping) + sql := "DELETE FROM `users` WHERE `id`=?" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete from users") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by delete for users") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +func (q userQuery) DeleteAllG(ctx context.Context) (int64, error) { + return q.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows, and panics on error. +func (q userQuery) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := q.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows, and panics on error. +func (q userQuery) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := q.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all matching rows. +func (q userQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("dbmodel: no userQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from users") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for users") + } + + return rowsAff, nil +} + +// DeleteAllG deletes all rows in the slice. +func (o UserSlice) DeleteAllG(ctx context.Context) (int64, error) { + return o.DeleteAll(ctx, boil.GetContextDB()) +} + +// DeleteAllP deletes all rows in the slice, using an executor, and panics on error. +func (o UserSlice) DeleteAllP(ctx context.Context, exec boil.ContextExecutor) int64 { + rowsAff, err := o.DeleteAll(ctx, exec) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAllGP deletes all rows in the slice, and panics on error. +func (o UserSlice) DeleteAllGP(ctx context.Context) int64 { + rowsAff, err := o.DeleteAll(ctx, boil.GetContextDB()) + if err != nil { + panic(boil.WrapErr(err)) + } + + return rowsAff +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o UserSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(userBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM `users` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "dbmodel: unable to delete all from user slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "dbmodel: failed to get rows affected by deleteall for users") + } + + if len(userAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// ReloadG refetches the object from the database using the primary keys. +func (o *User) ReloadG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: no User provided for reload") + } + + return o.Reload(ctx, boil.GetContextDB()) +} + +// ReloadP refetches the object from the database with an executor. Panics on error. +func (o *User) ReloadP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.Reload(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadGP refetches the object from the database and panics on error. +func (o *User) ReloadGP(ctx context.Context) { + if err := o.Reload(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindUser(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAllG refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *UserSlice) ReloadAllG(ctx context.Context) error { + if o == nil { + return errors.New("dbmodel: empty UserSlice provided for reload all") + } + + return o.ReloadAll(ctx, boil.GetContextDB()) +} + +// ReloadAllP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *UserSlice) ReloadAllP(ctx context.Context, exec boil.ContextExecutor) { + if err := o.ReloadAll(ctx, exec); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAllGP refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +// Panics on error. +func (o *UserSlice) ReloadAllGP(ctx context.Context) { + if err := o.ReloadAll(ctx, boil.GetContextDB()); err != nil { + panic(boil.WrapErr(err)) + } +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *UserSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := UserSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), userPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT `users`.* FROM `users` WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, userPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "dbmodel: unable to reload all in UserSlice") + } + + *o = slice + + return nil +} + +// UserExistsG checks if the User row exists. +func UserExistsG(ctx context.Context, iD string) (bool, error) { + return UserExists(ctx, boil.GetContextDB(), iD) +} + +// UserExistsP checks if the User row exists. Panics on error. +func UserExistsP(ctx context.Context, exec boil.ContextExecutor, iD string) bool { + e, err := UserExists(ctx, exec, iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// UserExistsGP checks if the User row exists. Panics on error. +func UserExistsGP(ctx context.Context, iD string) bool { + e, err := UserExists(ctx, boil.GetContextDB(), iD) + if err != nil { + panic(boil.WrapErr(err)) + } + + return e +} + +// UserExists checks if the User row exists. +func UserExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from `users` where `id`=? limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "dbmodel: unable to check if users exists") + } + + return exists, nil +} diff --git a/internal/infrastructure/database/internal/marshaller/tenant.go b/internal/infrastructure/database/internal/marshaller/tenant.go new file mode 100644 index 000000000..c904a3572 --- /dev/null +++ b/internal/infrastructure/database/internal/marshaller/tenant.go @@ -0,0 +1,34 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/dbmodel" +) + +func OutputTenantToModel(e *dbmodel.Tenant) *model.Tenant { + m := &model.Tenant{ + ID: e.ID, + Name: e.Name, + CreatedAt: e.CreatedAt, + UpdatedAt: e.UpdatedAt, + } + return m +} + +func OutputTenantsToModel(slice dbmodel.TenantSlice) []*model.Tenant { + dsts := make([]*model.Tenant, len(slice)) + for idx, e := range slice { + dsts[idx] = OutputTenantToModel(e) + } + return dsts +} + +func NewTenantFromModel(m *model.Tenant) *dbmodel.Tenant { + e := &dbmodel.Tenant{} + e.ID = m.ID + e.Name = m.Name + e.CreatedAt = m.CreatedAt + e.UpdatedAt = m.UpdatedAt + + return e +} diff --git a/internal/infrastructure/database/internal/marshaller/user.go b/internal/infrastructure/database/internal/marshaller/user.go new file mode 100644 index 000000000..ebc92d074 --- /dev/null +++ b/internal/infrastructure/database/internal/marshaller/user.go @@ -0,0 +1,46 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/dbmodel" +) + +func OutputUserToModel(e *dbmodel.User) *model.User { + m := &model.User{ + ID: e.ID, + Role: model.NewUserRole(e.Role), + AuthUID: e.AuthUID, + DisplayName: e.DisplayName, + ImagePath: e.ImagePath, + Email: e.Email, + CreatedAt: e.CreatedAt, + UpdatedAt: e.UpdatedAt, + } + + if e.R != nil { + if e.R.Tenant != nil { + m.Tenant = OutputTenantToModel(e.R.Tenant) + } else { + m.Tenant = &model.Tenant{ + ID: e.ID, + } + } + } + + return m +} + +func NewUserFromModel(m *model.User) *dbmodel.User { + e := &dbmodel.User{} + e.ID = m.ID + e.TenantID = m.Tenant.ID + e.Role = m.Role.String() + e.AuthUID = m.AuthUID + e.DisplayName = m.DisplayName + e.ImagePath = m.ImagePath + e.Email = m.Email + e.CreatedAt = m.CreatedAt + e.UpdatedAt = m.UpdatedAt + + return e +} diff --git a/internal/infrastructure/database/repository/tenant.go b/internal/infrastructure/database/repository/tenant.go new file mode 100644 index 000000000..6bf3e7146 --- /dev/null +++ b/internal/infrastructure/database/repository/tenant.go @@ -0,0 +1,109 @@ +package repository + +import ( + "context" + "database/sql" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/dbmodel" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/marshaller" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/transactable" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type tenant struct{} + +func NewTenant() repository.Tenant { + return &tenant{} +} + +func (r *tenant) Get( + ctx context.Context, + id string, + orFail bool, +) (*model.Tenant, error) { + dbTenant, err := dbmodel.Tenants( + dbmodel.TenantWhere.ID.EQ(id), + ).One(ctx, transactable.GetContextExecutor(ctx)) + if err != nil { + if err == sql.ErrNoRows && !orFail { + return nil, nil + } else if err == sql.ErrNoRows { + return nil, errors.NotFoundErr.Errorf("tenant %s is not found", id) + } + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputTenantToModel(dbTenant), nil +} + +func (r *tenant) List( + ctx context.Context, + query repository.ListTenantsQuery, +) ([]*model.Tenant, error) { + mods := []qm.QueryMod{} + if query.Page.Valid && query.Limit.Valid { + mods = append(mods, + qm.Limit(int(query.Limit.Uint64)), + qm.Offset(int(query.Limit.Uint64*(query.Page.Uint64-1))), + ) + } + dbTenants, err := dbmodel.Tenants( + mods..., + ).All(ctx, transactable.GetContextExecutor(ctx)) + if err != nil { + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputTenantsToModel(dbTenants), nil +} + +func (r *tenant) Count( + ctx context.Context, + query repository.CountTenantsQuery, +) (uint64, error) { + mods := []qm.QueryMod{} + ttl, err := dbmodel.Tenants( + mods..., + ).Count(ctx, transactable.GetContextExecutor(ctx)) + if err != nil { + return 0, errors.InternalErr.Wrap(err) + } + return uint64(ttl), nil +} + +func (r *tenant) Create( + ctx context.Context, + tenant *model.Tenant, +) (*model.Tenant, error) { + dst := marshaller.NewTenantFromModel(tenant) + if err := dst.Insert(ctx, transactable.GetContextExecutor(ctx), boil.Infer()); err != nil { + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputTenantToModel(dst), nil +} + +func (r *tenant) Update( + ctx context.Context, + tenant *model.Tenant, +) (*model.Tenant, error) { + dst := marshaller.NewTenantFromModel(tenant) + if _, err := dst.Update(ctx, transactable.GetContextExecutor(ctx), boil.Infer()); err != nil { + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputTenantToModel(dst), nil +} + +func (r *tenant) Delete( + ctx context.Context, + id string, +) error { + dst := &dbmodel.Tenant{ + ID: id, + } + if _, err := dst.Delete(ctx, transactable.GetContextExecutor(ctx)); err != nil { + return errors.InternalErr.Wrap(err) + } + return nil +} diff --git a/internal/infrastructure/database/repository/user.go b/internal/infrastructure/database/repository/user.go new file mode 100644 index 000000000..204e36375 --- /dev/null +++ b/internal/infrastructure/database/repository/user.go @@ -0,0 +1,64 @@ +package repository + +import ( + "context" + "database/sql" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/dbmodel" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/internal/marshaller" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/transactable" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type user struct{} + +func NewUser() repository.User { + return &user{} +} + +func (r *user) Get( + ctx context.Context, + query repository.GetUserQuery, + orFail bool, + preload bool, +) (*model.User, error) { + mods := []qm.QueryMod{} + if query.ID.Valid { + mods = append(mods, dbmodel.UserWhere.ID.EQ(query.ID.String)) + } + if query.AuthUID.Valid { + mods = append(mods, dbmodel.UserWhere.AuthUID.EQ(query.AuthUID.String)) + } + if preload { + mods = append(mods, + qm.Load(dbmodel.UserRels.Tenant), + ) + } + dbUser, err := dbmodel.Users( + mods..., + ).One(ctx, transactable.GetContextExecutor(ctx)) + if err != nil { + if err == sql.ErrNoRows && !orFail { + return nil, nil + } else if err == sql.ErrNoRows { + return nil, errors.NotFoundErr.Errorf("user is not found") + } + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputUserToModel(dbUser), nil +} + +func (r *user) Create( + ctx context.Context, + user *model.User, +) (*model.User, error) { + dst := marshaller.NewUserFromModel(user) + if err := dst.Insert(ctx, transactable.GetContextExecutor(ctx), boil.Infer()); err != nil { + return nil, errors.InternalErr.Wrap(err) + } + return marshaller.OutputUserToModel(dst), nil +} diff --git a/internal/pkg/gluesqlboiler/gluesqlboiler.go b/internal/infrastructure/database/transactable/helper.go similarity index 52% rename from internal/pkg/gluesqlboiler/gluesqlboiler.go rename to internal/infrastructure/database/transactable/helper.go index 04d5ee83a..4edb9dbc0 100644 --- a/internal/pkg/gluesqlboiler/gluesqlboiler.go +++ b/internal/infrastructure/database/transactable/helper.go @@ -1,10 +1,11 @@ -package gluesqlboiler +package transactable import ( "context" "database/sql" - "github.com/volatiletech/sqlboiler/boil" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/volatiletech/sqlboiler/v4/boil" ) var ( @@ -20,35 +21,41 @@ func GetContextExecutor(ctx context.Context) boil.ContextExecutor { } // RunTx : -func RunTx(ctx context.Context, fn func(context.Context, *sql.Tx) error) error { +var RunTx = func(ctx context.Context, fn func(context.Context) error) error { db, ok := GetContextExecutor(ctx).(boil.ContextBeginner) if !ok { panic("The database in the context does not support boil.ContextBeginner") } - return RunTxWithDB(ctx, db, fn) + return runTxWithDB(ctx, db, fn) } // RunTxWithDB : -func RunTxWithDB(ctx context.Context, db boil.ContextBeginner, fn func(context.Context, *sql.Tx) error) error { +func runTxWithDB(ctx context.Context, db boil.ContextBeginner, fn func(context.Context) error) error { tx, err := db.BeginTx(ctx, nil) if err != nil { return err } defer func() { if err := recover(); err != nil { - tx.Rollback() + if err := tx.Rollback(); err != nil { + panic(err) + } panic(err) } }() ctxWithTx := context.WithValue(ctx, &ctxTxKey, tx) - if err := fn(ctxWithTx, tx); err != nil { - tx.Rollback() + if err := fn(ctxWithTx); err != nil { + if err := tx.Rollback(); err != nil { + return errors.InternalErr.Wrap(err) + } return err } if err := tx.Commit(); err != nil { - tx.Rollback() - return err + if err := tx.Rollback(); err != nil { + return errors.InternalErr.Wrap(err) + } + return errors.InternalErr.Wrap(err) } return nil } diff --git a/internal/infrastructure/database/transactable/repository.go b/internal/infrastructure/database/transactable/repository.go new file mode 100644 index 000000000..68a76e7c2 --- /dev/null +++ b/internal/infrastructure/database/transactable/repository.go @@ -0,0 +1,17 @@ +package transactable + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/repository" +) + +type transactable struct{} + +func NewTransactable() repository.Transactable { + return &transactable{} +} + +func (r *transactable) RWTx(ctx context.Context, fn func(ctx context.Context) error) error { + return RunTx(ctx, fn) +} diff --git a/internal/infrastructure/dependency/dependency.go b/internal/infrastructure/dependency/dependency.go new file mode 100644 index 000000000..2b071c2ae --- /dev/null +++ b/internal/infrastructure/dependency/dependency.go @@ -0,0 +1,77 @@ +package dependency + +import ( + "context" + + "firebase.google.com/go/auth" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/repository" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/database/transactable" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/environment" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/firebase" + firebase_repository "github.com/abyssparanoia/rapid-go/internal/infrastructure/firebase/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase" +) + +type Dependency struct { + FirebaseClient *auth.Client + + // public + PublicAuthenticationInteractor usecase.PublicAuthenticationInteractor + PublicTenantInteractor usecase.PublicTenantInteractor + + // admin + AdminTenantInteractor usecase.AdminTenantInteractor + AdminUserInteractor usecase.AdminUserInteractor + + // Other + UserInteractor usecase.UserInteractor + AuthenticationInteractor usecase.AuthenticationInteractor +} + +func (d *Dependency) Inject( + ctx context.Context, + e *environment.Environment, +) { + _ = database.NewClient(e.DBHost, e.DBUser, e.DBPassword, e.DBDatabase) + + d.FirebaseClient = firebase.NewClient(e.GCPProjectID) + transactable := transactable.NewTransactable() + authenticationRepository := firebase_repository.NewAuthentication( + d.FirebaseClient, + ) + tenantRepository := repository.NewTenant() + userRepository := repository.NewUser() + + d.PublicTenantInteractor = usecase.NewPublicTenantInteractor( + transactable, + tenantRepository, + ) + + d.PublicAuthenticationInteractor = usecase.NewPublicAuthenticationInteractor( + userRepository, + ) + + d.AdminTenantInteractor = usecase.NewAdminTenantInteractor( + transactable, + tenantRepository, + ) + + d.AdminUserInteractor = usecase.NewAdminUserInteractor( + transactable, + authenticationRepository, + userRepository, + tenantRepository, + ) + + d.UserInteractor = usecase.NewUserInteractor( + transactable, + userRepository, + tenantRepository, + authenticationRepository, + ) + + d.AuthenticationInteractor = usecase.NewAuthenticationInteractor( + authenticationRepository, + ) +} diff --git a/internal/infrastructure/environment/env.go b/internal/infrastructure/environment/env.go new file mode 100644 index 000000000..eb4419826 --- /dev/null +++ b/internal/infrastructure/environment/env.go @@ -0,0 +1,13 @@ +package environment + +type Environment struct { + Port string `env:"PORT,required"` + Environment string `env:"ENV,required"` + DBHost string `env:"DB_HOST,required"` + DBUser string `env:"DB_USER,required"` + DBPassword string `env:"DB_PASSWORD,required"` + DBDatabase string `env:"DB_DATABASE,required"` + + GCPProjectID string `env:"GCP_PROJECT_ID,required"` + FirebaseClientAPIKey string `env:"FIREBASE_CLIENT_API_KEY"` +} diff --git a/internal/pkg/gluefirebaseauth/client.go b/internal/infrastructure/firebase/client.go similarity index 91% rename from internal/pkg/gluefirebaseauth/client.go rename to internal/infrastructure/firebase/client.go index 96ca56856..598f4f9d9 100644 --- a/internal/pkg/gluefirebaseauth/client.go +++ b/internal/infrastructure/firebase/client.go @@ -1,4 +1,4 @@ -package gluefirebaseauth +package firebase import ( "context" @@ -11,7 +11,6 @@ import ( "google.golang.org/grpc/keepalive" ) -// NewClient ... get firebase auth client func NewClient(projectID string) *auth.Client { ctx := context.Background() gOpt := option.WithGRPCDialOption(grpc.WithKeepaliveParams(keepalive.ClientParameters{ diff --git a/internal/infrastructure/firebase/internal/marshaller/claims.go b/internal/infrastructure/firebase/internal/marshaller/claims.go new file mode 100644 index 000000000..52ee15d54 --- /dev/null +++ b/internal/infrastructure/firebase/internal/marshaller/claims.go @@ -0,0 +1,34 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" +) + +func ClaimsToModel(authUID string, customClaim map[string]interface{}) *model.Claims { + claims := model.NewClaims(authUID) + if tenantID, ok := customClaim["tenant_id"]; ok { + claims.SetTenantID(tenantID.(string)) + } + if userID, ok := customClaim["service_user_id"]; ok { + claims.SetUserID(userID.(string)) + } + if userRole, ok := customClaim["user_role"]; ok { + claims.SetUserRole(model.NewUserRole(userRole.(string))) + } + + return claims +} + +func ClaimsToMap(m *model.Claims) map[string]interface{} { + cmap := map[string]interface{}{} + if m.TenantID.Valid { + cmap["tenant_id"] = m.TenantID.String + } + if m.UserID.Valid { + cmap["service_user_id"] = m.UserID.String + } + if m.UserRole.Valid() { + cmap["user_role"] = m.UserID.String + } + return cmap +} diff --git a/internal/infrastructure/firebase/repository/authentication.go b/internal/infrastructure/firebase/repository/authentication.go new file mode 100644 index 000000000..2da844a79 --- /dev/null +++ b/internal/infrastructure/firebase/repository/authentication.go @@ -0,0 +1,92 @@ +package repository + +import ( + "context" + + "firebase.google.com/go/auth" + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/firebase/internal/marshaller" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" +) + +type authentication struct { + cli *auth.Client +} + +func NewAuthentication( + firebaseAuthCli *auth.Client, +) repository.Authentication { + return &authentication{ + cli: firebaseAuthCli, + } +} + +func (r *authentication) VerifyIDToken( + ctx context.Context, + idToken string, +) (*model.Claims, error) { + t, err := r.cli.VerifyIDToken(ctx, idToken) + if err != nil { + return nil, errors.UnauthorizedErr.Wrap(err) + } + return marshaller.ClaimsToModel(t.UID, t.Claims), nil +} + +func (r *authentication) GetUserByEmail( + ctx context.Context, + email string, +) (*repository.AuthenticationGetUserByEmailResult, error) { + user, err := r.cli.GetUserByEmail(ctx, email) + if auth.IsUserNotFound(err) { + return &repository.AuthenticationGetUserByEmailResult{ + Exist: false, + }, nil + } + if err != nil { + return nil, errors.InternalErr.Wrap(err) + } + return &repository.AuthenticationGetUserByEmailResult{ + AuthUID: user.UID, + Claims: marshaller.ClaimsToModel(user.UID, user.CustomClaims), + Exist: true, + }, nil +} + +func (r *authentication) CreateUser( + ctx context.Context, + param repository.AuthenticationCreateUserParam, +) (string, error) { + dto := &auth.UserToCreate{} + dto = dto.Email(param.Email) + if param.Password.Valid { + dto = dto.Password(param.Password.String) + } + res, err := r.cli.CreateUser(ctx, dto) + if err != nil { + return "", errors.InternalErr.Wrap(err) + } + return res.UID, nil +} + +func (r *authentication) StoreClaims( + ctx context.Context, + authUID string, + claims *model.Claims, +) error { + if err := r.cli.SetCustomUserClaims(ctx, authUID, marshaller.ClaimsToMap(claims)); err != nil { + return errors.InternalErr.Wrap(err) + } + return nil +} + +func (r *authentication) CreateCustomToken( + ctx context.Context, + authUID string, +) (string, error) { + customToken, err := r.cli.CustomToken(ctx, authUID) + if err != nil { + return "", errors.InternalErr.Wrap(err) + } + return customToken, nil +} diff --git a/internal/infrastructure/grpc/internal/handler/admin/handler.go b/internal/infrastructure/grpc/internal/handler/admin/handler.go new file mode 100644 index 000000000..2aed1ec25 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/admin/handler.go @@ -0,0 +1,22 @@ +package admin + +import ( + admin_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/admin_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase" +) + +type AdminHandler struct { + admin_apiv1.UnimplementedAdminV1ServiceServer + tenantInteractor usecase.AdminTenantInteractor + userInteractor usecase.AdminUserInteractor +} + +func NewAdminHandler( + tenantInteractor usecase.AdminTenantInteractor, + userInteractor usecase.AdminUserInteractor, +) admin_apiv1.AdminV1ServiceServer { + return &AdminHandler{ + tenantInteractor: tenantInteractor, + userInteractor: userInteractor, + } +} diff --git a/internal/infrastructure/grpc/internal/handler/admin/tenant.go b/internal/infrastructure/grpc/internal/handler/admin/tenant.go new file mode 100644 index 000000000..4e5959650 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/admin/tenant.go @@ -0,0 +1,88 @@ +package admin + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/request_interceptor" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/marshaller" + admin_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/admin_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +func (h *AdminHandler) GetTenant(ctx context.Context, req *admin_apiv1.GetTenantRequest) (*admin_apiv1.GetTenantResponse, error) { + got, err := h.tenantInteractor.Get( + ctx, + input.NewAdminGetTenant( + req.GetTenantId(), + ), + ) + if err != nil { + return nil, err + } + return &admin_apiv1.GetTenantResponse{ + Tenant: marshaller.TenantToPB(got), + }, nil +} + +func (h *AdminHandler) ListTenants(ctx context.Context, req *admin_apiv1.ListTenantsRequest) (*admin_apiv1.ListTenantsResponse, error) { + got, err := h.tenantInteractor.List( + ctx, + input.NewAdminListTenants( + req.GetPage(), + req.GetLimit(), + ), + ) + if err != nil { + return nil, err + } + return &admin_apiv1.ListTenantsResponse{ + Tenants: marshaller.TenantsToPB(got.Tenants), + Pagination: marshaller.NewPagination(got.Pagination), + }, nil +} + +func (h *AdminHandler) CreateTenant(ctx context.Context, req *admin_apiv1.CreateTenantRequest) (*admin_apiv1.CreateTenantResponse, error) { + got, err := h.tenantInteractor.Create( + ctx, + input.NewAdminCreateTenant( + req.GetName(), + request_interceptor.GetRequestTime(ctx), + ), + ) + if err != nil { + return nil, err + } + return &admin_apiv1.CreateTenantResponse{ + Tenant: marshaller.TenantToPB(got), + }, nil +} + +func (h *AdminHandler) UpdateTenant(ctx context.Context, req *admin_apiv1.UpdateTenantRequest) (*admin_apiv1.UpdateTenantResponse, error) { + got, err := h.tenantInteractor.Update( + ctx, + input.NewAdminUpdateTenant( + req.GetTenantId(), + req.GetName(), + request_interceptor.GetRequestTime(ctx), + ), + ) + if err != nil { + return nil, err + } + return &admin_apiv1.UpdateTenantResponse{ + Tenant: marshaller.TenantToPB(got), + }, nil +} + +func (h *AdminHandler) DeleteTenant(ctx context.Context, req *admin_apiv1.DeleteTenantRequest) (*admin_apiv1.DeleteTenantResponse, error) { + err := h.tenantInteractor.Delete( + ctx, + input.NewAdminDeleteTenant( + req.GetTenantId(), + ), + ) + if err != nil { + return nil, err + } + return &admin_apiv1.DeleteTenantResponse{}, nil +} diff --git a/internal/infrastructure/grpc/internal/handler/admin/user.go b/internal/infrastructure/grpc/internal/handler/admin/user.go new file mode 100644 index 000000000..b6ab9e3d6 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/admin/user.go @@ -0,0 +1,35 @@ +package admin + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/request_interceptor" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/session_interceptor" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/marshaller" + admin_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/admin_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +func (h *AdminHandler) CreateUser(ctx context.Context, req *admin_apiv1.CreateUserRequest) (*admin_apiv1.CreateUserResponse, error) { + _, err := session_interceptor.RequireSessionContext(ctx) + if err != nil { + return nil, err + } + got, err := h.userInteractor.Create( + ctx, + input.NewAdminCreateUser( + req.GetTenantId(), + req.GetEmail(), + req.GetDisplayName(), + marshaller.UserRoleToModel(req.GetRole()), + request_interceptor.GetRequestTime(ctx), + ), + ) + if err != nil { + return nil, err + } + + return &admin_apiv1.CreateUserResponse{ + User: marshaller.UserToPB(got), + }, nil +} diff --git a/internal/infrastructure/grpc/internal/handler/debug/handler.go b/internal/infrastructure/grpc/internal/handler/debug/handler.go new file mode 100644 index 000000000..8382b52e8 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/debug/handler.go @@ -0,0 +1,69 @@ +package debug + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/url" + "strings" + + "firebase.google.com/go/auth" + debug_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/debug_api/v1" +) + +type DebugHander struct { + debug_apiv1.UnimplementedDebugV1ServiceServer + firebaseAuthCli *auth.Client + firebaseClientApiKey string +} + +func NewDebugHandler( + firebaseAuthCli *auth.Client, + firebaseClientApiKey string, +) debug_apiv1.DebugV1ServiceServer { + return &DebugHander{ + firebaseAuthCli: firebaseAuthCli, + firebaseClientApiKey: firebaseClientApiKey, + } +} + +type verifyCustomTokenResponse struct { + IDToken string `json:"idToken"` +} + +func (h *DebugHander) CreateIDToken(ctx context.Context, req *debug_apiv1.CreateIDTokenRequest) (*debug_apiv1.CreateIDTokenResponse, error) { + customToken, err := h.firebaseAuthCli.CustomToken(ctx, req.GetAuthUid()) + if err != nil { + return nil, err + } + + values := url.Values{} + values.Add("token", customToken) + values.Add("returnSecureToken", "true") + values.Add("key", h.firebaseClientApiKey) + + resp, err := http.Post( + "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken", + "application/x-www-form-urlencoded", + strings.NewReader(values.Encode()), + ) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + var res verifyCustomTokenResponse + if err := json.Unmarshal(b, &res); err != nil { + return nil, err + } + + return &debug_apiv1.CreateIDTokenResponse{ + IdToken: res.IDToken, + }, nil +} diff --git a/internal/infrastructure/grpc/internal/handler/public/authentication.go b/internal/infrastructure/grpc/internal/handler/public/authentication.go new file mode 100644 index 000000000..46e656858 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/public/authentication.go @@ -0,0 +1,30 @@ +package public + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/session_interceptor" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/marshaller" + public_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/public_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +func (h *PublicHandler) SignIn(ctx context.Context, req *public_apiv1.SignInRequest) (*public_apiv1.SignInResponse, error) { + sctx, err := session_interceptor.RequireSessionContext(ctx) + if err != nil { + return nil, err + } + got, err := h.authenticationInteractor.SignIn( + ctx, + input.NewPublicSignIn( + sctx.AuthUID, + ), + ) + if err != nil { + return nil, err + } + + return &public_apiv1.SignInResponse{ + User: marshaller.UserToPB(got), + }, nil +} diff --git a/internal/infrastructure/grpc/internal/handler/public/handler.go b/internal/infrastructure/grpc/internal/handler/public/handler.go new file mode 100644 index 000000000..2f7257a52 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/public/handler.go @@ -0,0 +1,22 @@ +package public + +import ( + public_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/public_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase" +) + +type PublicHandler struct { + public_apiv1.UnimplementedPublicV1ServiceServer + authenticationInteractor usecase.PublicAuthenticationInteractor + tenantInteractor usecase.PublicTenantInteractor +} + +func NewPublicHandler( + authenticationInteractor usecase.PublicAuthenticationInteractor, + tenantInteractor usecase.PublicTenantInteractor, +) public_apiv1.PublicV1ServiceServer { + return &PublicHandler{ + authenticationInteractor: authenticationInteractor, + tenantInteractor: tenantInteractor, + } +} diff --git a/internal/infrastructure/grpc/internal/handler/public/tenant.go b/internal/infrastructure/grpc/internal/handler/public/tenant.go new file mode 100644 index 000000000..b6fd4c2f1 --- /dev/null +++ b/internal/infrastructure/grpc/internal/handler/public/tenant.go @@ -0,0 +1,24 @@ +package public + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/marshaller" + public_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/public_api/v1" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +func (h *PublicHandler) GetTenant(ctx context.Context, req *public_apiv1.GetTenantRequest) (*public_apiv1.GetTenantResponse, error) { + got, err := h.tenantInteractor.Get( + ctx, + input.NewPublicGetTenant( + req.GetTenantId(), + ), + ) + if err != nil { + return nil, err + } + return &public_apiv1.GetTenantResponse{ + Tenant: marshaller.TenantToPB(got), + }, nil +} diff --git a/internal/infrastructure/grpc/internal/interceptor/request_interceptor/context.go b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/context.go new file mode 100644 index 000000000..cf632db4c --- /dev/null +++ b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/context.go @@ -0,0 +1,21 @@ +package request_interceptor + +import ( + "context" + "time" +) + +type contextKey string + +const ( + requestTime contextKey = "requestTime" +) + +func SetRequestTime(ctx context.Context, t time.Time) context.Context { + return context.WithValue(ctx, requestTime, t) +} + +func GetRequestTime(ctx context.Context) time.Time { + t := ctx.Value(requestTime).(time.Time) + return t +} diff --git a/internal/infrastructure/grpc/internal/interceptor/request_interceptor/err_to_code.go b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/err_to_code.go new file mode 100644 index 000000000..0b936d5df --- /dev/null +++ b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/err_to_code.go @@ -0,0 +1,48 @@ +package request_interceptor + +import ( + "errors" + + pkg_errors "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "go.uber.org/zap/zapcore" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func errToCode(err error) codes.Code { + var notFoundError *pkg_errors.NotFoundError + if ok := errors.As(err, ¬FoundError); ok { + return codes.NotFound + } + var invalidArgumentError *pkg_errors.BadRequestError + if ok := errors.As(err, &invalidArgumentError); ok { + return codes.InvalidArgument + } + var unauthenticatedError *pkg_errors.UnauthorizedError + if ok := errors.As(err, &unauthenticatedError); ok { + return codes.Unauthenticated + } + var alreadyExistError *pkg_errors.ConflictError + if ok := errors.As(err, &alreadyExistError); ok { + return codes.AlreadyExists + } + var internalError *pkg_errors.InternalError + if ok := errors.As(err, &internalError); ok { + return codes.Internal + } + if status, ok := status.FromError(err); ok { + return status.Code() + } + return codes.Unknown +} + +func codeToZapCoreLevel(code codes.Code) zapcore.Level { + switch code { + case codes.NotFound, codes.InvalidArgument, codes.AlreadyExists, codes.Unauthenticated, codes.PermissionDenied, codes.FailedPrecondition: + return zapcore.WarnLevel + case codes.Internal, codes.Unknown, codes.Aborted: + return zapcore.ErrorLevel + default: + return zapcore.InfoLevel + } +} diff --git a/internal/infrastructure/grpc/internal/interceptor/request_interceptor/request_interceptor.go b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/request_interceptor.go new file mode 100644 index 000000000..1ec4f728c --- /dev/null +++ b/internal/infrastructure/grpc/internal/interceptor/request_interceptor/request_interceptor.go @@ -0,0 +1,86 @@ +package request_interceptor + +import ( + "context" + "fmt" + + "github.com/abyssparanoia/rapid-go/internal/pkg/now" + "github.com/blendle/zapdriver" + "github.com/google/uuid" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +const producerID = "rapid" + +const MAX_RESPONSE_LOG_SIZE = 150 * 1000 + +type RequestLog struct { + logger *zap.Logger +} + +func NewRequestLog( + logger *zap.Logger, +) *RequestLog { + return &RequestLog{ + logger, + } +} + +// UnaryServerInterceptor ... +func (i *RequestLog) UnaryServerInterceptor() grpc.UnaryServerInterceptor { + return func( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, + ) ( + interface{}, + error, + ) { + + operationID := uuid.New() + now := now.Now() + + ctx = ctxzap.ToContext(ctx, i.logger.With( + zapdriver.OperationCont(operationID.String(), producerID), + zap.Time("RequestTime", now), + )) + ctx = SetRequestTime(ctx, now) + + resp, err := handler(ctx, req) + + if err != nil { + code := errToCode(err) + zapcoreLevel := codeToZapCoreLevel(code) + i.logger.Check(zapcoreLevel, fmt.Sprintf("code: %s rpc: %s", code.String(), info.FullMethod)).Write( + zapdriver.OperationEnd(operationID.String(), producerID), + zap.String("method", info.FullMethod), + zap.String("grpc.code", code.String()), + zap.Reflect("request", req), + zap.Error(err), + ) + err = status.Errorf(code, "%s", err.Error()) + return nil, err + } + + var logResp interface{} + if len(fmt.Sprintf("%v", resp)) < MAX_RESPONSE_LOG_SIZE { + logResp = resp + } + + i.logger.Info( + fmt.Sprintf("code: %s rpc: %s", codes.OK.String(), info.FullMethod), + zapdriver.OperationEnd(operationID.String(), producerID), + zap.String("method", info.FullMethod), + zap.String("grpc.code", codes.OK.String()), + zap.Reflect("request", req), + zap.Reflect("response", logResp), + ) + + return resp, nil + } +} diff --git a/internal/infrastructure/grpc/internal/interceptor/session_interceptor/context.go b/internal/infrastructure/grpc/internal/interceptor/session_interceptor/context.go new file mode 100644 index 000000000..877289927 --- /dev/null +++ b/internal/infrastructure/grpc/internal/interceptor/session_interceptor/context.go @@ -0,0 +1,59 @@ +package session_interceptor + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/volatiletech/null/v8" +) + +type SessionContext struct { + AuthUID string + TenantID null.String + UserID null.String + UserRole model.UserRole +} + +type contextKey struct{} + +func newSessionContext(claims *model.Claims) *SessionContext { + return &SessionContext{ + AuthUID: claims.AuthUID, + TenantID: claims.TenantID, + UserID: claims.UserID, + UserRole: claims.UserRole, + } +} + +var ( + sessionContextKey contextKey = contextKey{} +) + +func SaveSessionContext( + ctx context.Context, + sessionContext *SessionContext, +) context.Context { + return context.WithValue(ctx, sessionContextKey, *sessionContext) +} + +func RequireSessionContext(ctx context.Context) (*SessionContext, error) { + sctx, ok := GetSessionContext(ctx) + if !ok { + return nil, errors.UnauthorizedErr.New() + } + return sctx, nil +} + +func RequireAdminSessionContext(ctx context.Context) (*SessionContext, error) { + sctx, ok := GetSessionContext(ctx) + if !ok && sctx.UserRole.IsAdmin() { + return nil, errors.UnauthorizedErr.New() + } + return sctx, nil +} + +func GetSessionContext(ctx context.Context) (*SessionContext, bool) { + sessionContext, ok := ctx.Value(sessionContextKey).(SessionContext) + return &sessionContext, ok +} diff --git a/internal/infrastructure/grpc/internal/interceptor/session_interceptor/session_interceptor.go b/internal/infrastructure/grpc/internal/interceptor/session_interceptor/session_interceptor.go new file mode 100644 index 000000000..bbac89c49 --- /dev/null +++ b/internal/infrastructure/grpc/internal/interceptor/session_interceptor/session_interceptor.go @@ -0,0 +1,34 @@ +package session_interceptor + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/usecase" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" +) + +type Session struct { + authenticationInteractor usecase.AuthenticationInteractor +} + +func NewSession( + authenticationInteractor usecase.AuthenticationInteractor, +) *Session { + return &Session{ + authenticationInteractor, + } +} + +func (i *Session) Authenticate(ctx context.Context) (context.Context, error) { + idToken, err := grpc_auth.AuthFromMD(ctx, "Bearer") + if err != nil || idToken == "" { + return ctx, nil + } + claims, err := i.authenticationInteractor.VerifyIDToken(ctx, input.NewVerifyIDToken(idToken)) + if err != nil { + return ctx, err + } + ctx = SaveSessionContext(ctx, newSessionContext(claims)) + return ctx, nil +} diff --git a/internal/infrastructure/grpc/internal/marshaller/pagination.go b/internal/infrastructure/grpc/internal/marshaller/pagination.go new file mode 100644 index 000000000..1664b8841 --- /dev/null +++ b/internal/infrastructure/grpc/internal/marshaller/pagination.go @@ -0,0 +1,17 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + modelv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" +) + +func NewPagination(m *model.Pagination) *modelv1.Pagination { + return &modelv1.Pagination{ + CurrentPage: m.CurrentPage, + PrevPage: m.PrevPage, + NextPage: m.NextPage, + TotalPage: m.TotalPage, + TotalCount: m.TotalCount, + HasNext: m.HasNext, + } +} diff --git a/internal/infrastructure/grpc/internal/marshaller/tenant.go b/internal/infrastructure/grpc/internal/marshaller/tenant.go new file mode 100644 index 000000000..45183d993 --- /dev/null +++ b/internal/infrastructure/grpc/internal/marshaller/tenant.go @@ -0,0 +1,27 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + modelv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func TenantToPB(m *model.Tenant) *modelv1.Tenant { + if m == nil { + return nil + } + return &modelv1.Tenant{ + Id: m.ID, + Name: m.Name, + CreatedAt: timestamppb.New(m.CreatedAt), + UpdatedAt: timestamppb.New(m.UpdatedAt), + } +} + +func TenantsToPB(slice []*model.Tenant) []*modelv1.Tenant { + dsts := make([]*modelv1.Tenant, len(slice)) + for idx, m := range slice { + dsts[idx] = TenantToPB(m) + } + return dsts +} diff --git a/internal/infrastructure/grpc/internal/marshaller/user.go b/internal/infrastructure/grpc/internal/marshaller/user.go new file mode 100644 index 000000000..96cf05061 --- /dev/null +++ b/internal/infrastructure/grpc/internal/marshaller/user.go @@ -0,0 +1,25 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + modelv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func UserToPB(m *model.User) *modelv1.User { + if m == nil { + return nil + } + return &modelv1.User{ + Id: m.ID, + Role: UserRoleToPB(m.Role), + AuthUid: m.AuthUID, + DisplayName: m.DisplayName, + ImageUrl: m.ImagePath, + Email: m.Email, + CreatedAt: timestamppb.New(m.CreatedAt), + UpdatedAt: timestamppb.New(m.UpdatedAt), + + Tenant: TenantToPB(m.Tenant), + } +} diff --git a/internal/infrastructure/grpc/internal/marshaller/user_role.go b/internal/infrastructure/grpc/internal/marshaller/user_role.go new file mode 100644 index 000000000..cdb577d04 --- /dev/null +++ b/internal/infrastructure/grpc/internal/marshaller/user_role.go @@ -0,0 +1,28 @@ +package marshaller + +import ( + "github.com/abyssparanoia/rapid-go/internal/domain/model" + modelv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" +) + +func UserRoleToModel(userRole modelv1.UserRole) model.UserRole { + switch userRole { + case modelv1.UserRole_USER_ROLE_NORMAL: + return model.UserRoleNormal + case modelv1.UserRole_USER_ROLE_ADMIN: + return model.UserRoleAdmin + default: + return model.UserRoleUnknown + } +} + +func UserRoleToPB(userRole model.UserRole) modelv1.UserRole { + switch userRole { + case model.UserRoleNormal: + return modelv1.UserRole_USER_ROLE_NORMAL + case model.UserRoleAdmin: + return modelv1.UserRole_USER_ROLE_ADMIN + default: + return modelv1.UserRole_USER_ROLE_UNSPECIFIED + } +} diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.go new file mode 100644 index 000000000..7420058c6 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.go @@ -0,0 +1,162 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/admin_api/v1/admin.proto + +package admin_apiv1 + +import ( + reflect "reflect" + + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_rapid_admin_api_v1_admin_proto protoreflect.FileDescriptor + +var file_rapid_admin_api_v1_admin_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x32, 0x9f, 0x06, 0x0a, 0x0e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x56, 0x31, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x79, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, + 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x73, 0x12, 0x7f, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x12, 0x27, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, + 0x11, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, + 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, + 0x2a, 0x32, 0x1d, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, + 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x12, 0x27, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x2a, 0x1d, 0x2f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x2f, + 0x7b, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x77, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, + 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x42, 0xec, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x60, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, + 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, + 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, + 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_rapid_admin_api_v1_admin_proto_goTypes = []interface{}{ + (*GetTenantRequest)(nil), // 0: rapid.admin_api.v1.GetTenantRequest + (*ListTenantsRequest)(nil), // 1: rapid.admin_api.v1.ListTenantsRequest + (*CreateTenantRequest)(nil), // 2: rapid.admin_api.v1.CreateTenantRequest + (*UpdateTenantRequest)(nil), // 3: rapid.admin_api.v1.UpdateTenantRequest + (*DeleteTenantRequest)(nil), // 4: rapid.admin_api.v1.DeleteTenantRequest + (*CreateUserRequest)(nil), // 5: rapid.admin_api.v1.CreateUserRequest + (*GetTenantResponse)(nil), // 6: rapid.admin_api.v1.GetTenantResponse + (*ListTenantsResponse)(nil), // 7: rapid.admin_api.v1.ListTenantsResponse + (*CreateTenantResponse)(nil), // 8: rapid.admin_api.v1.CreateTenantResponse + (*UpdateTenantResponse)(nil), // 9: rapid.admin_api.v1.UpdateTenantResponse + (*DeleteTenantResponse)(nil), // 10: rapid.admin_api.v1.DeleteTenantResponse + (*CreateUserResponse)(nil), // 11: rapid.admin_api.v1.CreateUserResponse +} +var file_rapid_admin_api_v1_admin_proto_depIdxs = []int32{ + 0, // 0: rapid.admin_api.v1.AdminV1Service.GetTenant:input_type -> rapid.admin_api.v1.GetTenantRequest + 1, // 1: rapid.admin_api.v1.AdminV1Service.ListTenants:input_type -> rapid.admin_api.v1.ListTenantsRequest + 2, // 2: rapid.admin_api.v1.AdminV1Service.CreateTenant:input_type -> rapid.admin_api.v1.CreateTenantRequest + 3, // 3: rapid.admin_api.v1.AdminV1Service.UpdateTenant:input_type -> rapid.admin_api.v1.UpdateTenantRequest + 4, // 4: rapid.admin_api.v1.AdminV1Service.DeleteTenant:input_type -> rapid.admin_api.v1.DeleteTenantRequest + 5, // 5: rapid.admin_api.v1.AdminV1Service.CreateUser:input_type -> rapid.admin_api.v1.CreateUserRequest + 6, // 6: rapid.admin_api.v1.AdminV1Service.GetTenant:output_type -> rapid.admin_api.v1.GetTenantResponse + 7, // 7: rapid.admin_api.v1.AdminV1Service.ListTenants:output_type -> rapid.admin_api.v1.ListTenantsResponse + 8, // 8: rapid.admin_api.v1.AdminV1Service.CreateTenant:output_type -> rapid.admin_api.v1.CreateTenantResponse + 9, // 9: rapid.admin_api.v1.AdminV1Service.UpdateTenant:output_type -> rapid.admin_api.v1.UpdateTenantResponse + 10, // 10: rapid.admin_api.v1.AdminV1Service.DeleteTenant:output_type -> rapid.admin_api.v1.DeleteTenantResponse + 11, // 11: rapid.admin_api.v1.AdminV1Service.CreateUser:output_type -> rapid.admin_api.v1.CreateUserResponse + 6, // [6:12] is the sub-list for method output_type + 0, // [0:6] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rapid_admin_api_v1_admin_proto_init() } +func file_rapid_admin_api_v1_admin_proto_init() { + if File_rapid_admin_api_v1_admin_proto != nil { + return + } + file_rapid_admin_api_v1_tenant_proto_init() + file_rapid_admin_api_v1_user_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_admin_api_v1_admin_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rapid_admin_api_v1_admin_proto_goTypes, + DependencyIndexes: file_rapid_admin_api_v1_admin_proto_depIdxs, + }.Build() + File_rapid_admin_api_v1_admin_proto = out.File + file_rapid_admin_api_v1_admin_proto_rawDesc = nil + file_rapid_admin_api_v1_admin_proto_goTypes = nil + file_rapid_admin_api_v1_admin_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.gw.go new file mode 100644 index 000000000..d14a0a6d9 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin.pb.gw.go @@ -0,0 +1,644 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: rapid/admin_api/v1/admin.proto + +/* +Package admin_apiv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package admin_apiv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AdminV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := client.GetTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := server.GetTenant(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_AdminV1Service_ListTenants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_AdminV1Service_ListTenants_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListTenantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdminV1Service_ListTenants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListTenants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_ListTenants_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListTenantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdminV1Service_ListTenants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListTenants(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AdminV1Service_CreateTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateTenantRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_CreateTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateTenantRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateTenant(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AdminV1Service_UpdateTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateTenantRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := client.UpdateTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_UpdateTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateTenantRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := server.UpdateTenant(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AdminV1Service_DeleteTenant_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := client.DeleteTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_DeleteTenant_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := server.DeleteTenant(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AdminV1Service_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client AdminV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AdminV1Service_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server AdminV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateUserRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateUser(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAdminV1ServiceHandlerServer registers the http handlers for service AdminV1Service to "mux". +// UnaryRPC :call AdminV1ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAdminV1ServiceHandlerFromEndpoint instead. +func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminV1ServiceServer) error { + + mux.Handle("GET", pattern_AdminV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_GetTenant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_GetTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AdminV1Service_ListTenants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_ListTenants_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_ListTenants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AdminV1Service_CreateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_CreateTenant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_CreateTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_AdminV1Service_UpdateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_UpdateTenant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_UpdateTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_AdminV1Service_DeleteTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_DeleteTenant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_DeleteTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AdminV1Service_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateUser", runtime.WithHTTPPathPattern("/admin/v1/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AdminV1Service_CreateUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAdminV1ServiceHandlerFromEndpoint is same as RegisterAdminV1ServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAdminV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAdminV1ServiceHandler(ctx, mux, conn) +} + +// RegisterAdminV1ServiceHandler registers the http handlers for service AdminV1Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAdminV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error { + return RegisterAdminV1ServiceHandlerClient(ctx, mux, NewAdminV1ServiceClient(conn)) +} + +// RegisterAdminV1ServiceHandlerClient registers the http handlers for service AdminV1Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminV1ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminV1ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AdminV1ServiceClient" to call the correct interceptors. +func RegisterAdminV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminV1ServiceClient) error { + + mux.Handle("GET", pattern_AdminV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/GetTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_GetTenant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_GetTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AdminV1Service_ListTenants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/ListTenants", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_ListTenants_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_ListTenants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AdminV1Service_CreateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_CreateTenant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_CreateTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_AdminV1Service_UpdateTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_UpdateTenant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_UpdateTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_AdminV1Service_DeleteTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", runtime.WithHTTPPathPattern("/admin/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_DeleteTenant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_DeleteTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AdminV1Service_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.admin_api.v1.AdminV1Service/CreateUser", runtime.WithHTTPPathPattern("/admin/v1/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminV1Service_CreateUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminV1Service_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AdminV1Service_GetTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + + pattern_AdminV1Service_ListTenants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) + + pattern_AdminV1Service_CreateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "tenants"}, "")) + + pattern_AdminV1Service_UpdateTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + + pattern_AdminV1Service_DeleteTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"admin", "v1", "tenants", "tenant_id"}, "")) + + pattern_AdminV1Service_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"admin", "v1", "users"}, "")) +) + +var ( + forward_AdminV1Service_GetTenant_0 = runtime.ForwardResponseMessage + + forward_AdminV1Service_ListTenants_0 = runtime.ForwardResponseMessage + + forward_AdminV1Service_CreateTenant_0 = runtime.ForwardResponseMessage + + forward_AdminV1Service_UpdateTenant_0 = runtime.ForwardResponseMessage + + forward_AdminV1Service_DeleteTenant_0 = runtime.ForwardResponseMessage + + forward_AdminV1Service_CreateUser_0 = runtime.ForwardResponseMessage +) diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin_grpc.pb.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin_grpc.pb.go new file mode 100644 index 000000000..9ffe81ef8 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/admin_grpc.pb.go @@ -0,0 +1,280 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package admin_apiv1 + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AdminV1ServiceClient is the client API for AdminV1Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AdminV1ServiceClient interface { + GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error) + ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error) + CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*CreateTenantResponse, error) + UpdateTenant(ctx context.Context, in *UpdateTenantRequest, opts ...grpc.CallOption) (*UpdateTenantResponse, error) + DeleteTenant(ctx context.Context, in *DeleteTenantRequest, opts ...grpc.CallOption) (*DeleteTenantResponse, error) + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) +} + +type adminV1ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAdminV1ServiceClient(cc grpc.ClientConnInterface) AdminV1ServiceClient { + return &adminV1ServiceClient{cc} +} + +func (c *adminV1ServiceClient) GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error) { + out := new(GetTenantResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/GetTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminV1ServiceClient) ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error) { + out := new(ListTenantsResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/ListTenants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminV1ServiceClient) CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*CreateTenantResponse, error) { + out := new(CreateTenantResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/CreateTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminV1ServiceClient) UpdateTenant(ctx context.Context, in *UpdateTenantRequest, opts ...grpc.CallOption) (*UpdateTenantResponse, error) { + out := new(UpdateTenantResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminV1ServiceClient) DeleteTenant(ctx context.Context, in *DeleteTenantRequest, opts ...grpc.CallOption) (*DeleteTenantResponse, error) { + out := new(DeleteTenantResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminV1ServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { + out := new(CreateUserResponse) + err := c.cc.Invoke(ctx, "/rapid.admin_api.v1.AdminV1Service/CreateUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AdminV1ServiceServer is the server API for AdminV1Service service. +// All implementations should embed UnimplementedAdminV1ServiceServer +// for forward compatibility +type AdminV1ServiceServer interface { + GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error) + ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error) + CreateTenant(context.Context, *CreateTenantRequest) (*CreateTenantResponse, error) + UpdateTenant(context.Context, *UpdateTenantRequest) (*UpdateTenantResponse, error) + DeleteTenant(context.Context, *DeleteTenantRequest) (*DeleteTenantResponse, error) + CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) +} + +// UnimplementedAdminV1ServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAdminV1ServiceServer struct { +} + +func (UnimplementedAdminV1ServiceServer) GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTenant not implemented") +} +func (UnimplementedAdminV1ServiceServer) ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTenants not implemented") +} +func (UnimplementedAdminV1ServiceServer) CreateTenant(context.Context, *CreateTenantRequest) (*CreateTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateTenant not implemented") +} +func (UnimplementedAdminV1ServiceServer) UpdateTenant(context.Context, *UpdateTenantRequest) (*UpdateTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTenant not implemented") +} +func (UnimplementedAdminV1ServiceServer) DeleteTenant(context.Context, *DeleteTenantRequest) (*DeleteTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteTenant not implemented") +} +func (UnimplementedAdminV1ServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} + +// UnsafeAdminV1ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AdminV1ServiceServer will +// result in compilation errors. +type UnsafeAdminV1ServiceServer interface { + mustEmbedUnimplementedAdminV1ServiceServer() +} + +func RegisterAdminV1ServiceServer(s grpc.ServiceRegistrar, srv AdminV1ServiceServer) { + s.RegisterService(&AdminV1Service_ServiceDesc, srv) +} + +func _AdminV1Service_GetTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).GetTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/GetTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).GetTenant(ctx, req.(*GetTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminV1Service_ListTenants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTenantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).ListTenants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/ListTenants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).ListTenants(ctx, req.(*ListTenantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminV1Service_CreateTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).CreateTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/CreateTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).CreateTenant(ctx, req.(*CreateTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminV1Service_UpdateTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).UpdateTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/UpdateTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).UpdateTenant(ctx, req.(*UpdateTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminV1Service_DeleteTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).DeleteTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/DeleteTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).DeleteTenant(ctx, req.(*DeleteTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminV1Service_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminV1ServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.admin_api.v1.AdminV1Service/CreateUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminV1ServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AdminV1Service_ServiceDesc is the grpc.ServiceDesc for AdminV1Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AdminV1Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rapid.admin_api.v1.AdminV1Service", + HandlerType: (*AdminV1ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetTenant", + Handler: _AdminV1Service_GetTenant_Handler, + }, + { + MethodName: "ListTenants", + Handler: _AdminV1Service_ListTenants_Handler, + }, + { + MethodName: "CreateTenant", + Handler: _AdminV1Service_CreateTenant_Handler, + }, + { + MethodName: "UpdateTenant", + Handler: _AdminV1Service_UpdateTenant_Handler, + }, + { + MethodName: "DeleteTenant", + Handler: _AdminV1Service_DeleteTenant_Handler, + }, + { + MethodName: "CreateUser", + Handler: _AdminV1Service_CreateUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rapid/admin_api/v1/admin.proto", +} diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/tenant.pb.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/tenant.pb.go new file mode 100644 index 000000000..4682c048a --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/tenant.pb.go @@ -0,0 +1,777 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/admin_api/v1/tenant.proto + +package admin_apiv1 + +import ( + reflect "reflect" + sync "sync" + + v1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` +} + +func (x *GetTenantRequest) Reset() { + *x = GetTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTenantRequest) ProtoMessage() {} + +func (x *GetTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTenantRequest.ProtoReflect.Descriptor instead. +func (*GetTenantRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{0} +} + +func (x *GetTenantRequest) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +type GetTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenant *v1.Tenant `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` +} + +func (x *GetTenantResponse) Reset() { + *x = GetTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTenantResponse) ProtoMessage() {} + +func (x *GetTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTenantResponse.ProtoReflect.Descriptor instead. +func (*GetTenantResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{1} +} + +func (x *GetTenantResponse) GetTenant() *v1.Tenant { + if x != nil { + return x.Tenant + } + return nil +} + +type ListTenantsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *ListTenantsRequest) Reset() { + *x = ListTenantsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTenantsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTenantsRequest) ProtoMessage() {} + +func (x *ListTenantsRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTenantsRequest.ProtoReflect.Descriptor instead. +func (*ListTenantsRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{2} +} + +func (x *ListTenantsRequest) GetPage() uint64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListTenantsRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +type ListTenantsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenants []*v1.Tenant `protobuf:"bytes,1,rep,name=tenants,proto3" json:"tenants,omitempty"` + Pagination *v1.Pagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *ListTenantsResponse) Reset() { + *x = ListTenantsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTenantsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTenantsResponse) ProtoMessage() {} + +func (x *ListTenantsResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTenantsResponse.ProtoReflect.Descriptor instead. +func (*ListTenantsResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{3} +} + +func (x *ListTenantsResponse) GetTenants() []*v1.Tenant { + if x != nil { + return x.Tenants + } + return nil +} + +func (x *ListTenantsResponse) GetPagination() *v1.Pagination { + if x != nil { + return x.Pagination + } + return nil +} + +type CreateTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CreateTenantRequest) Reset() { + *x = CreateTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTenantRequest) ProtoMessage() {} + +func (x *CreateTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateTenantRequest.ProtoReflect.Descriptor instead. +func (*CreateTenantRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateTenantRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CreateTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenant *v1.Tenant `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` +} + +func (x *CreateTenantResponse) Reset() { + *x = CreateTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTenantResponse) ProtoMessage() {} + +func (x *CreateTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateTenantResponse.ProtoReflect.Descriptor instead. +func (*CreateTenantResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateTenantResponse) GetTenant() *v1.Tenant { + if x != nil { + return x.Tenant + } + return nil +} + +type UpdateTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *UpdateTenantRequest) Reset() { + *x = UpdateTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTenantRequest) ProtoMessage() {} + +func (x *UpdateTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateTenantRequest.ProtoReflect.Descriptor instead. +func (*UpdateTenantRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateTenantRequest) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +func (x *UpdateTenantRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type UpdateTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenant *v1.Tenant `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` +} + +func (x *UpdateTenantResponse) Reset() { + *x = UpdateTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTenantResponse) ProtoMessage() {} + +func (x *UpdateTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateTenantResponse.ProtoReflect.Descriptor instead. +func (*UpdateTenantResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateTenantResponse) GetTenant() *v1.Tenant { + if x != nil { + return x.Tenant + } + return nil +} + +type DeleteTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` +} + +func (x *DeleteTenantRequest) Reset() { + *x = DeleteTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTenantRequest) ProtoMessage() {} + +func (x *DeleteTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTenantRequest.ProtoReflect.Descriptor instead. +func (*DeleteTenantRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteTenantRequest) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +type DeleteTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteTenantResponse) Reset() { + *x = DeleteTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTenantResponse) ProtoMessage() {} + +func (x *DeleteTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_tenant_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTenantResponse.ProtoReflect.Descriptor instead. +func (*DeleteTenantResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_tenant_proto_rawDescGZIP(), []int{9} +} + +var File_rapid_admin_api_v1_tenant_proto protoreflect.FileDescriptor + +var file_rapid_admin_api_v1_tenant_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x42, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, 0xd2, 0x01, 0x09, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x53, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, + 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, + 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x3a, 0x0e, 0x92, 0x41, + 0x0b, 0x0a, 0x09, 0xd2, 0x01, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x12, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xa1, 0x01, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x07, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0xd2, 0x01, 0x07, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x73, 0xd2, 0x01, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x37, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x0c, 0x92, 0x41, 0x09, + 0x0a, 0x07, 0xd2, 0x01, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x56, 0x0a, 0x14, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x3a, 0x0e, 0x92, 0x41, 0x0b, 0x0a, 0x09, 0xd2, 0x01, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x22, 0x59, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, + 0xd2, 0x01, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x14, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x3a, 0x0e, 0x92, 0x41, 0x0b, 0x0a, 0x09, 0xd2, 0x01, 0x06, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x22, 0x45, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, 0xd2, + 0x01, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0xed, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x60, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, + 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, + 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, + 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_admin_api_v1_tenant_proto_rawDescOnce sync.Once + file_rapid_admin_api_v1_tenant_proto_rawDescData = file_rapid_admin_api_v1_tenant_proto_rawDesc +) + +func file_rapid_admin_api_v1_tenant_proto_rawDescGZIP() []byte { + file_rapid_admin_api_v1_tenant_proto_rawDescOnce.Do(func() { + file_rapid_admin_api_v1_tenant_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_admin_api_v1_tenant_proto_rawDescData) + }) + return file_rapid_admin_api_v1_tenant_proto_rawDescData +} + +var file_rapid_admin_api_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_rapid_admin_api_v1_tenant_proto_goTypes = []interface{}{ + (*GetTenantRequest)(nil), // 0: rapid.admin_api.v1.GetTenantRequest + (*GetTenantResponse)(nil), // 1: rapid.admin_api.v1.GetTenantResponse + (*ListTenantsRequest)(nil), // 2: rapid.admin_api.v1.ListTenantsRequest + (*ListTenantsResponse)(nil), // 3: rapid.admin_api.v1.ListTenantsResponse + (*CreateTenantRequest)(nil), // 4: rapid.admin_api.v1.CreateTenantRequest + (*CreateTenantResponse)(nil), // 5: rapid.admin_api.v1.CreateTenantResponse + (*UpdateTenantRequest)(nil), // 6: rapid.admin_api.v1.UpdateTenantRequest + (*UpdateTenantResponse)(nil), // 7: rapid.admin_api.v1.UpdateTenantResponse + (*DeleteTenantRequest)(nil), // 8: rapid.admin_api.v1.DeleteTenantRequest + (*DeleteTenantResponse)(nil), // 9: rapid.admin_api.v1.DeleteTenantResponse + (*v1.Tenant)(nil), // 10: rapid.model.v1.Tenant + (*v1.Pagination)(nil), // 11: rapid.model.v1.Pagination +} +var file_rapid_admin_api_v1_tenant_proto_depIdxs = []int32{ + 10, // 0: rapid.admin_api.v1.GetTenantResponse.tenant:type_name -> rapid.model.v1.Tenant + 10, // 1: rapid.admin_api.v1.ListTenantsResponse.tenants:type_name -> rapid.model.v1.Tenant + 11, // 2: rapid.admin_api.v1.ListTenantsResponse.pagination:type_name -> rapid.model.v1.Pagination + 10, // 3: rapid.admin_api.v1.CreateTenantResponse.tenant:type_name -> rapid.model.v1.Tenant + 10, // 4: rapid.admin_api.v1.UpdateTenantResponse.tenant:type_name -> rapid.model.v1.Tenant + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_rapid_admin_api_v1_tenant_proto_init() } +func file_rapid_admin_api_v1_tenant_proto_init() { + if File_rapid_admin_api_v1_tenant_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_admin_api_v1_tenant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTenantsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTenantsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_tenant_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_admin_api_v1_tenant_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_admin_api_v1_tenant_proto_goTypes, + DependencyIndexes: file_rapid_admin_api_v1_tenant_proto_depIdxs, + MessageInfos: file_rapid_admin_api_v1_tenant_proto_msgTypes, + }.Build() + File_rapid_admin_api_v1_tenant_proto = out.File + file_rapid_admin_api_v1_tenant_proto_rawDesc = nil + file_rapid_admin_api_v1_tenant_proto_goTypes = nil + file_rapid_admin_api_v1_tenant_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/admin_api/v1/user.pb.go b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/user.pb.go new file mode 100644 index 000000000..fe0b0d26c --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/admin_api/v1/user.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/admin_api/v1/user.proto + +package admin_apiv1 + +import ( + reflect "reflect" + sync "sync" + + v1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Role v1.UserRole `protobuf:"varint,4,opt,name=role,proto3,enum=rapid.model.v1.UserRole" json:"role,omitempty"` +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateUserRequest) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +func (x *CreateUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *CreateUserRequest) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *CreateUserRequest) GetRole() v1.UserRole { + if x != nil { + return x.Role + } + return v1.UserRole(0) +} + +type CreateUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *v1.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *CreateUserResponse) Reset() { + *x = CreateUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_admin_api_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserResponse) ProtoMessage() {} + +func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_admin_api_v1_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. +func (*CreateUserResponse) Descriptor() ([]byte, []int) { + return file_rapid_admin_api_v1_user_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateUserResponse) GetUser() *v1.User { + if x != nil { + return x.User + } + return nil +} + +var File_rapid_admin_api_v1_user_proto protoreflect.FileDescriptor + +var file_rapid_admin_api_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x12, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, + 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, + 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x3a, 0x2f, 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0xd2, + 0x01, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0xd2, 0x01, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0xd2, 0x01, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x4c, 0x0a, 0x12, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x3a, 0x0c, 0x92, 0x41, 0x09, 0x0a, 0x07, + 0xd2, 0x01, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0xeb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, + 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x60, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, + 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, + 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x52, 0x61, + 0x70, 0x69, 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1d, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, + 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_admin_api_v1_user_proto_rawDescOnce sync.Once + file_rapid_admin_api_v1_user_proto_rawDescData = file_rapid_admin_api_v1_user_proto_rawDesc +) + +func file_rapid_admin_api_v1_user_proto_rawDescGZIP() []byte { + file_rapid_admin_api_v1_user_proto_rawDescOnce.Do(func() { + file_rapid_admin_api_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_admin_api_v1_user_proto_rawDescData) + }) + return file_rapid_admin_api_v1_user_proto_rawDescData +} + +var file_rapid_admin_api_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rapid_admin_api_v1_user_proto_goTypes = []interface{}{ + (*CreateUserRequest)(nil), // 0: rapid.admin_api.v1.CreateUserRequest + (*CreateUserResponse)(nil), // 1: rapid.admin_api.v1.CreateUserResponse + (v1.UserRole)(0), // 2: rapid.model.v1.UserRole + (*v1.User)(nil), // 3: rapid.model.v1.User +} +var file_rapid_admin_api_v1_user_proto_depIdxs = []int32{ + 2, // 0: rapid.admin_api.v1.CreateUserRequest.role:type_name -> rapid.model.v1.UserRole + 3, // 1: rapid.admin_api.v1.CreateUserResponse.user:type_name -> rapid.model.v1.User + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_rapid_admin_api_v1_user_proto_init() } +func file_rapid_admin_api_v1_user_proto_init() { + if File_rapid_admin_api_v1_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_admin_api_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_admin_api_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_admin_api_v1_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_admin_api_v1_user_proto_goTypes, + DependencyIndexes: file_rapid_admin_api_v1_user_proto_depIdxs, + MessageInfos: file_rapid_admin_api_v1_user_proto_msgTypes, + }.Build() + File_rapid_admin_api_v1_user_proto = out.File + file_rapid_admin_api_v1_user_proto_rawDesc = nil + file_rapid_admin_api_v1_user_proto_goTypes = nil + file_rapid_admin_api_v1_user_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.go b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.go new file mode 100644 index 000000000..5040153ad --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.go @@ -0,0 +1,243 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/debug_api/v1/debug.proto + +package debug_apiv1 + +import ( + reflect "reflect" + sync "sync" + + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateIDTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthUid string `protobuf:"bytes,1,opt,name=auth_uid,json=authUid,proto3" json:"auth_uid,omitempty"` +} + +func (x *CreateIDTokenRequest) Reset() { + *x = CreateIDTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_debug_api_v1_debug_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIDTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIDTokenRequest) ProtoMessage() {} + +func (x *CreateIDTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_debug_api_v1_debug_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIDTokenRequest.ProtoReflect.Descriptor instead. +func (*CreateIDTokenRequest) Descriptor() ([]byte, []int) { + return file_rapid_debug_api_v1_debug_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateIDTokenRequest) GetAuthUid() string { + if x != nil { + return x.AuthUid + } + return "" +} + +type CreateIDTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdToken string `protobuf:"bytes,1,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty"` +} + +func (x *CreateIDTokenResponse) Reset() { + *x = CreateIDTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_debug_api_v1_debug_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIDTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIDTokenResponse) ProtoMessage() {} + +func (x *CreateIDTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_debug_api_v1_debug_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIDTokenResponse.ProtoReflect.Descriptor instead. +func (*CreateIDTokenResponse) Descriptor() ([]byte, []int) { + return file_rapid_debug_api_v1_debug_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateIDTokenResponse) GetIdToken() string { + if x != nil { + return x.IdToken + } + return "" +} + +var File_rapid_debug_api_v1_debug_proto protoreflect.FileDescriptor + +var file_rapid_debug_api_v1_debug_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x44, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, + 0x74, 0x68, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, + 0x74, 0x68, 0x55, 0x69, 0x64, 0x3a, 0x10, 0x92, 0x41, 0x0d, 0x0a, 0x0b, 0xd2, 0x01, 0x08, 0x61, + 0x75, 0x74, 0x68, 0x5f, 0x75, 0x69, 0x64, 0x22, 0x44, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x49, 0x44, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x10, 0x92, 0x41, 0x0d, + 0x0a, 0x0b, 0xd2, 0x01, 0x08, 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x96, 0x01, + 0x0a, 0x0e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x56, 0x31, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x83, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x44, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x28, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x44, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x72, + 0x61, 0x70, 0x69, 0x64, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x44, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, + 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x64, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0xec, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, + 0x61, 0x70, 0x69, 0x64, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x44, 0x65, 0x62, 0x75, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x60, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, + 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, + 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x61, 0x70, 0x69, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x58, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, + 0x44, 0x65, 0x62, 0x75, 0x67, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x52, 0x61, + 0x70, 0x69, 0x64, 0x5c, 0x44, 0x65, 0x62, 0x75, 0x67, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1d, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x44, 0x65, 0x62, 0x75, 0x67, 0x41, 0x70, 0x69, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x44, 0x65, 0x62, 0x75, 0x67, 0x41, 0x70, + 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_debug_api_v1_debug_proto_rawDescOnce sync.Once + file_rapid_debug_api_v1_debug_proto_rawDescData = file_rapid_debug_api_v1_debug_proto_rawDesc +) + +func file_rapid_debug_api_v1_debug_proto_rawDescGZIP() []byte { + file_rapid_debug_api_v1_debug_proto_rawDescOnce.Do(func() { + file_rapid_debug_api_v1_debug_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_debug_api_v1_debug_proto_rawDescData) + }) + return file_rapid_debug_api_v1_debug_proto_rawDescData +} + +var file_rapid_debug_api_v1_debug_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rapid_debug_api_v1_debug_proto_goTypes = []interface{}{ + (*CreateIDTokenRequest)(nil), // 0: rapid.debug_api.v1.CreateIDTokenRequest + (*CreateIDTokenResponse)(nil), // 1: rapid.debug_api.v1.CreateIDTokenResponse +} +var file_rapid_debug_api_v1_debug_proto_depIdxs = []int32{ + 0, // 0: rapid.debug_api.v1.DebugV1Service.CreateIDToken:input_type -> rapid.debug_api.v1.CreateIDTokenRequest + 1, // 1: rapid.debug_api.v1.DebugV1Service.CreateIDToken:output_type -> rapid.debug_api.v1.CreateIDTokenResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rapid_debug_api_v1_debug_proto_init() } +func file_rapid_debug_api_v1_debug_proto_init() { + if File_rapid_debug_api_v1_debug_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_debug_api_v1_debug_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIDTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_debug_api_v1_debug_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIDTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_debug_api_v1_debug_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rapid_debug_api_v1_debug_proto_goTypes, + DependencyIndexes: file_rapid_debug_api_v1_debug_proto_depIdxs, + MessageInfos: file_rapid_debug_api_v1_debug_proto_msgTypes, + }.Build() + File_rapid_debug_api_v1_debug_proto = out.File + file_rapid_debug_api_v1_debug_proto_rawDesc = nil + file_rapid_debug_api_v1_debug_proto_goTypes = nil + file_rapid_debug_api_v1_debug_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.gw.go new file mode 100644 index 000000000..3f6b83487 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug.pb.gw.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: rapid/debug_api/v1/debug.proto + +/* +Package debug_apiv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package debug_apiv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_DebugV1Service_CreateIDToken_0(ctx context.Context, marshaler runtime.Marshaler, client DebugV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIDTokenRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateIDToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DebugV1Service_CreateIDToken_0(ctx context.Context, marshaler runtime.Marshaler, server DebugV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIDTokenRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateIDToken(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterDebugV1ServiceHandlerServer registers the http handlers for service DebugV1Service to "mux". +// UnaryRPC :call DebugV1ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDebugV1ServiceHandlerFromEndpoint instead. +func RegisterDebugV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DebugV1ServiceServer) error { + + mux.Handle("POST", pattern_DebugV1Service_CreateIDToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateIDToken", runtime.WithHTTPPathPattern("/debug/v1/id_token")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DebugV1Service_CreateIDToken_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DebugV1Service_CreateIDToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterDebugV1ServiceHandlerFromEndpoint is same as RegisterDebugV1ServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDebugV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDebugV1ServiceHandler(ctx, mux, conn) +} + +// RegisterDebugV1ServiceHandler registers the http handlers for service DebugV1Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDebugV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error { + return RegisterDebugV1ServiceHandlerClient(ctx, mux, NewDebugV1ServiceClient(conn)) +} + +// RegisterDebugV1ServiceHandlerClient registers the http handlers for service DebugV1Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugV1ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugV1ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DebugV1ServiceClient" to call the correct interceptors. +func RegisterDebugV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugV1ServiceClient) error { + + mux.Handle("POST", pattern_DebugV1Service_CreateIDToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.debug_api.v1.DebugV1Service/CreateIDToken", runtime.WithHTTPPathPattern("/debug/v1/id_token")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DebugV1Service_CreateIDToken_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_DebugV1Service_CreateIDToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DebugV1Service_CreateIDToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"debug", "v1", "id_token"}, "")) +) + +var ( + forward_DebugV1Service_CreateIDToken_0 = runtime.ForwardResponseMessage +) diff --git a/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug_grpc.pb.go b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug_grpc.pb.go new file mode 100644 index 000000000..ceaa29f23 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/debug_api/v1/debug_grpc.pb.go @@ -0,0 +1,100 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package debug_apiv1 + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DebugV1ServiceClient is the client API for DebugV1Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DebugV1ServiceClient interface { + CreateIDToken(ctx context.Context, in *CreateIDTokenRequest, opts ...grpc.CallOption) (*CreateIDTokenResponse, error) +} + +type debugV1ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDebugV1ServiceClient(cc grpc.ClientConnInterface) DebugV1ServiceClient { + return &debugV1ServiceClient{cc} +} + +func (c *debugV1ServiceClient) CreateIDToken(ctx context.Context, in *CreateIDTokenRequest, opts ...grpc.CallOption) (*CreateIDTokenResponse, error) { + out := new(CreateIDTokenResponse) + err := c.cc.Invoke(ctx, "/rapid.debug_api.v1.DebugV1Service/CreateIDToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DebugV1ServiceServer is the server API for DebugV1Service service. +// All implementations should embed UnimplementedDebugV1ServiceServer +// for forward compatibility +type DebugV1ServiceServer interface { + CreateIDToken(context.Context, *CreateIDTokenRequest) (*CreateIDTokenResponse, error) +} + +// UnimplementedDebugV1ServiceServer should be embedded to have forward compatible implementations. +type UnimplementedDebugV1ServiceServer struct { +} + +func (UnimplementedDebugV1ServiceServer) CreateIDToken(context.Context, *CreateIDTokenRequest) (*CreateIDTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIDToken not implemented") +} + +// UnsafeDebugV1ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DebugV1ServiceServer will +// result in compilation errors. +type UnsafeDebugV1ServiceServer interface { + mustEmbedUnimplementedDebugV1ServiceServer() +} + +func RegisterDebugV1ServiceServer(s grpc.ServiceRegistrar, srv DebugV1ServiceServer) { + s.RegisterService(&DebugV1Service_ServiceDesc, srv) +} + +func _DebugV1Service_CreateIDToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIDTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DebugV1ServiceServer).CreateIDToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.debug_api.v1.DebugV1Service/CreateIDToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DebugV1ServiceServer).CreateIDToken(ctx, req.(*CreateIDTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DebugV1Service_ServiceDesc is the grpc.ServiceDesc for DebugV1Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DebugV1Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rapid.debug_api.v1.DebugV1Service", + HandlerType: (*DebugV1ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateIDToken", + Handler: _DebugV1Service_CreateIDToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rapid/debug_api/v1/debug.proto", +} diff --git a/internal/infrastructure/grpc/pb/rapid/model/v1/pagination.pb.go b/internal/infrastructure/grpc/pb/rapid/model/v1/pagination.pb.go new file mode 100644 index 000000000..4319f69fc --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/model/v1/pagination.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/model/v1/pagination.proto + +package modelv1 + +import ( + reflect "reflect" + sync "sync" + + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Pagination struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CurrentPage uint64 `protobuf:"varint,1,opt,name=current_page,json=currentPage,proto3" json:"current_page,omitempty"` + PrevPage uint64 `protobuf:"varint,2,opt,name=prev_page,json=prevPage,proto3" json:"prev_page,omitempty"` + NextPage uint64 `protobuf:"varint,3,opt,name=next_page,json=nextPage,proto3" json:"next_page,omitempty"` + TotalPage uint64 `protobuf:"varint,4,opt,name=total_page,json=totalPage,proto3" json:"total_page,omitempty"` + TotalCount uint64 `protobuf:"varint,5,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + HasNext bool `protobuf:"varint,6,opt,name=has_next,json=hasNext,proto3" json:"has_next,omitempty"` +} + +func (x *Pagination) Reset() { + *x = Pagination{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_model_v1_pagination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pagination) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pagination) ProtoMessage() {} + +func (x *Pagination) ProtoReflect() protoreflect.Message { + mi := &file_rapid_model_v1_pagination_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pagination.ProtoReflect.Descriptor instead. +func (*Pagination) Descriptor() ([]byte, []int) { + return file_rapid_model_v1_pagination_proto_rawDescGZIP(), []int{0} +} + +func (x *Pagination) GetCurrentPage() uint64 { + if x != nil { + return x.CurrentPage + } + return 0 +} + +func (x *Pagination) GetPrevPage() uint64 { + if x != nil { + return x.PrevPage + } + return 0 +} + +func (x *Pagination) GetNextPage() uint64 { + if x != nil { + return x.NextPage + } + return 0 +} + +func (x *Pagination) GetTotalPage() uint64 { + if x != nil { + return x.TotalPage + } + return 0 +} + +func (x *Pagination) GetTotalCount() uint64 { + if x != nil { + return x.TotalCount + } + return 0 +} + +func (x *Pagination) GetHasNext() bool { + if x != nil { + return x.HasNext + } + return false +} + +var File_rapid_model_v1_pagination_proto protoreflect.FileDescriptor + +var file_rapid_model_v1_pagination_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, + 0x31, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x80, 0x02, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x50, 0x61, 0x67, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x3a, 0x3a, 0x92, 0x41, 0x37, 0x0a, 0x35, 0xd2, + 0x01, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0xd2, 0x01, + 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x67, 0x65, 0xd2, 0x01, 0x0b, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0xd2, 0x01, 0x08, 0x68, 0x61, 0x73, 0x5f, + 0x6e, 0x65, 0x78, 0x74, 0x42, 0xd9, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x50, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, + 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, + 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, + 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x4d, 0x58, 0xaa, 0x02, + 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1a, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_model_v1_pagination_proto_rawDescOnce sync.Once + file_rapid_model_v1_pagination_proto_rawDescData = file_rapid_model_v1_pagination_proto_rawDesc +) + +func file_rapid_model_v1_pagination_proto_rawDescGZIP() []byte { + file_rapid_model_v1_pagination_proto_rawDescOnce.Do(func() { + file_rapid_model_v1_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_model_v1_pagination_proto_rawDescData) + }) + return file_rapid_model_v1_pagination_proto_rawDescData +} + +var file_rapid_model_v1_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_rapid_model_v1_pagination_proto_goTypes = []interface{}{ + (*Pagination)(nil), // 0: rapid.model.v1.Pagination +} +var file_rapid_model_v1_pagination_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rapid_model_v1_pagination_proto_init() } +func file_rapid_model_v1_pagination_proto_init() { + if File_rapid_model_v1_pagination_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_model_v1_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pagination); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_model_v1_pagination_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_model_v1_pagination_proto_goTypes, + DependencyIndexes: file_rapid_model_v1_pagination_proto_depIdxs, + MessageInfos: file_rapid_model_v1_pagination_proto_msgTypes, + }.Build() + File_rapid_model_v1_pagination_proto = out.File + file_rapid_model_v1_pagination_proto_rawDesc = nil + file_rapid_model_v1_pagination_proto_goTypes = nil + file_rapid_model_v1_pagination_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/model/v1/tenant.pb.go b/internal/infrastructure/grpc/pb/rapid/model/v1/tenant.pb.go new file mode 100644 index 000000000..d45703596 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/model/v1/tenant.pb.go @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/model/v1/tenant.proto + +package modelv1 + +import ( + reflect "reflect" + sync "sync" + + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Tenant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *Tenant) Reset() { + *x = Tenant{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_model_v1_tenant_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tenant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tenant) ProtoMessage() {} + +func (x *Tenant) ProtoReflect() protoreflect.Message { + mi := &file_rapid_model_v1_tenant_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tenant.ProtoReflect.Descriptor instead. +func (*Tenant) Descriptor() ([]byte, []int) { + return file_rapid_model_v1_tenant_proto_rawDescGZIP(), []int{0} +} + +func (x *Tenant) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Tenant) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Tenant) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Tenant) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +var File_rapid_model_v1_tenant_proto protoreflect.FileDescriptor + +var file_rapid_model_v1_tenant_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x72, + 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, + 0x01, 0x0a, 0x06, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x3a, 0x2b, 0x92, 0x41, 0x28, 0x0a, 0x26, 0xd2, 0x01, 0x02, 0x69, 0x64, 0xd2, + 0x01, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0xd2, 0x01, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x42, 0xd5, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, + 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x52, 0x4d, 0x58, 0xaa, 0x02, 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, + 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x52, 0x61, 0x70, 0x69, 0x64, + 0x5c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_model_v1_tenant_proto_rawDescOnce sync.Once + file_rapid_model_v1_tenant_proto_rawDescData = file_rapid_model_v1_tenant_proto_rawDesc +) + +func file_rapid_model_v1_tenant_proto_rawDescGZIP() []byte { + file_rapid_model_v1_tenant_proto_rawDescOnce.Do(func() { + file_rapid_model_v1_tenant_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_model_v1_tenant_proto_rawDescData) + }) + return file_rapid_model_v1_tenant_proto_rawDescData +} + +var file_rapid_model_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_rapid_model_v1_tenant_proto_goTypes = []interface{}{ + (*Tenant)(nil), // 0: rapid.model.v1.Tenant + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_rapid_model_v1_tenant_proto_depIdxs = []int32{ + 1, // 0: rapid.model.v1.Tenant.created_at:type_name -> google.protobuf.Timestamp + 1, // 1: rapid.model.v1.Tenant.updated_at:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_rapid_model_v1_tenant_proto_init() } +func file_rapid_model_v1_tenant_proto_init() { + if File_rapid_model_v1_tenant_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_model_v1_tenant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tenant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_model_v1_tenant_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_model_v1_tenant_proto_goTypes, + DependencyIndexes: file_rapid_model_v1_tenant_proto_depIdxs, + MessageInfos: file_rapid_model_v1_tenant_proto_msgTypes, + }.Build() + File_rapid_model_v1_tenant_proto = out.File + file_rapid_model_v1_tenant_proto_rawDesc = nil + file_rapid_model_v1_tenant_proto_goTypes = nil + file_rapid_model_v1_tenant_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/model/v1/user.pb.go b/internal/infrastructure/grpc/pb/rapid/model/v1/user.pb.go new file mode 100644 index 000000000..48fa71830 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/model/v1/user.pb.go @@ -0,0 +1,319 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/model/v1/user.proto + +package modelv1 + +import ( + reflect "reflect" + sync "sync" + + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UserRole int32 + +const ( + UserRole_USER_ROLE_UNSPECIFIED UserRole = 0 + UserRole_USER_ROLE_NORMAL UserRole = 1 + UserRole_USER_ROLE_ADMIN UserRole = 2 +) + +// Enum value maps for UserRole. +var ( + UserRole_name = map[int32]string{ + 0: "USER_ROLE_UNSPECIFIED", + 1: "USER_ROLE_NORMAL", + 2: "USER_ROLE_ADMIN", + } + UserRole_value = map[string]int32{ + "USER_ROLE_UNSPECIFIED": 0, + "USER_ROLE_NORMAL": 1, + "USER_ROLE_ADMIN": 2, + } +) + +func (x UserRole) Enum() *UserRole { + p := new(UserRole) + *p = x + return p +} + +func (x UserRole) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserRole) Descriptor() protoreflect.EnumDescriptor { + return file_rapid_model_v1_user_proto_enumTypes[0].Descriptor() +} + +func (UserRole) Type() protoreflect.EnumType { + return &file_rapid_model_v1_user_proto_enumTypes[0] +} + +func (x UserRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserRole.Descriptor instead. +func (UserRole) EnumDescriptor() ([]byte, []int) { + return file_rapid_model_v1_user_proto_rawDescGZIP(), []int{0} +} + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Role UserRole `protobuf:"varint,2,opt,name=role,proto3,enum=rapid.model.v1.UserRole" json:"role,omitempty"` + AuthUid string `protobuf:"bytes,3,opt,name=auth_uid,json=authUid,proto3" json:"auth_uid,omitempty"` + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + ImageUrl string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Tenant *Tenant `protobuf:"bytes,9,opt,name=tenant,proto3" json:"tenant,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_model_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_rapid_model_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_rapid_model_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetRole() UserRole { + if x != nil { + return x.Role + } + return UserRole_USER_ROLE_UNSPECIFIED +} + +func (x *User) GetAuthUid() string { + if x != nil { + return x.AuthUid + } + return "" +} + +func (x *User) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *User) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *User) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *User) GetTenant() *Tenant { + if x != nil { + return x.Tenant + } + return nil +} + +var File_rapid_model_v1_user_proto protoreflect.FileDescriptor + +var file_rapid_model_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, + 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x72, 0x61, 0x70, + 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x72, 0x61, + 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x03, 0x0a, 0x04, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x18, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, + 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x3a, 0x62, 0x92, 0x41, 0x5f, 0x0a, 0x5d, 0xd2, 0x01, + 0x02, 0x69, 0x64, 0xd2, 0x01, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0xd2, 0x01, 0x08, 0x61, 0x75, 0x74, + 0x68, 0x5f, 0x75, 0x69, 0x64, 0xd2, 0x01, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, + 0xd2, 0x01, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0xd2, 0x01, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0xd2, 0x01, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0xd2, 0x01, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2a, 0x50, 0x0a, 0x08, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, + 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, + 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, + 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x42, 0xd3, 0x01, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x58, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, + 0x79, 0x73, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, + 0x66, 0x72, 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x4d, + 0x58, 0xaa, 0x02, 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0e, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x10, 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_model_v1_user_proto_rawDescOnce sync.Once + file_rapid_model_v1_user_proto_rawDescData = file_rapid_model_v1_user_proto_rawDesc +) + +func file_rapid_model_v1_user_proto_rawDescGZIP() []byte { + file_rapid_model_v1_user_proto_rawDescOnce.Do(func() { + file_rapid_model_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_model_v1_user_proto_rawDescData) + }) + return file_rapid_model_v1_user_proto_rawDescData +} + +var file_rapid_model_v1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_rapid_model_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_rapid_model_v1_user_proto_goTypes = []interface{}{ + (UserRole)(0), // 0: rapid.model.v1.UserRole + (*User)(nil), // 1: rapid.model.v1.User + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*Tenant)(nil), // 3: rapid.model.v1.Tenant +} +var file_rapid_model_v1_user_proto_depIdxs = []int32{ + 0, // 0: rapid.model.v1.User.role:type_name -> rapid.model.v1.UserRole + 2, // 1: rapid.model.v1.User.created_at:type_name -> google.protobuf.Timestamp + 2, // 2: rapid.model.v1.User.updated_at:type_name -> google.protobuf.Timestamp + 3, // 3: rapid.model.v1.User.tenant:type_name -> rapid.model.v1.Tenant + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_rapid_model_v1_user_proto_init() } +func file_rapid_model_v1_user_proto_init() { + if File_rapid_model_v1_user_proto != nil { + return + } + file_rapid_model_v1_tenant_proto_init() + if !protoimpl.UnsafeEnabled { + file_rapid_model_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_model_v1_user_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_model_v1_user_proto_goTypes, + DependencyIndexes: file_rapid_model_v1_user_proto_depIdxs, + EnumInfos: file_rapid_model_v1_user_proto_enumTypes, + MessageInfos: file_rapid_model_v1_user_proto_msgTypes, + }.Build() + File_rapid_model_v1_user_proto = out.File + file_rapid_model_v1_user_proto_rawDesc = nil + file_rapid_model_v1_user_proto_goTypes = nil + file_rapid_model_v1_user_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/authentication.pb.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/authentication.pb.go new file mode 100644 index 000000000..00f0f6cc4 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/authentication.pb.go @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/public_api/v1/authentication.proto + +package public_apiv1 + +import ( + reflect "reflect" + sync "sync" + + v1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type SignInRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SignInRequest) Reset() { + *x = SignInRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_public_api_v1_authentication_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInRequest) ProtoMessage() {} + +func (x *SignInRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_public_api_v1_authentication_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead. +func (*SignInRequest) Descriptor() ([]byte, []int) { + return file_rapid_public_api_v1_authentication_proto_rawDescGZIP(), []int{0} +} + +type SignInResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *v1.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *SignInResponse) Reset() { + *x = SignInResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_public_api_v1_authentication_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInResponse) ProtoMessage() {} + +func (x *SignInResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_public_api_v1_authentication_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignInResponse.ProtoReflect.Descriptor instead. +func (*SignInResponse) Descriptor() ([]byte, []int) { + return file_rapid_public_api_v1_authentication_proto_rawDescGZIP(), []int{1} +} + +func (x *SignInResponse) GetUser() *v1.User { + if x != nil { + return x.User + } + return nil +} + +var File_rapid_public_api_v1_authentication_proto protoreflect.FileDescriptor + +var file_rapid_public_api_v1_authentication_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, + 0x19, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x69, + 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0e, 0x53, + 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x61, + 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x3a, 0x0c, 0x92, 0x41, 0x09, 0x0a, 0x07, 0xd2, 0x01, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0xfc, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, + 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x42, 0x13, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x62, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, + 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, + 0x50, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, + 0x61, 0x70, 0x69, 0x64, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_public_api_v1_authentication_proto_rawDescOnce sync.Once + file_rapid_public_api_v1_authentication_proto_rawDescData = file_rapid_public_api_v1_authentication_proto_rawDesc +) + +func file_rapid_public_api_v1_authentication_proto_rawDescGZIP() []byte { + file_rapid_public_api_v1_authentication_proto_rawDescOnce.Do(func() { + file_rapid_public_api_v1_authentication_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_public_api_v1_authentication_proto_rawDescData) + }) + return file_rapid_public_api_v1_authentication_proto_rawDescData +} + +var file_rapid_public_api_v1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rapid_public_api_v1_authentication_proto_goTypes = []interface{}{ + (*SignInRequest)(nil), // 0: rapid.public_api.v1.SignInRequest + (*SignInResponse)(nil), // 1: rapid.public_api.v1.SignInResponse + (*v1.User)(nil), // 2: rapid.model.v1.User +} +var file_rapid_public_api_v1_authentication_proto_depIdxs = []int32{ + 2, // 0: rapid.public_api.v1.SignInResponse.user:type_name -> rapid.model.v1.User + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rapid_public_api_v1_authentication_proto_init() } +func file_rapid_public_api_v1_authentication_proto_init() { + if File_rapid_public_api_v1_authentication_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_public_api_v1_authentication_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_public_api_v1_authentication_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_public_api_v1_authentication_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_public_api_v1_authentication_proto_goTypes, + DependencyIndexes: file_rapid_public_api_v1_authentication_proto_depIdxs, + MessageInfos: file_rapid_public_api_v1_authentication_proto_msgTypes, + }.Build() + File_rapid_public_api_v1_authentication_proto = out.File + file_rapid_public_api_v1_authentication_proto_rawDesc = nil + file_rapid_public_api_v1_authentication_proto_goTypes = nil + file_rapid_public_api_v1_authentication_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.go new file mode 100644 index 000000000..9ca4188eb --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/public_api/v1/public.proto + +package public_apiv1 + +import ( + reflect "reflect" + + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_rapid_public_api_v1_public_proto protoreflect.FileDescriptor + +var file_rapid_public_api_v1_public_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xf9, 0x01, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x56, 0x31, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x12, + 0x22, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, + 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x6e, + 0x12, 0x7b, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x25, 0x2e, + 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xf4, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x62, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, + 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, + 0x50, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, + 0x61, 0x70, 0x69, 0x64, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_rapid_public_api_v1_public_proto_goTypes = []interface{}{ + (*SignInRequest)(nil), // 0: rapid.public_api.v1.SignInRequest + (*GetTenantRequest)(nil), // 1: rapid.public_api.v1.GetTenantRequest + (*SignInResponse)(nil), // 2: rapid.public_api.v1.SignInResponse + (*GetTenantResponse)(nil), // 3: rapid.public_api.v1.GetTenantResponse +} +var file_rapid_public_api_v1_public_proto_depIdxs = []int32{ + 0, // 0: rapid.public_api.v1.PublicV1Service.SignIn:input_type -> rapid.public_api.v1.SignInRequest + 1, // 1: rapid.public_api.v1.PublicV1Service.GetTenant:input_type -> rapid.public_api.v1.GetTenantRequest + 2, // 2: rapid.public_api.v1.PublicV1Service.SignIn:output_type -> rapid.public_api.v1.SignInResponse + 3, // 3: rapid.public_api.v1.PublicV1Service.GetTenant:output_type -> rapid.public_api.v1.GetTenantResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rapid_public_api_v1_public_proto_init() } +func file_rapid_public_api_v1_public_proto_init() { + if File_rapid_public_api_v1_public_proto != nil { + return + } + file_rapid_public_api_v1_tenant_proto_init() + file_rapid_public_api_v1_authentication_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_public_api_v1_public_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rapid_public_api_v1_public_proto_goTypes, + DependencyIndexes: file_rapid_public_api_v1_public_proto_depIdxs, + }.Build() + File_rapid_public_api_v1_public_proto = out.File + file_rapid_public_api_v1_public_proto_rawDesc = nil + file_rapid_public_api_v1_public_proto_goTypes = nil + file_rapid_public_api_v1_public_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.gw.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.gw.go new file mode 100644 index 000000000..6dbd51397 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public.pb.gw.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: rapid/public_api/v1/public.proto + +/* +Package public_apiv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package public_apiv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_PublicV1Service_SignIn_0(ctx context.Context, marshaler runtime.Marshaler, client PublicV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SignInRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SignIn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PublicV1Service_SignIn_0(ctx context.Context, marshaler runtime.Marshaler, server PublicV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SignInRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SignIn(ctx, &protoReq) + return msg, metadata, err + +} + +func request_PublicV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, client PublicV1ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := client.GetTenant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PublicV1Service_GetTenant_0(ctx context.Context, marshaler runtime.Marshaler, server PublicV1ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTenantRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tenant_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id") + } + + protoReq.TenantId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err) + } + + msg, err := server.GetTenant(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterPublicV1ServiceHandlerServer registers the http handlers for service PublicV1Service to "mux". +// UnaryRPC :call PublicV1ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPublicV1ServiceHandlerFromEndpoint instead. +func RegisterPublicV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicV1ServiceServer) error { + + mux.Handle("POST", pattern_PublicV1Service_SignIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/SignIn", runtime.WithHTTPPathPattern("/v1/sign_in")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PublicV1Service_SignIn_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PublicV1Service_SignIn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PublicV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/GetTenant", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PublicV1Service_GetTenant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PublicV1Service_GetTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterPublicV1ServiceHandlerFromEndpoint is same as RegisterPublicV1ServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterPublicV1ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterPublicV1ServiceHandler(ctx, mux, conn) +} + +// RegisterPublicV1ServiceHandler registers the http handlers for service PublicV1Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterPublicV1ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error { + return RegisterPublicV1ServiceHandlerClient(ctx, mux, NewPublicV1ServiceClient(conn)) +} + +// RegisterPublicV1ServiceHandlerClient registers the http handlers for service PublicV1Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PublicV1ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PublicV1ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "PublicV1ServiceClient" to call the correct interceptors. +func RegisterPublicV1ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicV1ServiceClient) error { + + mux.Handle("POST", pattern_PublicV1Service_SignIn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/SignIn", runtime.WithHTTPPathPattern("/v1/sign_in")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PublicV1Service_SignIn_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PublicV1Service_SignIn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_PublicV1Service_GetTenant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rapid.public_api.v1.PublicV1Service/GetTenant", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PublicV1Service_GetTenant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PublicV1Service_GetTenant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_PublicV1Service_SignIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "sign_in"}, "")) + + pattern_PublicV1Service_GetTenant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "tenants", "tenant_id"}, "")) +) + +var ( + forward_PublicV1Service_SignIn_0 = runtime.ForwardResponseMessage + + forward_PublicV1Service_GetTenant_0 = runtime.ForwardResponseMessage +) diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/public_grpc.pb.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public_grpc.pb.go new file mode 100644 index 000000000..9b9da4636 --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/public_grpc.pb.go @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package public_apiv1 + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PublicV1ServiceClient is the client API for PublicV1Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PublicV1ServiceClient interface { + SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) + GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error) +} + +type publicV1ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPublicV1ServiceClient(cc grpc.ClientConnInterface) PublicV1ServiceClient { + return &publicV1ServiceClient{cc} +} + +func (c *publicV1ServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) { + out := new(SignInResponse) + err := c.cc.Invoke(ctx, "/rapid.public_api.v1.PublicV1Service/SignIn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publicV1ServiceClient) GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error) { + out := new(GetTenantResponse) + err := c.cc.Invoke(ctx, "/rapid.public_api.v1.PublicV1Service/GetTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PublicV1ServiceServer is the server API for PublicV1Service service. +// All implementations should embed UnimplementedPublicV1ServiceServer +// for forward compatibility +type PublicV1ServiceServer interface { + SignIn(context.Context, *SignInRequest) (*SignInResponse, error) + GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error) +} + +// UnimplementedPublicV1ServiceServer should be embedded to have forward compatible implementations. +type UnimplementedPublicV1ServiceServer struct { +} + +func (UnimplementedPublicV1ServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented") +} +func (UnimplementedPublicV1ServiceServer) GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTenant not implemented") +} + +// UnsafePublicV1ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PublicV1ServiceServer will +// result in compilation errors. +type UnsafePublicV1ServiceServer interface { + mustEmbedUnimplementedPublicV1ServiceServer() +} + +func RegisterPublicV1ServiceServer(s grpc.ServiceRegistrar, srv PublicV1ServiceServer) { + s.RegisterService(&PublicV1Service_ServiceDesc, srv) +} + +func _PublicV1Service_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignInRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublicV1ServiceServer).SignIn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.public_api.v1.PublicV1Service/SignIn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublicV1ServiceServer).SignIn(ctx, req.(*SignInRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PublicV1Service_GetTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublicV1ServiceServer).GetTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rapid.public_api.v1.PublicV1Service/GetTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublicV1ServiceServer).GetTenant(ctx, req.(*GetTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PublicV1Service_ServiceDesc is the grpc.ServiceDesc for PublicV1Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PublicV1Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rapid.public_api.v1.PublicV1Service", + HandlerType: (*PublicV1ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SignIn", + Handler: _PublicV1Service_SignIn_Handler, + }, + { + MethodName: "GetTenant", + Handler: _PublicV1Service_GetTenant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rapid/public_api/v1/public.proto", +} diff --git a/internal/infrastructure/grpc/pb/rapid/public_api/v1/tenant.pb.go b/internal/infrastructure/grpc/pb/rapid/public_api/v1/tenant.pb.go new file mode 100644 index 000000000..cf9c2b35a --- /dev/null +++ b/internal/infrastructure/grpc/pb/rapid/public_api/v1/tenant.pb.go @@ -0,0 +1,235 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: rapid/public_api/v1/tenant.proto + +package public_apiv1 + +import ( + reflect "reflect" + sync "sync" + + v1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/model/v1" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` +} + +func (x *GetTenantRequest) Reset() { + *x = GetTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_public_api_v1_tenant_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTenantRequest) ProtoMessage() {} + +func (x *GetTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_rapid_public_api_v1_tenant_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTenantRequest.ProtoReflect.Descriptor instead. +func (*GetTenantRequest) Descriptor() ([]byte, []int) { + return file_rapid_public_api_v1_tenant_proto_rawDescGZIP(), []int{0} +} + +func (x *GetTenantRequest) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +type GetTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenant *v1.Tenant `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` +} + +func (x *GetTenantResponse) Reset() { + *x = GetTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rapid_public_api_v1_tenant_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTenantResponse) ProtoMessage() {} + +func (x *GetTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_rapid_public_api_v1_tenant_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTenantResponse.ProtoReflect.Descriptor instead. +func (*GetTenantResponse) Descriptor() ([]byte, []int) { + return file_rapid_public_api_v1_tenant_proto_rawDescGZIP(), []int{1} +} + +func (x *GetTenantResponse) GetTenant() *v1.Tenant { + if x != nil { + return x.Tenant + } + return nil +} + +var File_rapid_public_api_v1_tenant_proto protoreflect.FileDescriptor + +var file_rapid_public_api_v1_tenant_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2f, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x42, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, 0xd2, 0x01, 0x09, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x53, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, + 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x3a, 0x0e, 0x92, + 0x41, 0x0b, 0x0a, 0x09, 0xd2, 0x01, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x42, 0xf4, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x62, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x79, 0x73, 0x73, 0x70, 0x61, 0x72, 0x61, 0x6e, 0x6f, + 0x69, 0x61, 0x2f, 0x72, 0x61, 0x70, 0x69, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x70, 0x69, + 0x64, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, + 0x50, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x61, 0x70, 0x69, 0x64, 0x5c, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, + 0x61, 0x70, 0x69, 0x64, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, + 0x52, 0x61, 0x70, 0x69, 0x64, 0x3a, 0x3a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rapid_public_api_v1_tenant_proto_rawDescOnce sync.Once + file_rapid_public_api_v1_tenant_proto_rawDescData = file_rapid_public_api_v1_tenant_proto_rawDesc +) + +func file_rapid_public_api_v1_tenant_proto_rawDescGZIP() []byte { + file_rapid_public_api_v1_tenant_proto_rawDescOnce.Do(func() { + file_rapid_public_api_v1_tenant_proto_rawDescData = protoimpl.X.CompressGZIP(file_rapid_public_api_v1_tenant_proto_rawDescData) + }) + return file_rapid_public_api_v1_tenant_proto_rawDescData +} + +var file_rapid_public_api_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_rapid_public_api_v1_tenant_proto_goTypes = []interface{}{ + (*GetTenantRequest)(nil), // 0: rapid.public_api.v1.GetTenantRequest + (*GetTenantResponse)(nil), // 1: rapid.public_api.v1.GetTenantResponse + (*v1.Tenant)(nil), // 2: rapid.model.v1.Tenant +} +var file_rapid_public_api_v1_tenant_proto_depIdxs = []int32{ + 2, // 0: rapid.public_api.v1.GetTenantResponse.tenant:type_name -> rapid.model.v1.Tenant + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rapid_public_api_v1_tenant_proto_init() } +func file_rapid_public_api_v1_tenant_proto_init() { + if File_rapid_public_api_v1_tenant_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rapid_public_api_v1_tenant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rapid_public_api_v1_tenant_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rapid_public_api_v1_tenant_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rapid_public_api_v1_tenant_proto_goTypes, + DependencyIndexes: file_rapid_public_api_v1_tenant_proto_depIdxs, + MessageInfos: file_rapid_public_api_v1_tenant_proto_msgTypes, + }.Build() + File_rapid_public_api_v1_tenant_proto = out.File + file_rapid_public_api_v1_tenant_proto_rawDesc = nil + file_rapid_public_api_v1_tenant_proto_goTypes = nil + file_rapid_public_api_v1_tenant_proto_depIdxs = nil +} diff --git a/internal/infrastructure/grpc/run.go b/internal/infrastructure/grpc/run.go new file mode 100644 index 000000000..0c2ce3ed8 --- /dev/null +++ b/internal/infrastructure/grpc/run.go @@ -0,0 +1,88 @@ +package grpc + +import ( + "context" + "time" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/dependency" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/environment" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/handler/admin" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/handler/debug" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/handler/public" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/request_interceptor" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/internal/interceptor/session_interceptor" + admin_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/admin_api/v1" + debug_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/debug_api/v1" + public_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/public_api/v1" + grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" + grpcrecovry "github.com/grpc-ecosystem/go-grpc-middleware/recovery" + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/reflection" +) + +func NewServer(ctx context.Context, + e *environment.Environment, + logger *zap.Logger, + dependency *dependency.Dependency, +) *grpc.Server { + + requestLogInterceptor := request_interceptor.NewRequestLog(logger) + authFunc := session_interceptor.NewSession(dependency.AuthenticationInteractor) + + server := grpc.NewServer( + grpc.KeepaliveEnforcementPolicy( + keepalive.EnforcementPolicy{ + MinTime: 10 * time.Second, + PermitWithoutStream: true, + }, + ), + grpc.KeepaliveParams( + keepalive.ServerParameters{ + MaxConnectionIdle: 0, + MaxConnectionAge: 10 * time.Minute, + MaxConnectionAgeGrace: 0, + Time: 20 * time.Second, + Timeout: 10 * time.Second, + }, + ), + grpc.UnaryInterceptor( + grpcmiddleware.ChainUnaryServer( + requestLogInterceptor.UnaryServerInterceptor(), + grpcrecovry.UnaryServerInterceptor(), + grpc_auth.UnaryServerInterceptor(authFunc.Authenticate), + ), + ), + ) + + admin_apiv1.RegisterAdminV1ServiceServer( + server, + admin.NewAdminHandler( + dependency.AdminTenantInteractor, + dependency.AdminUserInteractor, + ), + ) + public_apiv1.RegisterPublicV1ServiceServer( + server, + public.NewPublicHandler( + dependency.PublicAuthenticationInteractor, + dependency.PublicTenantInteractor, + ), + ) + + if e.Environment == "local" || e.Environment == "development" { + debug_apiv1.RegisterDebugV1ServiceServer( + server, + debug.NewDebugHandler( + dependency.FirebaseClient, + e.FirebaseClientAPIKey, + ), + ) + } + + reflection.Register(server) + + return server +} diff --git a/internal/infrastructure/http/internal/handler/ping.go b/internal/infrastructure/http/internal/handler/ping.go new file mode 100644 index 000000000..ac863ae8a --- /dev/null +++ b/internal/infrastructure/http/internal/handler/ping.go @@ -0,0 +1,13 @@ +package handler + +import ( + "net/http" +) + +func Ping(w http.ResponseWriter, r *http.Request, pathParams map[string]string) { + w.WriteHeader(http.StatusOK) + _, err := w.Write([]byte("pongpong")) + if err != nil { + panic(err) + } +} diff --git a/internal/infrastructure/http/run.go b/internal/infrastructure/http/run.go new file mode 100644 index 000000000..aebcb3353 --- /dev/null +++ b/internal/infrastructure/http/run.go @@ -0,0 +1,128 @@ +package http + +import ( + "context" + "fmt" + "net" + "net/http" + "os" + "os/signal" + "syscall" + "time" + + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/encoding/protojson" + + "github.com/abyssparanoia/rapid-go/internal/infrastructure/dependency" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/environment" + internal_grpc "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc" + admin_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/admin_api/v1" + debug_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/debug_api/v1" + public_apiv1 "github.com/abyssparanoia/rapid-go/internal/infrastructure/grpc/pb/rapid/public_api/v1" + "github.com/abyssparanoia/rapid-go/internal/infrastructure/http/internal/handler" + "github.com/abyssparanoia/rapid-go/internal/pkg/logger" + "github.com/caarlos0/env/v6" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" +) + +const INTERNAL_GRPC_PORT = "50051" + +type Utf8JsonMarshaller struct { + runtime.JSONPb +} + +func Run() { + + e := &environment.Environment{} + if err := env.Parse(e); err != nil { + panic(err) + } + + logger := logger.New() + + ctx, cancel := context.WithTimeout(context.Background(), 3000*time.Second) + defer cancel() + + addr := fmt.Sprintf(":%s", e.Port) + + grpcGateway := runtime.NewServeMux(runtime.WithMarshalerOption("*", &runtime.HTTPBodyMarshaler{ + Marshaler: &runtime.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, + UnmarshalOptions: protojson.UnmarshalOptions{ + DiscardUnknown: true, + }, + }, + })) + + opts := []grpc.DialOption{ + grpc.WithTransportCredentials( + insecure.NewCredentials(), + ), + } + + if err := admin_apiv1.RegisterAdminV1ServiceHandlerFromEndpoint(ctx, grpcGateway, fmt.Sprintf(":%s", INTERNAL_GRPC_PORT), opts); err != nil { + panic(err) + } + + if err := public_apiv1.RegisterPublicV1ServiceHandlerFromEndpoint(ctx, grpcGateway, fmt.Sprintf(":%s", INTERNAL_GRPC_PORT), opts); err != nil { + panic(err) + } + + if e.Environment == "local" || e.Environment == "development" { + if err := debug_apiv1.RegisterDebugV1ServiceHandlerFromEndpoint(ctx, grpcGateway, fmt.Sprintf(":%s", INTERNAL_GRPC_PORT), opts); err != nil { + panic(err) + } + } + + if err := grpcGateway.HandlePath(http.MethodGet, "/", handler.Ping); err != nil { + panic(err) + } + + //server + server := http.Server{ + Addr: addr, + Handler: grpcGateway, + } + + d := &dependency.Dependency{} + d.Inject(ctx, e) + + grpcServer := internal_grpc.NewServer(ctx, e, logger, d) + grpcLis, err := net.Listen("tcp", fmt.Sprintf(":%s", INTERNAL_GRPC_PORT)) + if err != nil { + panic(err) + } + + // Run + logger.Info(fmt.Sprintf("[START] server. port: %s\n", addr)) + + go func() { + if err := grpcServer.Serve(grpcLis); err != nil { + logger.Error("failed to start server", zap.Error(err)) + } + }() + + go func() { + if err := server.ListenAndServe(); err != http.ErrServerClosed { + logger.Error("[CLOSED] server closed with error", zap.Error(err)) + } + }() + + // graceful shuttdown + quit := make(chan os.Signal, 1) + signal.Notify(quit, syscall.SIGTERM, os.Interrupt) + logger.Info(fmt.Sprintf("SIGNAL %d received, so server shutting down now...\n", <-quit)) + + err = server.Shutdown(ctx) + if err != nil { + logger.Error("failed to gracefully shutdown", zap.Error(err)) + } + grpcServer.GracefulStop() + + logger.Info("server shutdown completed") +} diff --git a/internal/pkg/README.md b/internal/pkg/README.md deleted file mode 100644 index 055207afc..000000000 --- a/internal/pkg/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# `/pkg` - -Library code that's ok to use by external applications (e.g., `/pkg/mypubliclib`). Other projects will import these libraries expecting them to work, so think twice before you put something here :-) Note that the `internal` directory is a better way to ensure your private packages are not importable because it's enforced by Go. The `/pkg` directory is still a good way to explicitly communicate that the code in that directory is safe for use by others. The [`I'll take pkg over internal`](https://travisjeffery.com/b/2019/11/i-ll-take-pkg-over-internal/) blog post by Travis Jeffery provides a good overview of the `pkg` and `internal` directories and when it might make sense to use them. - -It's also a way to group Go code in one place when your root directory contains lots of non-Go components and directories making it easier to run various Go tools (as mentioned in these talks: [`Best Practices for Industrial Programming`](https://www.youtube.com/watch?v=PTE4VJIdHPg) from GopherCon EU 2018, [GopherCon 2018: Kat Zien - How Do You Structure Your Go Apps](https://www.youtube.com/watch?v=oL6JBUk6tj0) and [GoLab 2018 - Massimiliano Pippi - Project layout patterns in Go](https://www.youtube.com/watch?v=3gQa1LWwuzk)). - -Note that this is not a universally accepted pattern and for every popular repo that uses it you can find 10 that don't. It's up to you to decide if you want to use this pattern or not. Regardless of whether or not it's a good pattern more people will know what you mean than not. It is a bit confusing for new Go devs, but it's a pretty simple confusion to resolve and that's one of the goals for this project layout repo. - -Ok not to use it if your app project is really small and where an extra level of nesting doesn't add much value (unless you really want to). Think about it when it's getting big enough and your root directory gets pretty busy (especially if you have a lot of non-Go app components). - -Examples: - -* https://github.com/gogs/gogs/tree/master/pkg -* https://github.com/prometheus/prometheus/tree/master/pkg -* https://github.com/jaegertracing/jaeger/tree/master/pkg -* https://github.com/istio/istio/tree/master/pkg -* https://github.com/google/gvisor/tree/master/pkg -* https://github.com/google/syzkaller/tree/master/pkg -* https://github.com/perkeep/perkeep/tree/master/pkg -* https://github.com/minio/minio/tree/master/pkg -* https://github.com/heptio/ark/tree/master/pkg -* https://github.com/argoproj/argo/tree/master/pkg -* https://github.com/heptio/sonobuoy/tree/master/pkg -* https://github.com/helm/helm/tree/master/pkg -* https://github.com/kubernetes/kubernetes/tree/master/pkg -* https://github.com/kubernetes/kops/tree/master/pkg -* https://github.com/moby/moby/tree/master/pkg -* https://github.com/grafana/grafana/tree/master/pkg -* https://github.com/influxdata/influxdb/tree/master/pkg -* https://github.com/cockroachdb/cockroach/tree/master/pkg -* https://github.com/derekparker/delve/tree/master/pkg -* https://github.com/etcd-io/etcd/tree/master/pkg -* https://github.com/oklog/oklog/tree/master/pkg -* https://github.com/flynn/flynn/tree/master/pkg -* https://github.com/jesseduffield/lazygit/tree/master/pkg -* https://github.com/gopasspw/gopass/tree/master/pkg -* https://github.com/sourcegraph/sourcegraph/tree/master/pkg -* https://github.com/sosedoff/pgweb/tree/master/pkg -* https://github.com/GoogleContainerTools/skaffold/tree/master/pkg -* https://github.com/knative/serving/tree/master/pkg -* https://github.com/grafana/loki/tree/master/pkg -* https://github.com/bloomberg/goldpinger/tree/master/pkg -* https://github.com/crossplaneio/crossplane/tree/master/pkg -* https://github.com/Ne0nd0g/merlin/tree/master/pkg -* https://github.com/jenkins-x/jx/tree/master/pkg -* https://github.com/DataDog/datadog-agent/tree/master/pkg -* https://github.com/dapr/dapr/tree/master/pkg -* https://github.com/cortexproject/cortex/tree/master/pkg -* https://github.com/dexidp/dex/tree/master/pkg -* https://github.com/pusher/oauth2_proxy/tree/master/pkg -* https://github.com/pdfcpu/pdfcpu/tree/master/pkg -* https://github.com/weaveworks/kured -* https://github.com/weaveworks/footloose -* https://github.com/weaveworks/ignite -* https://github.com/tmrts/boilr/tree/master/pkg - - - diff --git a/internal/pkg/accesscontrol/middleware.go b/internal/pkg/accesscontrol/middleware.go deleted file mode 100644 index 1c0fbb479..000000000 --- a/internal/pkg/accesscontrol/middleware.go +++ /dev/null @@ -1,16 +0,0 @@ -package accesscontrol - -import "net/http" - -// Handle ... middleware for access control -func Handle(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS") - w.Header().Set("Access-Control-Allow-Headers", "Origin, Content-Type, Authorization") - if r.Method == "OPTIONS" { - return - } - next.ServeHTTP(w, r) - }) -} diff --git a/internal/pkg/error/grpcerror/convert.go b/internal/pkg/error/grpcerror/convert.go deleted file mode 100644 index 7468fd529..000000000 --- a/internal/pkg/error/grpcerror/convert.go +++ /dev/null @@ -1,37 +0,0 @@ -package grpcerror - -import ( - "errors" - - "go.uber.org/zap/zapcore" - "google.golang.org/grpc/codes" -) - -// CodeToLevel ... convert grpc code to zapcore level -func CodeToLevel(code codes.Code) zapcore.Level { - switch code { - case codes.NotFound, codes.InvalidArgument, codes.AlreadyExists, codes.Unauthenticated, codes.PermissionDenied: - return zapcore.WarnLevel - case codes.Internal, codes.Unknown, codes.Aborted: - return zapcore.ErrorLevel - default: - return zapcore.InfoLevel - } -} - -// ErrToCode ... convert err to code -func ErrToCode(err error) codes.Code { - var notFoundError *NotFoundError - if ok := errors.As(err, ¬FoundError); ok { - return codes.NotFound - } - var invalidArgumentError *InvalidArgumentError - if ok := errors.As(err, &invalidArgumentError); ok { - return codes.InvalidArgument - } - var internalError *InternalError - if ok := errors.As(err, &internalError); ok { - return codes.Internal - } - return codes.Unknown -} diff --git a/internal/pkg/error/grpcerror/error.go b/internal/pkg/error/grpcerror/error.go deleted file mode 100644 index 508af1ffd..000000000 --- a/internal/pkg/error/grpcerror/error.go +++ /dev/null @@ -1,9 +0,0 @@ -package grpcerror - -var ( - // DBInternalErr ... DB internal error - DBInternalErr InternalError = "DBInternalErr" - - // UserNotFoundErr ... user not found error - UserNotFoundErr NotFoundError = "UserNotFoundErr" -) diff --git a/internal/pkg/error/grpcerror/model.go b/internal/pkg/error/grpcerror/model.go deleted file mode 100644 index f8cef80d1..000000000 --- a/internal/pkg/error/grpcerror/model.go +++ /dev/null @@ -1,125 +0,0 @@ -package grpcerror - -import ( - "fmt" - - "github.com/pkg/errors" -) - -// InternalError ... internal error -type InternalError string - -func (e InternalError) Error() string { - return string(e) -} - -// New ... new error -func (e InternalError) New() error { - return errors.Wrap(e, "") -} - -// Errorf ... errorf -func (e InternalError) Errorf(format string, args ...interface{}) error { - return errors.Wrapf(e, format, args...) -} - -// Wrap ... wrap error -func (e InternalError) Wrap(err error) error { - if err == nil { - return e.New() - } - return errors.Wrap(e, err.Error()) -} - -// Wrapf ... wrapf -func (e InternalError) Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return e.Errorf(format, args...) - } - msg := fmt.Sprintf(format, args...) - return errors.Wrapf(e, "err: %s; %s", err, msg) -} - -// NotFoundError ... not found error -type NotFoundError string - -func (e NotFoundError) Error() string { - return string(e) -} - -// New ... new error -func (e NotFoundError) New() error { - return errors.Wrap(e, "") -} - -// Errorf ... errorf -func (e NotFoundError) Errorf(format string, args ...interface{}) error { - return errors.Wrapf(e, format, args...) -} - -// Wrap ... wrap error -func (e NotFoundError) Wrap(err error) error { - if err == nil { - return e.New() - } - return errors.Wrap(e, err.Error()) -} - -// Wrapf ... wrapf -func (e NotFoundError) Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return e.Errorf(format, args...) - } - msg := fmt.Sprintf(format, args...) - return errors.Wrapf(e, "err: %s; %s", err, msg) -} - -// As ... as method -func (e NotFoundError) As(target interface{}) bool { - if _, ok := target.(**NotFoundError); ok { - return true - } - return false -} - -// InvalidArgumentError ... invalid argument error -type InvalidArgumentError string - -func (e InvalidArgumentError) Error() string { - return string(e) -} - -// New ... new error -func (e InvalidArgumentError) New() error { - return errors.Wrap(e, "") -} - -// Errorf ... errorf -func (e InvalidArgumentError) Errorf(format string, args ...interface{}) error { - return errors.Wrapf(e, format, args...) -} - -// Wrap ... wrap error -func (e InvalidArgumentError) Wrap(err error) error { - if err == nil { - return e.New() - } - return errors.Wrap(e, err.Error()) -} - -// Wrapf ... wrapf -func (e InvalidArgumentError) Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return e.Errorf(format, args...) - } - msg := fmt.Sprintf(format, args...) - return errors.Wrapf(e, "err: %s; %s", err, msg) -} - -// As ... as method -func (e InvalidArgumentError) As(target interface{}) bool { - if _, ok := target.(**InvalidArgumentError); ok { - return true - } - return false -} diff --git a/internal/pkg/error/httperror/convert.go b/internal/pkg/error/httperror/convert.go deleted file mode 100644 index 4fa3cd84c..000000000 --- a/internal/pkg/error/httperror/convert.go +++ /dev/null @@ -1,29 +0,0 @@ -package httperror - -import ( - "errors" - "net/http" - - "go.uber.org/zap/zapcore" -) - -// CodeToLevel ... convert grpc code to zapcore level -func CodeToLevel(code int) zapcore.Level { - switch code { - case http.StatusNotFound, http.StatusBadRequest, http.StatusUnauthorized, http.StatusForbidden: - return zapcore.WarnLevel - case http.StatusInternalServerError, http.StatusTooManyRequests, http.StatusServiceUnavailable: - return zapcore.ErrorLevel - default: - return zapcore.InfoLevel - } -} - -// ErrToCode ... convert err to code -func ErrToCode(err error) int { - var notFoundError *NotFoundError - if ok := errors.As(err, ¬FoundError); ok { - return http.StatusNotFound - } - return http.StatusInternalServerError -} diff --git a/internal/pkg/error/httperror/error.go b/internal/pkg/error/httperror/error.go deleted file mode 100644 index c6f87db9d..000000000 --- a/internal/pkg/error/httperror/error.go +++ /dev/null @@ -1,6 +0,0 @@ -package httperror - -var ( - // UserNotFoundErr ... user not found error - UserNotFoundErr NotFoundError = "UserNotFoundErr" -) diff --git a/internal/pkg/errors/bad_request.go b/internal/pkg/errors/bad_request.go new file mode 100644 index 000000000..5e3de2acd --- /dev/null +++ b/internal/pkg/errors/bad_request.go @@ -0,0 +1,49 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// BadRequestError ... bad request error +type BadRequestError string + +func (e BadRequestError) Error() string { + return string(e) +} + +// New ... new error +func (e BadRequestError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e BadRequestError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e BadRequestError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e BadRequestError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} + +// As ... as method +func (e BadRequestError) As(target interface{}) bool { + if _, ok := target.(**BadRequestError); ok { + return true + } + return false +} diff --git a/internal/pkg/errors/conflict_error.go b/internal/pkg/errors/conflict_error.go new file mode 100644 index 000000000..697599755 --- /dev/null +++ b/internal/pkg/errors/conflict_error.go @@ -0,0 +1,49 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// ConflictError ... business error +type ConflictError string + +func (e ConflictError) Error() string { + return string(e) +} + +// New ... new error +func (e ConflictError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e ConflictError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e ConflictError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e ConflictError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} + +// As ... as method +func (e ConflictError) As(target interface{}) bool { + if _, ok := target.(**ConflictError); ok { + return true + } + return false +} diff --git a/internal/pkg/errors/errors.go b/internal/pkg/errors/errors.go new file mode 100644 index 000000000..daa2ca271 --- /dev/null +++ b/internal/pkg/errors/errors.go @@ -0,0 +1,8 @@ +package errors + +const ( + InternalErr InternalError = "An internal error has occurred2" + UnauthorizedErr UnauthorizedError = "Unauthroized" + RequestInvalidArgumentErr BadRequestError = "Request argument is invalid" + NotFoundErr NotFoundError = "Not found" +) diff --git a/internal/pkg/errors/forbidden_error.go b/internal/pkg/errors/forbidden_error.go new file mode 100644 index 000000000..62327e814 --- /dev/null +++ b/internal/pkg/errors/forbidden_error.go @@ -0,0 +1,49 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// ForbiddenError ... forbidden error +type ForbiddenError string + +func (e ForbiddenError) Error() string { + return string(e) +} + +// New ... new error +func (e ForbiddenError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e ForbiddenError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e ForbiddenError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e ForbiddenError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} + +// As ... as method +func (e ForbiddenError) As(target interface{}) bool { + if _, ok := target.(**ForbiddenError); ok { + return true + } + return false +} diff --git a/internal/pkg/errors/intenal_error.go b/internal/pkg/errors/intenal_error.go new file mode 100644 index 000000000..b41162ec2 --- /dev/null +++ b/internal/pkg/errors/intenal_error.go @@ -0,0 +1,41 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// InternalError ... base error +type InternalError string + +func (e InternalError) Error() string { + return string(e) +} + +// New ... new error +func (e InternalError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e InternalError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e InternalError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e InternalError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} diff --git a/internal/pkg/error/httperror/model.go b/internal/pkg/errors/not_found_error.go similarity index 55% rename from internal/pkg/error/httperror/model.go rename to internal/pkg/errors/not_found_error.go index 58ee0e82c..fd0fb15e0 100644 --- a/internal/pkg/error/httperror/model.go +++ b/internal/pkg/errors/not_found_error.go @@ -1,4 +1,4 @@ -package httperror +package errors import ( "fmt" @@ -6,40 +6,6 @@ import ( "github.com/pkg/errors" ) -// InternalError ... base error -type InternalError string - -func (e InternalError) Error() string { - return string(e) -} - -// New ... new error -func (e InternalError) New() error { - return errors.Wrap(e, "") -} - -// Errorf ... errorf -func (e InternalError) Errorf(format string, args ...interface{}) error { - return errors.Wrapf(e, format, args...) -} - -// Wrap ... wrap error -func (e InternalError) Wrap(err error) error { - if err == nil { - return e.New() - } - return errors.Wrap(e, err.Error()) -} - -// Wrapf ... wrapf -func (e InternalError) Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return e.Errorf(format, args...) - } - msg := fmt.Sprintf(format, args...) - return errors.Wrapf(e, "err: %s; %s", err, msg) -} - // NotFoundError ... not found error type NotFoundError string diff --git a/internal/pkg/errors/service_unavailable_error.go b/internal/pkg/errors/service_unavailable_error.go new file mode 100644 index 000000000..b462d4950 --- /dev/null +++ b/internal/pkg/errors/service_unavailable_error.go @@ -0,0 +1,49 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// ServiceUnavailableError ... service unavailable error +type ServiceUnavailableError string + +func (e ServiceUnavailableError) Error() string { + return string(e) +} + +// New ... new error +func (e ServiceUnavailableError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e ServiceUnavailableError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e ServiceUnavailableError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e ServiceUnavailableError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} + +// As ... as method +func (e ServiceUnavailableError) As(target interface{}) bool { + if _, ok := target.(**ServiceUnavailableError); ok { + return true + } + return false +} diff --git a/internal/pkg/errors/unauthorized_error.go b/internal/pkg/errors/unauthorized_error.go new file mode 100644 index 000000000..8625a7f22 --- /dev/null +++ b/internal/pkg/errors/unauthorized_error.go @@ -0,0 +1,49 @@ +package errors + +import ( + "fmt" + + "github.com/pkg/errors" +) + +// UnauthorizedError ... not found error +type UnauthorizedError string + +func (e UnauthorizedError) Error() string { + return string(e) +} + +// New ... new error +func (e UnauthorizedError) New() error { + return errors.Wrap(e, "") +} + +// Errorf ... errorf +func (e UnauthorizedError) Errorf(format string, args ...interface{}) error { + return errors.Wrapf(e, format, args...) +} + +// Wrap ... wrap error +func (e UnauthorizedError) Wrap(err error) error { + if err == nil { + return e.New() + } + return errors.Wrap(e, err.Error()) +} + +// Wrapf ... wrapf +func (e UnauthorizedError) Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return e.Errorf(format, args...) + } + msg := fmt.Sprintf(format, args...) + return errors.Wrapf(e, "err: %s; %s", err, msg) +} + +// As ... as method +func (e UnauthorizedError) As(target interface{}) bool { + if _, ok := target.(**UnauthorizedError); ok { + return true + } + return false +} diff --git a/internal/pkg/gluefcm/client.go b/internal/pkg/gluefcm/client.go deleted file mode 100644 index 517cd4fa8..000000000 --- a/internal/pkg/gluefcm/client.go +++ /dev/null @@ -1,33 +0,0 @@ -package gluefcm - -import ( - "context" - - firebase "firebase.google.com/go" - "firebase.google.com/go/messaging" - "google.golang.org/api/option" - "google.golang.org/grpc" - "google.golang.org/grpc/keepalive" - - "time" -) - -// NewClient ... new fcm client -func NewClient(projectID string) *messaging.Client { - ctx := context.Background() - gOpt := option.WithGRPCDialOption(grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 30 * time.Millisecond, - Timeout: 20 * time.Millisecond, - PermitWithoutStream: true, - })) - conf := &firebase.Config{ProjectID: projectID} - app, err := firebase.NewApp(ctx, conf, gOpt) - if err != nil { - panic(err) - } - cli, err := app.Messaging(ctx) - if err != nil { - panic(err) - } - return cli -} diff --git a/internal/pkg/gluefirebaseauth/context.go b/internal/pkg/gluefirebaseauth/context.go deleted file mode 100644 index c8aaf9dc7..000000000 --- a/internal/pkg/gluefirebaseauth/context.go +++ /dev/null @@ -1,38 +0,0 @@ -package gluefirebaseauth - -import "context" - -type contextKey string - -const ( - userIDContextKey contextKey = "gluefirebaseauth:user_id" - authHeaderContextKey contextKey = "gluefirebaseauth:auth_header" - - claimsContextKey contextKey = "gluefirebaseauth:claims" -) - -func getAuthHeader(ctx context.Context) string { - return ctx.Value(authHeaderContextKey).(string) -} - -// GetUserID ... get gluefirebaseauthUID from context -func GetUserID(ctx context.Context) string { - return ctx.Value(userIDContextKey).(string) -} - -// GetClaims ... get gluefirebaseauthJWTClaims from context -func GetClaims(ctx context.Context) Claims { - return ctx.Value(claimsContextKey).(Claims) -} - -func setAuthHeader(ctx context.Context, ah string) context.Context { - return context.WithValue(ctx, authHeaderContextKey, ah) -} - -func setUserID(ctx context.Context, userID string) context.Context { - return context.WithValue(ctx, userIDContextKey, userID) -} - -func setClaims(ctx context.Context, claims *Claims) context.Context { - return context.WithValue(ctx, claimsContextKey, claims) -} diff --git a/internal/pkg/gluefirebaseauth/firebaseauth.go b/internal/pkg/gluefirebaseauth/firebaseauth.go deleted file mode 100644 index 966dfecf3..000000000 --- a/internal/pkg/gluefirebaseauth/firebaseauth.go +++ /dev/null @@ -1,15 +0,0 @@ -package gluefirebaseauth - -import ( - "context" - - "firebase.google.com/go/auth" -) - -// Firebaseauth ... service inteface for firebase authentication -type Firebaseauth interface { - CreateTokenWithClaims(ctx context.Context, userID string, claims *Claims) (string, error) - Authentication(ctx context.Context, ah string) (string, *Claims, error) - GetUserByEmail(ctx context.Context, email string) (*auth.UserRecord, error) - CreateUser(ctx context.Context, email string, password string) (*auth.UserRecord, error) -} diff --git a/internal/pkg/gluefirebaseauth/firebaseauth_debug.go b/internal/pkg/gluefirebaseauth/firebaseauth_debug.go deleted file mode 100644 index b769dceba..000000000 --- a/internal/pkg/gluefirebaseauth/firebaseauth_debug.go +++ /dev/null @@ -1,81 +0,0 @@ -package gluefirebaseauth - -import ( - "context" - "errors" - - "firebase.google.com/go/auth" -) - -type firebaseauthDebug struct { - cli *auth.Client -} - -// Authentication ... authenticate -func (s *firebaseauthDebug) Authentication(ctx context.Context, ah string) (string, *Claims, error) { - var userID string - claims := &Claims{} - - // ユーザーを取得できたらデバッグリクエストと判定する - if user := getUserByAuthHeader(ah); user != "" { - claims = newDummyClaims() - return user, claims, nil - } - - // 通常の認証を行う - token := getTokenByAuthHeader(ah) - if token == "" { - return userID, claims, errors.New("token empty error") - } - - t, err := s.cli.VerifyIDToken(ctx, token) - if err != nil { - return userID, claims, err - } - - userID = t.UID - claims.SetMap(t.Claims) - - return userID, claims, nil -} - -func (s *firebaseauthDebug) CreateTokenWithClaims(ctx context.Context, userID string, claims *Claims) (string, error) { - token, err := s.cli.CustomTokenWithClaims(ctx, userID, claims.ToMap()) - if err != nil { - return "", err - } - return token, nil -} - -func (s *firebaseauthDebug) CreateUser(ctx context.Context, email string, password string) (*auth.UserRecord, error) { - - userCreate := &auth.UserToCreate{} - userCreate = userCreate.Email(email) - userCreate = userCreate.Password(password) - - userRecord, err := s.cli.CreateUser(ctx, userCreate) - if err != nil { - return nil, err - } - - return userRecord, nil -} - -func (s *firebaseauthDebug) GetUserByEmail(ctx context.Context, email string) (*auth.UserRecord, error) { - - userRecord, err := s.cli.GetUserByEmail(ctx, email) - if err != nil { - if userRecord == nil { - return nil, nil - } - return nil, err - } - - return userRecord, nil - -} - -// NewDebug ... Debuggluefirebaseauthを作成する -func NewDebug(cli *auth.Client) Firebaseauth { - return &firebaseauthDebug{cli} -} diff --git a/internal/pkg/gluefirebaseauth/firebaseauth_impl.go b/internal/pkg/gluefirebaseauth/firebaseauth_impl.go deleted file mode 100644 index 9e41584aa..000000000 --- a/internal/pkg/gluefirebaseauth/firebaseauth_impl.go +++ /dev/null @@ -1,74 +0,0 @@ -package gluefirebaseauth - -import ( - "context" - "errors" - - "firebase.google.com/go/auth" -) - -type firebaseauth struct { - cli *auth.Client -} - -func (s *firebaseauth) CreateTokenWithClaims(ctx context.Context, userID string, claims *Claims) (string, error) { - token, err := s.cli.CustomTokenWithClaims(ctx, userID, claims.ToMap()) - if err != nil { - return "", err - } - return token, nil -} - -// Authentication ... authenticate -func (s *firebaseauth) Authentication(ctx context.Context, ah string) (string, *Claims, error) { - var userID string - claims := &Claims{} - - token := getTokenByAuthHeader(ah) - if token == "" { - return userID, claims, errors.New("token empty error") - } - - t, err := s.cli.VerifyIDToken(ctx, token) - if err != nil { - return userID, claims, err - } - - userID = t.UID - claims.SetMap(t.Claims) - - return userID, claims, nil -} - -func (s *firebaseauth) CreateUser(ctx context.Context, email string, password string) (*auth.UserRecord, error) { - - userCreate := &auth.UserToCreate{} - userCreate = userCreate.Email(email) - userCreate = userCreate.Password(password) - - userRecord, err := s.cli.CreateUser(ctx, userCreate) - if err != nil { - return nil, err - } - - return userRecord, nil -} - -func (s *firebaseauth) GetUserByEmail(ctx context.Context, email string) (*auth.UserRecord, error) { - - userRecord, err := s.cli.GetUserByEmail(ctx, email) - if err != nil { - if userRecord == nil { - return nil, nil - } - return nil, err - } - - return userRecord, nil - -} - -// New ... get firebaseauth -func New(cli *auth.Client) Firebaseauth { - return &firebaseauth{cli} -} diff --git a/internal/pkg/gluefirebaseauth/middleware.go b/internal/pkg/gluefirebaseauth/middleware.go deleted file mode 100644 index d258f2f30..000000000 --- a/internal/pkg/gluefirebaseauth/middleware.go +++ /dev/null @@ -1,50 +0,0 @@ -package gluefirebaseauth - -import ( - "context" - "fmt" - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - - "github.com/unrolled/render" -) - -// Middleware ... http middleware for firebase authentication -type Middleware struct { - firebaseauth Firebaseauth -} - -// Handle ... authenticate handler -func (m *Middleware) Handle(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - ah := r.Header.Get("Authorization") - if ah == "" { - m.renderError(ctx, w, http.StatusForbidden, "no Authorization header") - return - } - - userID, claims, err := m.firebaseauth.Authentication(ctx, ah) - if err != nil { - m.renderError(ctx, w, http.StatusForbidden, err.Error()) - return - } - ctx = setUserID(ctx, userID) - ctx = setClaims(ctx, claims) - next.ServeHTTP(w, r.WithContext(ctx)) - }) -} - -func (m *Middleware) renderError(ctx context.Context, w http.ResponseWriter, status int, msg string) { - log.Warningf(ctx, msg) - render.New().Text(w, status, fmt.Sprintf("%d authentication failed", status)) -} - -// NewMiddleware ... get middleware -func NewMiddleware(firebaseauth Firebaseauth) *Middleware { - return &Middleware{ - firebaseauth, - } -} diff --git a/internal/pkg/gluefirebaseauth/model.go b/internal/pkg/gluefirebaseauth/model.go deleted file mode 100644 index 99b586068..000000000 --- a/internal/pkg/gluefirebaseauth/model.go +++ /dev/null @@ -1,19 +0,0 @@ -package gluefirebaseauth - -// Claims ... custom claims -type Claims struct { -} - -// SetMap ... set claims -func (m *Claims) SetMap(cmap map[string]interface{}) { -} - -// ToMap ... get claims to map -func (m *Claims) ToMap() map[string]interface{} { - cmap := map[string]interface{}{} - return cmap -} - -func newDummyClaims() *Claims { - return &Claims{} -} diff --git a/internal/pkg/gluefirebaseauth/util.go b/internal/pkg/gluefirebaseauth/util.go deleted file mode 100644 index d28939565..000000000 --- a/internal/pkg/gluefirebaseauth/util.go +++ /dev/null @@ -1,41 +0,0 @@ -package gluefirebaseauth - -import ( - "context" - "strings" - - firebase "firebase.google.com/go" - "firebase.google.com/go/auth" -) - -const ( - headerPrefix string = "Bearer" - debugHeaderPrefix string = "user=" -) - -func getAuthClient(ctx context.Context) (*auth.Client, error) { - app, err := firebase.NewApp(ctx, nil) - if err != nil { - return nil, err - } - c, err := app.Auth(ctx) - if err != nil { - return nil, err - } - return c, nil -} - -func getTokenByAuthHeader(ah string) string { - pLen := len(headerPrefix) - if len(ah) > pLen && strings.ToUpper(ah[0:pLen]) == headerPrefix { - return ah[pLen+1:] - } - return "" -} - -func getUserByAuthHeader(ah string) string { - if strings.HasPrefix(ah, debugHeaderPrefix) { - return ah[len(debugHeaderPrefix):] - } - return "" -} diff --git a/internal/pkg/gluefirestore/client.go b/internal/pkg/gluefirestore/client.go deleted file mode 100644 index 06dc60347..000000000 --- a/internal/pkg/gluefirestore/client.go +++ /dev/null @@ -1,32 +0,0 @@ -package gluefirestore - -import ( - "context" - "time" - - "cloud.google.com/go/firestore" - firebase "firebase.google.com/go" - "google.golang.org/api/option" - "google.golang.org/grpc" - "google.golang.org/grpc/keepalive" -) - -// NewClient ... get firestore client -func NewClient(projectID string) *firestore.Client { - ctx := context.Background() - gOpt := option.WithGRPCDialOption(grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 30 * time.Millisecond, - Timeout: 20 * time.Millisecond, - PermitWithoutStream: true, - })) - conf := &firebase.Config{ProjectID: projectID} - app, err := firebase.NewApp(ctx, conf, gOpt) - if err != nil { - panic(err) - } - cli, err := app.Firestore(ctx) - if err != nil { - panic(err) - } - return cli -} diff --git a/internal/pkg/gluefirestore/helper.go b/internal/pkg/gluefirestore/helper.go deleted file mode 100644 index 9e29b1efc..000000000 --- a/internal/pkg/gluefirestore/helper.go +++ /dev/null @@ -1,344 +0,0 @@ -package gluefirestore - -import ( - "context" - "reflect" - - "cloud.google.com/go/firestore" - "google.golang.org/api/iterator" - - "github.com/abyssparanoia/rapid-go/internal/pkg/util" -) - -// GenerateDocumentRef ... generate document -func GenerateDocumentRef(fCli *firestore.Client, docRefs []*DocRef) *firestore.DocumentRef { - var dst *firestore.DocumentRef - for i, docRef := range docRefs { - if i == 0 { - dst = fCli.Collection(docRef.CollectionName).Doc(docRef.DocID) - } else { - dst = dst.Collection(docRef.CollectionName).Doc(docRef.DocID) - } - } - return dst -} - -// Get ... get a document -func Get(ctx context.Context, docRef *firestore.DocumentRef, dst interface{}) (bool, error) { - dsnp, err := docRef.Get(ctx) - if dsnp != nil && !dsnp.Exists() { - return false, nil - } - if err != nil { - return false, err - } - err = dsnp.DataTo(dst) - if err != nil { - return false, err - } - setDocByDst(dst, dsnp.Ref) - return true, nil -} - -// GetMulti ... get multi documents -func GetMulti(ctx context.Context, fCli *firestore.Client, docRefs []*firestore.DocumentRef, dsts interface{}) error { - dsnps, err := fCli.GetAll(ctx, docRefs) - if err != nil { - return err - } - rv := reflect.Indirect(reflect.ValueOf(dsts)) - rrt := rv.Type().Elem().Elem() - for _, dsnp := range dsnps { - if !dsnp.Exists() { - continue - } - v := reflect.New(rrt).Interface() - err = dsnp.DataTo(&v) - if err != nil { - return err - } - rrv := reflect.ValueOf(v) - setDocByDsts(rrv, rrt, dsnp.Ref) - rv.Set(reflect.Append(rv, rrv)) - } - return nil -} - -// GetByQuery ... query a document -func GetByQuery(ctx context.Context, query firestore.Query, dst interface{}) (bool, error) { - it := query.Documents(ctx) - defer it.Stop() - dsnp, err := it.Next() - if err == iterator.Done { - return false, nil - } - err = dsnp.DataTo(dst) - if err != nil { - return false, err - } - setDocByDst(dst, dsnp.Ref) - return true, nil -} - -// ListByQuery ... query multi documents -func ListByQuery(ctx context.Context, query firestore.Query, dsts interface{}) error { - it := query.Documents(ctx) - defer it.Stop() - rv := reflect.Indirect(reflect.ValueOf(dsts)) - rrt := rv.Type().Elem().Elem() - for { - dsnp, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - return err - } - v := reflect.New(rrt).Interface() - err = dsnp.DataTo(&v) - if err != nil { - return err - } - rrv := reflect.ValueOf(v) - setDocByDsts(rrv, rrt, dsnp.Ref) - rv.Set(reflect.Append(rv, rrv)) - } - return nil -} - -// ListByQueryCursor ... query multi documents with cursor -func ListByQueryCursor(ctx context.Context, query firestore.Query, limit int, cursor *firestore.DocumentSnapshot, dsts interface{}) (*firestore.DocumentSnapshot, error) { - if cursor != nil { - query = query.StartAfter(cursor) - } - it := query.Limit(limit).Documents(ctx) - defer it.Stop() - rv := reflect.Indirect(reflect.ValueOf(dsts)) - rrt := rv.Type().Elem().Elem() - var lastDsnp *firestore.DocumentSnapshot - for { - dsnp, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - return nil, err - } - v := reflect.New(rrt).Interface() - err = dsnp.DataTo(v) - if err != nil { - return nil, err - } - rrv := reflect.ValueOf(v) - setDocByDsts(rrv, rrt, dsnp.Ref) - rv.Set(reflect.Append(rv, rrv)) - lastDsnp = dsnp - } - if rv.Len() == limit { - return lastDsnp, nil - } - return nil, nil -} - -// TxGet ... get a single in transaction -func TxGet(ctx context.Context, tx *firestore.Transaction, docRef *firestore.DocumentRef, dst interface{}) (bool, error) { - dsnp, err := tx.Get(docRef) - if dsnp != nil && !dsnp.Exists() { - return false, nil - } - if err != nil { - return false, err - } - err = dsnp.DataTo(dst) - if err != nil { - return false, err - } - setDocByDst(dst, dsnp.Ref) - return true, nil -} - -// TxGetMulti ... get multi documents in transaction -func TxGetMulti(ctx context.Context, tx *firestore.Transaction, docRefs []*firestore.DocumentRef, dsts interface{}) error { - dsnps, err := tx.GetAll(docRefs) - if err != nil { - return err - } - rv := reflect.Indirect(reflect.ValueOf(dsts)) - rrt := rv.Type().Elem().Elem() - for _, dsnp := range dsnps { - if !dsnp.Exists() { - continue - } - v := reflect.New(rrt).Interface() - err = dsnp.DataTo(&v) - if err != nil { - return err - } - rrv := reflect.ValueOf(v) - setDocByDsts(rrv, rrt, dsnp.Ref) - rv.Set(reflect.Append(rv, rrv)) - } - return nil -} - -// TxGetByQuery ... query a document in transaction -func TxGetByQuery(ctx context.Context, tx *firestore.Transaction, query firestore.Query, dst interface{}) (bool, error) { - it := tx.Documents(query) - defer it.Stop() - dsnp, err := it.Next() - if err == iterator.Done { - return false, nil - } - if err != nil { - return false, err - } - err = dsnp.DataTo(dst) - if err != nil { - return false, err - } - setDocByDst(dst, dsnp.Ref) - return true, nil -} - -// TxListByQuery ... query multi documents in transaction -func TxListByQuery(ctx context.Context, tx *firestore.Transaction, query firestore.Query, dsts interface{}) error { - it := tx.Documents(query) - defer it.Stop() - rv := reflect.Indirect(reflect.ValueOf(dsts)) - rrt := rv.Type().Elem().Elem() - for { - dsnp, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - return err - } - v := reflect.New(rrt).Interface() - err = dsnp.DataTo(&v) - if err != nil { - return err - } - rrv := reflect.ValueOf(v) - setDocByDsts(rrv, rrt, dsnp.Ref) - rv.Set(reflect.Append(rv, rrv)) - } - return nil -} - -// Create ... create a document -func Create(ctx context.Context, colRef *firestore.CollectionRef, src interface{}) error { - ref, _, err := colRef.Add(ctx, src) - if err != nil { - return err - } - setDocByDst(src, ref) - return nil -} - -// BtCreate ... create a document with batch -func BtCreate(ctx context.Context, bt *firestore.WriteBatch, colRef *firestore.CollectionRef, src interface{}) { - id := util.StrUniqueID() - ref := colRef.Doc(id) - bt.Create(ref, src) - setDocByDst(src, ref) -} - -// TxCreate ... create a document in transaction -func TxCreate(ctx context.Context, tx *firestore.Transaction, colRef *firestore.CollectionRef, src interface{}) error { - id := util.StrUniqueID() - ref := colRef.Doc(id) - err := tx.Create(ref, src) - if err != nil { - return err - } - setDocByDst(src, ref) - return nil -} - -// Update ... update a document -func Update(ctx context.Context, docRef *firestore.DocumentRef, kv map[string]interface{}) error { - srcs := []firestore.Update{} - for k, v := range kv { - src := firestore.Update{Path: k, Value: v} - srcs = append(srcs, src) - } - _, err := docRef.Update(ctx, srcs) - if err != nil { - return err - } - return nil -} - -// BtUpdate ... update a document with batch -func BtUpdate(ctx context.Context, bt *firestore.WriteBatch, docRef *firestore.DocumentRef, kv map[string]interface{}) { - srcs := []firestore.Update{} - for k, v := range kv { - src := firestore.Update{Path: k, Value: v} - srcs = append(srcs, src) - } - _ = bt.Update(docRef, srcs) -} - -// TxUpdate ... update a document in transaction -func TxUpdate(ctx context.Context, tx *firestore.Transaction, docRef *firestore.DocumentRef, kv map[string]interface{}) error { - srcs := []firestore.Update{} - for k, v := range kv { - src := firestore.Update{Path: k, Value: v} - srcs = append(srcs, src) - } - err := tx.Update(docRef, srcs) - if err != nil { - return err - } - return nil -} - -// Set ... set a document -func Set(ctx context.Context, docRef *firestore.DocumentRef, src interface{}) error { - _, err := docRef.Set(ctx, src) - if err != nil { - return err - } - setDocByDst(src, docRef) - return nil -} - -// BtSet ... set a document with batch -func BtSet(ctx context.Context, bt *firestore.WriteBatch, docRef *firestore.DocumentRef, src interface{}) { - _ = bt.Set(docRef, src) - setDocByDst(src, docRef) -} - -// TxSet ... set a document in transaction -func TxSet(ctx context.Context, tx *firestore.Transaction, docRef *firestore.DocumentRef, src interface{}) error { - err := tx.Set(docRef, src) - if err != nil { - return err - } - setDocByDst(src, docRef) - return nil -} - -// Delete ... delete a document -func Delete(ctx context.Context, docRef *firestore.DocumentRef) error { - _, err := docRef.Delete(ctx) - if err != nil { - return err - } - return nil -} - -// BtDelete ... delete a document with batch -func BtDelete(ctx context.Context, bt *firestore.WriteBatch, docRef *firestore.DocumentRef) { - _ = bt.Delete(docRef) -} - -// TxDelete ... delete a document in transaction -func TxDelete(ctx context.Context, tx *firestore.Transaction, docRef *firestore.DocumentRef) error { - err := tx.Delete(docRef) - if err != nil { - return err - } - return nil -} diff --git a/internal/pkg/gluefirestore/model.go b/internal/pkg/gluefirestore/model.go deleted file mode 100644 index 2c723d448..000000000 --- a/internal/pkg/gluefirestore/model.go +++ /dev/null @@ -1,7 +0,0 @@ -package gluefirestore - -// DocRef ... firestore document reference -type DocRef struct { - CollectionName string `json:"collection_name"` - DocID string `json:"doc_id"` -} diff --git a/internal/pkg/gluefirestore/util.go b/internal/pkg/gluefirestore/util.go deleted file mode 100644 index 3eccda122..000000000 --- a/internal/pkg/gluefirestore/util.go +++ /dev/null @@ -1,43 +0,0 @@ -package gluefirestore - -import ( - "reflect" - - "cloud.google.com/go/firestore" -) - -func setDocByDst(dst interface{}, ref *firestore.DocumentRef) { - rv := reflect.Indirect(reflect.ValueOf(dst)) - rt := rv.Type() - if rt.Kind() == reflect.Struct { - for i := 0; i < rt.NumField(); i++ { - f := rt.Field(i) - tag := f.Tag.Get("gluefirestore") - if tag == "id" && f.Type.Kind() == reflect.String { - rv.Field(i).SetString(ref.ID) - continue - } - if tag == "ref" && f.Type.Kind() == reflect.Ptr { - rv.Field(i).Set(reflect.ValueOf(ref)) - continue - } - } - } -} - -func setDocByDsts(rv reflect.Value, rt reflect.Type, ref *firestore.DocumentRef) { - if rt.Kind() == reflect.Struct { - for i := 0; i < rt.NumField(); i++ { - f := rt.Field(i) - tag := f.Tag.Get("gluefirestore") - if tag == "id" && f.Type.Kind() == reflect.String { - rv.Elem().Field(i).SetString(ref.ID) - continue - } - if tag == "ref" && f.Type.Kind() == reflect.Ptr { - rv.Elem().Field(i).Set(reflect.ValueOf(ref)) - continue - } - } - } -} diff --git a/internal/pkg/gluemysql/logger.go b/internal/pkg/gluemysql/logger.go deleted file mode 100644 index 7775693f3..000000000 --- a/internal/pkg/gluemysql/logger.go +++ /dev/null @@ -1,28 +0,0 @@ -package gluemysql - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" -) - -// Logger ... logger for gorm -type Logger struct { - ctx context.Context -} - -// Println ... output sql log -func (logger *Logger) Println(values ...interface{}) { - texts := "" - for _, value := range values { - if text, ok := value.(string); ok { - texts += text - } - } - log.Infof(logger.ctx, texts) -} - -// NewLogger ... get logger for gorm -func NewLogger(ctx context.Context) *Logger { - return &Logger{ctx} -} diff --git a/internal/pkg/gluepsql/client.go b/internal/pkg/gluepsql/client.go deleted file mode 100644 index 13af97ed9..000000000 --- a/internal/pkg/gluepsql/client.go +++ /dev/null @@ -1,22 +0,0 @@ -package gluepsql - -import ( - "database/sql" - "fmt" - - _ "github.com/lib/pq" -) - -// NewClient ... get psql client -func NewClient(cfg *Config) *sql.DB { - psqlInfo := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", - cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.Database, - ) - - db, err := sql.Open("postgres", psqlInfo) - if err != nil { - panic(err) - } - - return db -} diff --git a/internal/pkg/gluepsql/config.go b/internal/pkg/gluepsql/config.go deleted file mode 100644 index bf594a99b..000000000 --- a/internal/pkg/gluepsql/config.go +++ /dev/null @@ -1,21 +0,0 @@ -package gluepsql - -// Config ... psql config -type Config struct { - Host string - Port int - User string - Password string - Database string -} - -// NewConfig ... get new config -func NewConfig(host string, port int, user string, password string, database string) *Config { - return &Config{ - Host: host, - Port: port, - User: user, - Password: password, - Database: database, - } -} diff --git a/internal/pkg/httpheader/context.go b/internal/pkg/httpheader/context.go deleted file mode 100644 index 263b3adf3..000000000 --- a/internal/pkg/httpheader/context.go +++ /dev/null @@ -1,18 +0,0 @@ -package httpheader - -import ( - "context" -) - -type contextKey string - -const paramsContextKey contextKey = "httpheader:params" - -// GetParams ... get parameter from http header -func GetParams(ctx context.Context) Params { - return ctx.Value(paramsContextKey).(Params) -} - -func setParams(ctx context.Context, params Params) context.Context { - return context.WithValue(ctx, paramsContextKey, params) -} diff --git a/internal/pkg/httpheader/httpheader_dummy.go b/internal/pkg/httpheader/httpheader_dummy.go deleted file mode 100644 index dd79ca77d..000000000 --- a/internal/pkg/httpheader/httpheader_dummy.go +++ /dev/null @@ -1,21 +0,0 @@ -package httpheader - -import ( - "context" - "net/http" -) - -type dummy struct { -} - -func (s *dummy) Get(ctx context.Context, r *http.Request) (Params, error) { - h := Params{ - Sample: "sample", - } - return h, nil -} - -// NewDummy ... get dummy -func NewDummy() Httpheader { - return &dummy{} -} diff --git a/internal/pkg/httpheader/httpheader_impl.go b/internal/pkg/httpheader/httpheader_impl.go deleted file mode 100644 index e72327493..000000000 --- a/internal/pkg/httpheader/httpheader_impl.go +++ /dev/null @@ -1,33 +0,0 @@ -package httpheader - -import ( - "context" - "net/http" - - validator "github.com/go-playground/validator" -) - -const ( - headerKeySample string = "X-Sample" -) - -type httpheader struct { -} - -func (s *httpheader) Get(ctx context.Context, r *http.Request) (Params, error) { - h := Params{ - Sample: r.Header.Get(headerKeySample), - } - - v := validator.New() - if err := v.Struct(h); err != nil { - return h, err - } - - return h, nil -} - -// New ... get httpheader -func New() Httpheader { - return &httpheader{} -} diff --git a/internal/pkg/httpheader/httpheder.go b/internal/pkg/httpheader/httpheder.go deleted file mode 100644 index 83f2dc8cb..000000000 --- a/internal/pkg/httpheader/httpheder.go +++ /dev/null @@ -1,11 +0,0 @@ -package httpheader - -import ( - "context" - "net/http" -) - -// Httpheader ... interface for http header -type Httpheader interface { - Get(ctx context.Context, r *http.Request) (Params, error) -} diff --git a/internal/pkg/httpheader/middleware.go b/internal/pkg/httpheader/middleware.go deleted file mode 100644 index 01591844d..000000000 --- a/internal/pkg/httpheader/middleware.go +++ /dev/null @@ -1,40 +0,0 @@ -package httpheader - -import ( - "context" - "fmt" - "net/http" - - "github.com/unrolled/render" -) - -// Middleware ... middleware -type Middleware struct { - httpheader Httpheader -} - -// Handle ... get parameter from header and set to context -func (m *Middleware) Handle(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - p, err := m.httpheader.Get(ctx, r) - if err != nil { - m.renderError(ctx, w, http.StatusBadRequest, "httpheader.Service.Get: "+err.Error()) - return - } - ctx = setParams(ctx, p) - next.ServeHTTP(w, r.WithContext(ctx)) - }) -} - -func (m *Middleware) renderError(ctx context.Context, w http.ResponseWriter, status int, msg string) { - render.New().Text(w, status, fmt.Sprintf("%d invalid header params", status)) -} - -// NewMiddleware ... get middleware -func NewMiddleware(httpheader Httpheader) *Middleware { - return &Middleware{ - httpheader, - } -} diff --git a/internal/pkg/httpheader/model.go b/internal/pkg/httpheader/model.go deleted file mode 100644 index 3113055a2..000000000 --- a/internal/pkg/httpheader/model.go +++ /dev/null @@ -1,6 +0,0 @@ -package httpheader - -// Params ... http header parameter -type Params struct { - Sample string `validate:"required,oneof=sample hoge"` -} diff --git a/internal/pkg/interceptor/requestlog/interceptor.go b/internal/pkg/interceptor/requestlog/interceptor.go deleted file mode 100644 index 01ab89eda..000000000 --- a/internal/pkg/interceptor/requestlog/interceptor.go +++ /dev/null @@ -1,62 +0,0 @@ -package requestlog - -import ( - "context" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/abyssparanoia/rapid-go/internal/pkg/error/grpcerror" - "github.com/blendle/zapdriver" - "github.com/google/uuid" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "go.uber.org/zap" - "google.golang.org/grpc" -) - -const producerID = "rapid-go" - -// UnaryServerInterceptor ... -func UnaryServerInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor { - return func( - ctx context.Context, - req interface{}, - info *grpc.UnaryServerInfo, - handler grpc.UnaryHandler, - ) ( - interface{}, - error, - ) { - - operationID := uuid.New() - - logger.Info("call start", zap.Reflect("request", req), zapdriver.OperationStart(operationID.String(), producerID)) - - ctx = ctxzap.ToContext(ctx, logger.With( - zapdriver.OperationCont(operationID.String(), producerID), - )) - - resp, err := handler(ctx, req) - - if err != nil { - code := grpcerror.ErrToCode(err) - zapcoreLevel := grpcerror.CodeToLevel(code) - logger.Check(zapcoreLevel, "call end").Write( - zapdriver.OperationEnd(operationID.String(), producerID), - zap.String("grpc.code", code.String()), - zap.Error(err), - ) - err = status.Errorf(code, "%s", err.Error()) - return nil, err - } - - logger.Info( - "call end", - zapdriver.OperationEnd(operationID.String(), producerID), - zap.String("grpc.code", codes.OK.String()), - zap.Reflect("response", resp), - ) - - return resp, nil - } -} diff --git a/internal/pkg/log/config.go b/internal/pkg/log/config.go deleted file mode 100644 index b60eb1255..000000000 --- a/internal/pkg/log/config.go +++ /dev/null @@ -1,71 +0,0 @@ -package log - -import ( - "github.com/blendle/zapdriver" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// newTestConfig ... development config -func newTestConfig() zap.Config { - return zap.Config{ - Level: zap.NewAtomicLevelAt(zap.DebugLevel), - Development: true, - Encoding: "console", - // EncoderConfig: zap.NewDevelopmentEncoderConfig(), - EncoderConfig: encoderConfig(), - OutputPaths: []string{"stdout"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -// newDevelopmentConfig ... development config -func newDevelopmentConfig() zap.Config { - return zap.Config{ - Level: zap.NewAtomicLevelAt(zap.DebugLevel), - Development: true, - Encoding: "json", - // EncoderConfig: zap.NewDevelopmentEncoderConfig(), - EncoderConfig: encoderConfig(), - OutputPaths: []string{"stdout"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -// newProductionConfig ... production config -func newProductionConfig() zap.Config { - return zap.Config{ - Level: zap.NewAtomicLevelAt(zap.InfoLevel), - Development: false, - Sampling: &zap.SamplingConfig{ - Initial: 100, - Thereafter: 100, - }, - Encoding: "json", - EncoderConfig: encoderConfig(), - OutputPaths: []string{"stdout"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -func newStackdriverConfig() zap.Config { - cfg := zapdriver.NewProductionConfig() - cfg.DisableStacktrace = true - return cfg -} - -func encoderConfig() zapcore.EncoderConfig { - return zapcore.EncoderConfig{ - TimeKey: "ts", - LevelKey: "status", - NameKey: "logger", - CallerKey: "caller", - MessageKey: "msg", - StacktraceKey: "stacktrace", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.LowercaseLevelEncoder, - EncodeTime: zapcore.EpochTimeEncoder, - EncodeDuration: zapcore.SecondsDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - } -} diff --git a/internal/pkg/log/logger.go b/internal/pkg/log/logger.go deleted file mode 100644 index 3cc59d1fc..000000000 --- a/internal/pkg/log/logger.go +++ /dev/null @@ -1,115 +0,0 @@ -package log - -import ( - "context" - - "go.uber.org/zap/zapcore" - - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "github.com/opentracing/opentracing-go" - "github.com/uber/jaeger-client-go" - "go.uber.org/zap" -) - -// Must ... new logger -func Must(ctx context.Context) *zap.Logger { - return logger(ctx) -} - -// New ... new logger -func New(env string) (*zap.Logger, error) { - return newStackdriverConfig().Build(zap.AddStacktrace(zapcore.WarnLevel)) -} - -// Logger ... get context from context -func logger(ctx context.Context) *zap.Logger { - return ctxzap.Extract(ctx) -} - -// Debugf ... output debug log -func Debugf(ctx context.Context, msg string, fields ...zap.Field) { - withTracing( - ctx, - msg, - func(ctx context.Context, msg string, fields ...zap.Field) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Debug(msg, fields...) - }, - fields...) -} - -// SugarDebugf ... output sugar debug log -func SugarDebugf(ctx context.Context, msg string, args ...interface{}) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Sugar().Debugf(msg, args...) -} - -// Infof ... output info log -func Infof(ctx context.Context, msg string, fields ...zap.Field) { - withTracing( - ctx, - msg, - func(ctx context.Context, msg string, fields ...zap.Field) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Info(msg, fields...) - }, - fields...) -} - -// Warningf ... output warning log -func Warningf(ctx context.Context, msg string, fields ...zap.Field) { - withTracing( - ctx, - msg, - func(ctx context.Context, msg string, fields ...zap.Field) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Warn(msg, fields...) - }, - fields...) -} - -// Errorf ... output error log -func Errorf(ctx context.Context, msg string, fields ...zap.Field) { - withTracing( - ctx, - msg, - func(ctx context.Context, msg string, fields ...zap.Field) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Error(msg, fields...) - }, - fields...) -} - -// ErrorfIfExists ... calls Errorf only when the error exists -func ErrorfIfExists(ctx context.Context, err error, msg string, fields ...zap.Field) { - if err == nil { - return - } - withTracing( - ctx, - msg, - func(ctx context.Context, msg string, fields ...zap.Field) { - logger(ctx).WithOptions(zap.AddCallerSkip(3)).Error(msg, fields...) - }, - fields...) -} - -// LogFunc ... log func type -type LogFunc func(ctx context.Context, msg string, fields ...zap.Field) - -func withTracing( - ctx context.Context, - msg string, - f LogFunc, - fields ...zap.Field, -) { - if len(fields) == 0 { - fields = make([]zap.Field, 0) - } - if ctx != nil { - sp := opentracing.SpanFromContext(ctx) - if sp != nil { - spc := sp.Context().(jaeger.SpanContext) - - fields = append(fields, zap.String("TraceID", spc.TraceID().String())) - fields = append(fields, zap.String("ParentID", spc.ParentID().String())) - fields = append(fields, zap.String("SpanID", spc.SpanID().String())) - } - } - f(ctx, msg, fields...) -} diff --git a/internal/pkg/logger/logger.go b/internal/pkg/logger/logger.go new file mode 100644 index 000000000..d9aafcec1 --- /dev/null +++ b/internal/pkg/logger/logger.go @@ -0,0 +1,23 @@ +package logger + +import ( + "context" + + "github.com/blendle/zapdriver" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" +) + +// New ... new logger +func New() *zap.Logger { + l, err := zapdriver.NewProduction() + if err != nil { + panic(err) + } + return l +} + +// L ... logger +var L = func(ctx context.Context) *zap.Logger { + return ctxzap.Extract(ctx) +} diff --git a/internal/pkg/middleware/requestlog/middleware.go b/internal/pkg/middleware/requestlog/middleware.go deleted file mode 100644 index 848fe6705..000000000 --- a/internal/pkg/middleware/requestlog/middleware.go +++ /dev/null @@ -1,62 +0,0 @@ -package requestlog - -import ( - "net/http" - "time" - - "github.com/abyssparanoia/rapid-go/internal/pkg/error/httperror" - - "github.com/blendle/zapdriver" - "github.com/google/uuid" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "go.uber.org/zap" -) - -const producerID = "rapid-go" - -// HTTPMiddleware ... http middleware -type HTTPMiddleware struct { - logger *zap.Logger -} - -// Handle ... handle http request -func (m *HTTPMiddleware) Handle(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - start := time.Now() - - operationID := uuid.New() - - m.logger.Info("call start", zapdriver.OperationStart(operationID.String(), producerID)) - - ctx := r.Context() - ctx = ctxzap.ToContext(ctx, m.logger.With( - zapdriver.OperationCont(operationID.String(), producerID), - )) - - defer func() { - if rcvr := recover(); rcvr != nil { - } - }() - - sw := &statusWriter{ResponseWriter: w} - - next.ServeHTTP(sw, r.WithContext(ctx)) - - latency := time.Since(start) - zapcoreLevel := httperror.CodeToLevel(sw.status) - ctxzap.Extract(ctx).Check(zapcoreLevel, "call end").Write( - zap.Int("status", sw.status), - zap.Int("content-length", sw.length), - zap.Duration("took", latency), - zap.Int64("latency", latency.Nanoseconds()), - zap.String("remote", r.RemoteAddr), - zap.String("request", r.RequestURI), - zap.String("method", r.Method), - zapdriver.OperationEnd(operationID.String(), producerID)) - }) -} - -// New ... new http middleware -func New(logger *zap.Logger) *HTTPMiddleware { - return &HTTPMiddleware{logger} -} diff --git a/internal/pkg/middleware/requestlog/status_writer.go b/internal/pkg/middleware/requestlog/status_writer.go deleted file mode 100644 index 14ded070a..000000000 --- a/internal/pkg/middleware/requestlog/status_writer.go +++ /dev/null @@ -1,23 +0,0 @@ -package requestlog - -import "net/http" - -type statusWriter struct { - http.ResponseWriter - status int - length int -} - -func (w *statusWriter) WriteHeader(status int) { - w.status = status - w.ResponseWriter.WriteHeader(status) -} - -func (w *statusWriter) Write(b []byte) (int, error) { - if w.status == 0 { - w.status = 200 - } - n, err := w.ResponseWriter.Write(b) - w.length += n - return n, err -} diff --git a/internal/pkg/now/now.go b/internal/pkg/now/now.go new file mode 100644 index 000000000..967590707 --- /dev/null +++ b/internal/pkg/now/now.go @@ -0,0 +1,13 @@ +package now + +import ( + "time" +) + +var JST = time.FixedZone("JST", 9*60*60) + +var Now = func() time.Time { + n := time.Now() + nJST := n.In(JST) + return nJST +} diff --git a/internal/pkg/parameter/form.go b/internal/pkg/parameter/form.go deleted file mode 100644 index f2f15aaf0..000000000 --- a/internal/pkg/parameter/form.go +++ /dev/null @@ -1,151 +0,0 @@ -package parameter - -import ( - "context" - "errors" - "mime/multipart" - "net/http" - "reflect" - "strconv" - - "github.com/abyssparanoia/rapid-go/internal/pkg/util" -) - -// GetForm ... get form value -func GetForm(r *http.Request, key string) string { - return r.FormValue(key) -} - -// GetFormByInt ... get form value by int -func GetFormByInt(ctx context.Context, r *http.Request, key string) (int, error) { - str := r.FormValue(key) - if str == "" { - return 0, nil - } - num, err := strconv.Atoi(str) - if err != nil { - return num, err - } - return num, nil -} - -// GetFormByIntOptional ... get form value by optional int -func GetFormByIntOptional(ctx context.Context, r *http.Request, key string) (*int, error) { - str := r.FormValue(key) - if str == "" { - return nil, nil - } - num, err := strconv.Atoi(str) - if err != nil { - return nil, err - } - return &num, nil -} - -// GetFormByInt64 ... get form value by int64 -func GetFormByInt64(ctx context.Context, r *http.Request, key string) (int64, error) { - str := r.FormValue(key) - if str == "" { - return 0, nil - } - num, err := strconv.ParseInt(str, 10, 64) - if err != nil { - return num, err - } - return num, nil -} - -// GetFormByInt64Optional ... get form value by optional int64 -func GetFormByInt64Optional(ctx context.Context, r *http.Request, key string) (*int64, error) { - str := r.FormValue(key) - if str == "" { - return nil, nil - } - num, err := strconv.ParseInt(str, 10, 64) - if err != nil { - return nil, err - } - return &num, nil -} - -// GetFormByFloat64 ... get form value by float64 -func GetFormByFloat64(ctx context.Context, r *http.Request, key string) (float64, error) { - str := r.FormValue(key) - if str == "" { - return 0, nil - } - num, err := strconv.ParseFloat(str, 64) - if err != nil { - return num, err - } - return num, nil -} - -// GetFormByBool ... get form value by bool -func GetFormByBool(ctx context.Context, r *http.Request, key string) (bool, error) { - str := r.FormValue(key) - if str == "" { - return false, nil - } - val, err := strconv.ParseBool(str) - if err != nil { - return val, err - } - return val, nil -} - -// GetForms ... get form value -func GetForms(ctx context.Context, r *http.Request, dst interface{}) error { - if reflect.TypeOf(dst).Kind() != reflect.Ptr { - return errors.New("dst isn't a pointer") - } - - paramType := reflect.TypeOf(dst).Elem() - paramValue := reflect.ValueOf(dst).Elem() - - fieldCount := paramType.NumField() - for i := 0; i < fieldCount; i++ { - field := paramType.Field(i) - - formTag := paramType.Field(i).Tag.Get("form") - if util.IsZero(formTag) { - continue - } - - fieldValue := paramValue.FieldByName(field.Name) - if !fieldValue.CanSet() { - return errors.New("fieldValue.CanSet") - } - switch field.Type.Kind() { - case reflect.Int64: - val, err := GetFormByInt64(ctx, r, formTag) - if err != nil { - } - fieldValue.SetInt(val) - case reflect.Int: - val, err := GetFormByInt64(ctx, r, formTag) - if err != nil { - } - fieldValue.SetInt(val) - case reflect.Float64: - val, err := GetFormByFloat64(ctx, r, formTag) - if err != nil { - } - fieldValue.SetFloat(val) - case reflect.String: - val := GetForm(r, formTag) - fieldValue.SetString(val) - case reflect.Bool: - val, err := GetFormByBool(ctx, r, formTag) - if err != nil { - } - fieldValue.SetBool(val) - } - } - return nil -} - -// GetFormFile ... get form file -func GetFormFile(r *http.Request, key string) (multipart.File, *multipart.FileHeader, error) { - return r.FormFile(key) -} diff --git a/internal/pkg/parameter/json.go b/internal/pkg/parameter/json.go deleted file mode 100644 index cbcab1c46..000000000 --- a/internal/pkg/parameter/json.go +++ /dev/null @@ -1,16 +0,0 @@ -package parameter - -import ( - "encoding/json" - "net/http" -) - -// GetJSON ... get json data -func GetJSON(r *http.Request, dst interface{}) error { - dec := json.NewDecoder(r.Body) - err := dec.Decode(dst) - if err != nil { - return err - } - return nil -} diff --git a/internal/pkg/parameter/url.go b/internal/pkg/parameter/url.go deleted file mode 100644 index a88718183..000000000 --- a/internal/pkg/parameter/url.go +++ /dev/null @@ -1,53 +0,0 @@ -package parameter - -import ( - "context" - "net/http" - "strconv" - - "github.com/go-chi/chi" -) - -// GetURL ... get url parameter -func GetURL(r *http.Request, key string) string { - return chi.URLParam(r, key) -} - -// GetURLByInt ... get url parameter by int -func GetURLByInt(ctx context.Context, r *http.Request, key string) (int, error) { - str := chi.URLParam(r, key) - if str == "" { - return 0, nil - } - num, err := strconv.Atoi(str) - if err != nil { - return 0, err - } - return num, nil -} - -// GetURLByInt64 ... get url parameter by int64 -func GetURLByInt64(ctx context.Context, r *http.Request, key string) (int64, error) { - str := chi.URLParam(r, key) - if str == "" { - return 0, nil - } - num, err := strconv.ParseInt(str, 10, 64) - if err != nil { - return 0, err - } - return num, nil -} - -// GetURLByFloat64 ... get url parameter by float64 -func GetURLByFloat64(ctx context.Context, r *http.Request, key string) (float64, error) { - str := chi.URLParam(r, key) - if str == "" { - return 0, nil - } - num, err := strconv.ParseFloat(str, 64) - if err != nil { - return 0, err - } - return num, nil -} diff --git a/internal/pkg/renderer/handler.go b/internal/pkg/renderer/handler.go deleted file mode 100644 index f85773fa2..000000000 --- a/internal/pkg/renderer/handler.go +++ /dev/null @@ -1,65 +0,0 @@ -package renderer - -import ( - "context" - "encoding/csv" - "fmt" - "net/http" - - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "go.uber.org/zap" - - "github.com/abyssparanoia/rapid-go/internal/pkg/error/httperror" - "github.com/unrolled/render" - "golang.org/x/text/encoding/japanese" - "golang.org/x/text/transform" -) - -// HandleError ... handle http error -func HandleError(ctx context.Context, w http.ResponseWriter, err error) { - statusCode := httperror.ErrToCode(err) - ctxzap.AddFields(ctx, zap.Error(err)) - Error(ctx, w, statusCode, err.Error()) -} - -// Success ... render success response -func Success(ctx context.Context, w http.ResponseWriter) { - r := render.New() - r.JSON(w, http.StatusOK, NewResponseOK(http.StatusOK)) -} - -// Error ... render error response -func Error(ctx context.Context, w http.ResponseWriter, status int, msg string) { - r := render.New() - r.JSON(w, status, NewResponseError(status, msg)) -} - -// JSON ... render json response -func JSON(ctx context.Context, w http.ResponseWriter, status int, v interface{}) { - r := render.New() - r.JSON(w, status, v) -} - -// HTML ... render html -func HTML(ctx context.Context, w http.ResponseWriter, status int, name string, values interface{}) { - r := render.New() - r.HTML(w, status, name, values) -} - -// Text ... render text -func Text(ctx context.Context, w http.ResponseWriter, status int, body string) { - r := render.New() - r.Text(w, status, body) -} - -// CSV ... render csv -func CSV(ctx context.Context, w http.ResponseWriter, name string, data [][]string) { - w.Header().Set("Content-Type", "text/csv") - w.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=%s.csv", name)) - - writer := csv.NewWriter(transform.NewWriter(w, japanese.ShiftJIS.NewEncoder())) - for _, datum := range data { - writer.Write(datum) - } - writer.Flush() -} diff --git a/internal/pkg/renderer/model.go b/internal/pkg/renderer/model.go deleted file mode 100644 index 997dcc53d..000000000 --- a/internal/pkg/renderer/model.go +++ /dev/null @@ -1,27 +0,0 @@ -package renderer - -// ResponseOK ... success response -type ResponseOK struct { - Status int `json:"status"` -} - -// NewResponseOK ... get success response -func NewResponseOK(status int) *ResponseOK { - return &ResponseOK{ - Status: status, - } -} - -// ResponseError ... error response -type ResponseError struct { - Status int `json:"status"` - Message string `json:"message"` -} - -// NewResponseError ... get error response -func NewResponseError(status int, message string) *ResponseError { - return &ResponseError{ - Status: status, - Message: message, - } -} diff --git a/internal/pkg/ulid/ulid.go b/internal/pkg/ulid/ulid.go new file mode 100644 index 000000000..3e7b7c446 --- /dev/null +++ b/internal/pkg/ulid/ulid.go @@ -0,0 +1,22 @@ +package ulid + +import ( + "math/rand" + + "github.com/abyssparanoia/rapid-go/internal/pkg/now" + "github.com/oklog/ulid" +) + +var New = func() string { + now := now.Now() + entropy := ulid.Monotonic(rand.New(rand.NewSource(now.UnixNano())), 0) + return ulid.MustNew(ulid.Timestamp(now), entropy).String() +} + +func Mock() string { + mockULID := "mock" + New = func() string { + return mockULID + } + return mockULID +} diff --git a/internal/pkg/util/array.go b/internal/pkg/util/array.go deleted file mode 100644 index 6ef610135..000000000 --- a/internal/pkg/util/array.go +++ /dev/null @@ -1,235 +0,0 @@ -package util - -// ArrayStringShuffle ... shuffle string array -func ArrayStringShuffle(arr []string) []string { - n := len(arr) - for i := n - 1; i >= 0; i-- { - j := IntRand(0, i+1) - arr[i], arr[j] = arr[j], arr[i] - } - return arr -} - -// ArrayIntShuffle ... shuffle int array -func ArrayIntShuffle(arr []int) []int { - n := len(arr) - for i := n - 1; i >= 0; i-- { - j := IntRand(0, i+1) - arr[i], arr[j] = arr[j], arr[i] - } - return arr -} - -// ArrayInt64Shuffle ... shuffle int64 array -func ArrayInt64Shuffle(arr []int64) []int64 { - n := len(arr) - for i := n - 1; i >= 0; i-- { - j := IntRand(0, i+1) - arr[i], arr[j] = arr[j], arr[i] - } - return arr -} - -// ArrayStringInsert ... insert string value to array -func ArrayStringInsert(arr []string, v string, i int) []string { - return append(arr[:i], append([]string{v}, arr[i:]...)...) -} - -// ArrayIntInsert ... insert int value to array -func ArrayIntInsert(arr []int, v int, i int) []int { - return append(arr[:i], append([]int{v}, arr[i:]...)...) -} - -// ArrayInt64Insert ... insert int64 value to array -func ArrayInt64Insert(arr []int64, v int64, i int) []int64 { - return append(arr[:i], append([]int64{v}, arr[i:]...)...) -} - -// ArrayStringDelete ... delete string value from array -func ArrayStringDelete(arr []string, i int) []string { - return append(arr[:i], arr[i+1:]...) -} - -// ArrayIntDelete ... delete int value from array -func ArrayIntDelete(arr []int, i int) []int { - return append(arr[:i], arr[i+1:]...) -} - -// ArrayInt64Delete ... delete int64 value from array -func ArrayInt64Delete(arr []int64, i int) []int64 { - return append(arr[:i], arr[i+1:]...) -} - -// ArrayStringShift ... shift string in array -func ArrayStringShift(arr []string) (string, []string) { - return arr[0], arr[1:] -} - -// ArrayIntShift ... shift int value in array -func ArrayIntShift(arr []int) (int, []int) { - return arr[0], arr[1:] -} - -// ArrayInt64Shift ... shift value from array of int64 -func ArrayInt64Shift(arr []int64) (int64, []int64) { - return arr[0], arr[1:] -} - -// ArrayStringBack ... divide value from back of array -func ArrayStringBack(arr []string) (string, []string) { - return arr[len(arr)-1], arr[:len(arr)-1] -} - -// ArrayIntBack ... divide value from back of array -func ArrayIntBack(arr []int) (int, []int) { - return arr[len(arr)-1], arr[:len(arr)-1] -} - -// ArrayInt64Back ... divide value from back of array -func ArrayInt64Back(arr []int64) (int64, []int64) { - return arr[len(arr)-1], arr[:len(arr)-1] -} - -// ArrayStringFilter ... filter array -func ArrayStringFilter(arr []string, fn func(string) bool) []string { - ret := []string{} - for _, v := range arr { - if fn(v) { - ret = append(ret, v) - } - } - return ret -} - -// ArrayIntFilter ... filter array -func ArrayIntFilter(arr []int, fn func(int) bool) []int { - ret := []int{} - for _, v := range arr { - if fn(v) { - ret = append(ret, v) - } - } - return ret -} - -// ArrayInt64Filter ... filter array -func ArrayInt64Filter(arr []int64, fn func(int64) bool) []int64 { - ret := []int64{} - for _, v := range arr { - if fn(v) { - ret = append(ret, v) - } - } - return ret -} - -// ArrayStringUniq ... make unique array -func ArrayStringUniq(arr []string) []string { - m := make(map[string]bool) - uniq := []string{} - for _, v := range arr { - if !m[v] { - m[v] = true - uniq = append(uniq, v) - } - } - return uniq -} - -// ArrayIntUniq ... make unique array -func ArrayIntUniq(arr []int) []int { - m := make(map[int]bool) - uniq := []int{} - for _, v := range arr { - if !m[v] { - m[v] = true - uniq = append(uniq, v) - } - } - return uniq -} - -// ArrayInt64Uniq ... make unique array -func ArrayInt64Uniq(arr []int64) []int64 { - m := make(map[int64]bool) - uniq := []int64{} - for _, v := range arr { - if !m[v] { - m[v] = true - uniq = append(uniq, v) - } - } - return uniq -} - -// ArrayStringContains ... exist value in array -func ArrayStringContains(arr []string, e string) bool { - for _, v := range arr { - if e == v { - return true - } - } - return false -} - -// ArrayIntContains ... exist value in array -func ArrayIntContains(arr []int, e int) bool { - for _, v := range arr { - if e == v { - return true - } - } - return false -} - -// ArrayInt64Contains ... exist value in array -func ArrayInt64Contains(arr []int64, e int64) bool { - for _, v := range arr { - if e == v { - return true - } - } - return false -} - -// ArrayStringChunk ... chunk array -func ArrayStringChunk(arr []string, size int) [][]string { - var chunks [][]string - arrSize := len(arr) - for i := 0; i < arrSize; i += size { - end := i + size - if arrSize < end { - end = arrSize - } - chunks = append(chunks, arr[i:end]) - } - return chunks -} - -// ArrayIntChunk ... chunk array -func ArrayIntChunk(arr []int, size int) [][]int { - var chunks [][]int - arrSize := len(arr) - for i := 0; i < arrSize; i += size { - end := i + size - if arrSize < end { - end = arrSize - } - chunks = append(chunks, arr[i:end]) - } - return chunks -} - -// ArrayInt64Chunk ... chunk array -func ArrayInt64Chunk(arr []int64, size int) [][]int64 { - var chunks [][]int64 - arrSize := len(arr) - for i := 0; i < arrSize; i += size { - end := i + size - if arrSize < end { - end = arrSize - } - chunks = append(chunks, arr[i:end]) - } - return chunks -} diff --git a/internal/pkg/util/bool.go b/internal/pkg/util/bool.go deleted file mode 100644 index b5f899080..000000000 --- a/internal/pkg/util/bool.go +++ /dev/null @@ -1,11 +0,0 @@ -package util - -import ( - "math/rand" -) - -// BoolRand ... generate random bool value -func BoolRand(rate float32) bool { - seed() - return rand.Float32()*100 < rate -} diff --git a/internal/pkg/util/bytes.go b/internal/pkg/util/bytes.go deleted file mode 100644 index 1cf541dba..000000000 --- a/internal/pkg/util/bytes.go +++ /dev/null @@ -1,8 +0,0 @@ -package util - -import "unsafe" - -// BytesToStr ... convert byte to string -func BytesToStr(bytes []byte) string { - return *(*string)(unsafe.Pointer(&bytes)) -} diff --git a/internal/pkg/util/common.go b/internal/pkg/util/common.go deleted file mode 100644 index c6fe1ed44..000000000 --- a/internal/pkg/util/common.go +++ /dev/null @@ -1,48 +0,0 @@ -package util - -import ( - "math/rand" - "time" -) - -func seed() { - rand.Seed(time.Now().UnixNano()) -} - -// IsZero ... check zero value -func IsZero(val interface{}) bool { - switch val.(type) { - case nil: - return true - case int: - if val.(int) == 0 { - return true - } - return false - case int64: - if val.(int64) == 0 { - return true - } - return false - case float64: - if val.(float64) == 0 { - return true - } - return false - case string: - if val.(string) == "" { - return true - } - return false - case bool: - if !val.(bool) { - return true - } - return false - default: - if val == nil { - return true - } - return false - } -} diff --git a/internal/pkg/util/int.go b/internal/pkg/util/int.go deleted file mode 100644 index 03d893080..000000000 --- a/internal/pkg/util/int.go +++ /dev/null @@ -1,11 +0,0 @@ -package util - -import ( - "math/rand" -) - -// IntRand ... generate random int value -func IntRand(min int, max int) int { - seed() - return rand.Intn(max-min) + max -} diff --git a/internal/pkg/util/string.go b/internal/pkg/util/string.go deleted file mode 100644 index 646214e5a..000000000 --- a/internal/pkg/util/string.go +++ /dev/null @@ -1,36 +0,0 @@ -package util - -import ( - "crypto/md5" - "crypto/sha256" - "encoding/hex" - "fmt" - "io" - "unsafe" - - "github.com/rs/xid" -) - -// StrToMD5 ... generate hash string by MD5 -func StrToMD5(str string) string { - h := md5.New() - io.WriteString(h, str) - return fmt.Sprintf("%x", h.Sum(nil)) -} - -// StrToSHA256 ... generate hash string by sha256 -func StrToSHA256(str string) string { - c := sha256.Sum256([]byte(str)) - return hex.EncodeToString(c[:]) -} - -// StrToBytes ... convert string to bytes -func StrToBytes(str string) []byte { - return *(*[]byte)(unsafe.Pointer(&str)) -} - -// StrUniqueID ... get unique id -func StrUniqueID() string { - guid := xid.New() - return guid.String() -} diff --git a/internal/pkg/util/time.go b/internal/pkg/util/time.go deleted file mode 100644 index a0b0e7f41..000000000 --- a/internal/pkg/util/time.go +++ /dev/null @@ -1,29 +0,0 @@ -package util - -import ( - "time" -) - -// TimeNow ... get recent time of JST -func TimeNow() time.Time { - return time.Now().In(timeZoneJST()) -} - -// TimeJST ... get time of JST from Time -func TimeJST(t time.Time) time.Time { - return t.In(timeZoneJST()) -} - -// TimeUnix ... get time of JST from unix timestamp -func TimeUnix(u int64) time.Time { - return time.Unix(u, 0).In(timeZoneJST()) -} - -func timeZoneJST() *time.Location { - return time.FixedZone("Asia/Tokyo", 9*60*60) -} - -// TimeNowUnixMill ... get recent time of unixtime mill seccond -func TimeNowUnixMill() int64 { - return time.Now().In(timeZoneJST()).UnixNano() / int64(time.Millisecond) -} diff --git a/internal/pkg/validation/validation.go b/internal/pkg/validation/validation.go new file mode 100644 index 000000000..c260c6c55 --- /dev/null +++ b/internal/pkg/validation/validation.go @@ -0,0 +1,14 @@ +package validation + +import ( + "github.com/go-playground/validator/v10" +) + +var v = validator.New() + +func Validate(s interface{}) error { + if err := v.Struct(s); err != nil { + return err + } + return nil +} diff --git a/internal/push-notification/config/const.go b/internal/push-notification/config/const.go deleted file mode 100644 index 680861e33..000000000 --- a/internal/push-notification/config/const.go +++ /dev/null @@ -1,6 +0,0 @@ -package config - -const ( - // TopicAll ... all users topic - TopicAll = "all" -) diff --git a/internal/push-notification/domain/model/message.go b/internal/push-notification/domain/model/message.go deleted file mode 100644 index b76f296d2..000000000 --- a/internal/push-notification/domain/model/message.go +++ /dev/null @@ -1,53 +0,0 @@ -package model - -// Message ... push notification message -type Message struct { - Title string `json:"title"` - Body string `json:"body"` - Data map[string]string `json:"data"` - IOS *MessageIOS `json:"ios"` - Android *MessageAndroid `json:"android"` - Web *MessageWeb `json:"web"` -} - -// MessageIOS ... push notification message only ios -type MessageIOS struct { - Badge int `json:"badge,omitempty"` - Sound string `json:"sound,omitempty"` -} - -// NewMessageIOS ... new message IOS -func NewMessageIOS(badge int, sound string) *MessageIOS { - return &MessageIOS{ - Badge: badge, - Sound: sound, - } -} - -// MessageAndroid ... push notification message only android -type MessageAndroid struct { - ClickAction string `json:"click_action,omitempty"` - Sound string `json:"sound,omitempty"` - Tag string `json:"badge,omitempty"` -} - -// NewMessageAndroid ... new message android -func NewMessageAndroid(clickAction, sound, tag string) *MessageAndroid { - return &MessageAndroid{ - ClickAction: clickAction, - Sound: sound, - Tag: tag, - } -} - -// MessageWeb ... push notification message only web -type MessageWeb struct { - Icon string `json:"icon,omitempty"` -} - -// NewMessageWeb ... new message web -func NewMessageWeb(icon string) *MessageWeb { - return &MessageWeb{ - Icon: icon, - } -} diff --git a/internal/push-notification/domain/model/token.go b/internal/push-notification/domain/model/token.go deleted file mode 100644 index e6df5ee76..000000000 --- a/internal/push-notification/domain/model/token.go +++ /dev/null @@ -1,87 +0,0 @@ -package model - -import ( - "context" - - "github.com/pkg/errors" - - "github.com/abyssparanoia/rapid-go/internal/pkg/util" -) - -// Token ... token model -type Token struct { - ID string - Platform Platform - AppID string - UserID string - DeviceID string - Value string - CreatedAt int64 -} - -// Exists ... check exists or not -func (m *Token) Exists() bool { - return m != nil -} - -// NewToken ... new token model -func NewToken(platform Platform, - appID, deviceID, value string, -) *Token { - return &Token{ - Platform: platform, - AppID: appID, - DeviceID: deviceID, - Value: value, - CreatedAt: util.TimeNowUnixMill(), - } -} - -// NewTokenValues ... get token value list from token model list -func NewTokenValues(tokens []*Token) []string { - tokenValues := make([]string, len(tokens)) - for index, token := range tokens { - tokenValues[index] = token.Value - } - return tokenValues -} - -// Platform ... platform type -type Platform string - -const ( - // PlatformIOS ... ios - PlatformIOS Platform = "ios" - // PlatformAndroid ... android - PlatformAndroid Platform = "android" - // PlatformWeb ... web - PlatformWeb Platform = "web" -) - -// NewPlatform ... new platform -func NewPlatform(ctx context.Context, platform string) (Platform, error) { - - switch Platform(platform) { - case PlatformIOS, PlatformAndroid, PlatformWeb: - return Platform(platform), nil - default: - } - - return "", errors.New("no match case") -} - -// MustPlatform ... must platform -func MustPlatform(platform string) Platform { - - switch Platform(platform) { - case PlatformIOS, PlatformAndroid, PlatformWeb: - return Platform(platform) - default: - } - - panic("no match case") -} - -func (v Platform) String() string { - return string(v) -} diff --git a/internal/push-notification/domain/repository/fcm.go b/internal/push-notification/domain/repository/fcm.go deleted file mode 100644 index 0f3cda4af..000000000 --- a/internal/push-notification/domain/repository/fcm.go +++ /dev/null @@ -1,29 +0,0 @@ -package repository - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" -) - -// Fcm ... fcm repository interface -type Fcm interface { - SubscribeTopic( - ctx context.Context, - topic string, - tokens []string) error - Unsubscribe( - ctx context.Context, - topic string, - tokens []string) error - SendMessageByTokens( - ctx context.Context, - appID string, - tokens []string, - message *model.Message) error - SendMessageByTopic( - ctx context.Context, - appID string, - topic string, - message *model.Message) error -} diff --git a/internal/push-notification/domain/repository/token.go b/internal/push-notification/domain/repository/token.go deleted file mode 100644 index ee53d7865..000000000 --- a/internal/push-notification/domain/repository/token.go +++ /dev/null @@ -1,23 +0,0 @@ -package repository - -import ( - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - - "context" -) - -// Token ... token repository interface -type Token interface { - GetByPlatformAndDeviceIDAndUserID(ctx context.Context, - appID, userID, deviceID string, - platform model.Platform) (*model.Token, error) - List(ctx context.Context) ([]*model.Token, error) - ListByUserID(ctx context.Context, - appID, userID string) ([]*model.Token, error) - Create(ctx context.Context, - token *model.Token) (*model.Token, error) - Update(ctx context.Context, - token *model.Token) error - Delete(ctx context.Context, - tokenID string) error -} diff --git a/internal/push-notification/domain/service/token.go b/internal/push-notification/domain/service/token.go deleted file mode 100644 index ba71f7f76..000000000 --- a/internal/push-notification/domain/service/token.go +++ /dev/null @@ -1,13 +0,0 @@ -package service - -import ( - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - - "context" -) - -// Token ... token service interface -type Token interface { - Set(ctx context.Context, - token *model.Token) error -} diff --git a/internal/push-notification/domain/service/token_impl.go b/internal/push-notification/domain/service/token_impl.go deleted file mode 100644 index 9b3a4c04c..000000000 --- a/internal/push-notification/domain/service/token_impl.go +++ /dev/null @@ -1,44 +0,0 @@ -package service - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/repository" -) - -type token struct { - tokenRepository repository.Token -} - -func (s *token) Set(ctx context.Context, - token *model.Token) error { - - currentToken, err := s.tokenRepository.GetByPlatformAndDeviceIDAndUserID(ctx, token.AppID, token.UserID, token.DeviceID, token.Platform) - if err != nil { - return err - } - // if current token exists, check token value and update token - if currentToken.Exists() && token.Value != currentToken.Value { - token.Value = currentToken.Value - err = s.tokenRepository.Update(ctx, token) - if err != nil { - return err - } - // if not exists, create token document - } else if !currentToken.Exists() { - _, err = s.tokenRepository.Create(ctx, token) - if err != nil { - return err - } - } - - return nil -} - -// NewToken ... new token service -func NewToken( - tokenRepository repository.Token, -) Token { - return &token{tokenRepository} -} diff --git a/internal/push-notification/handler/api/message.go b/internal/push-notification/handler/api/message.go deleted file mode 100644 index 6bae11f5a..000000000 --- a/internal/push-notification/handler/api/message.go +++ /dev/null @@ -1,120 +0,0 @@ -package api - -import ( - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/pkg/parameter" - "github.com/abyssparanoia/rapid-go/internal/pkg/renderer" - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase" - validator "github.com/go-playground/validator" -) - -// MessageHandler ... message handler -type MessageHandler struct { - messageUsecase usecase.Message -} - -// SendToUser ... send to user handler -func (h *MessageHandler) SendToUser(w http.ResponseWriter, r *http.Request) { - - ctx := r.Context() - - var param struct { - AppID string `json:"app_id" validate:"required"` - UserID string `json:"user_id" validate:"required"` - MessageRequest *input.MessageRequest `json:"message" validate:"required"` - } - - err := parameter.GetJSON(r, ¶m) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - dto := input.NewMessageSendToUser(param.AppID, param.UserID, param.MessageRequest) - err = h.messageUsecase.SendToUser(ctx, dto) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.Success(ctx, w) -} - -// SendToMultiUser ... send to multi user handler -func (h *MessageHandler) SendToMultiUser(w http.ResponseWriter, r *http.Request) { - - ctx := r.Context() - - var param struct { - AppID string `json:"app_id" validate:"required"` - UserIDList []string `json:"user_id_list" validate:"required"` - MessageRequest *input.MessageRequest `json:"message" validate:"required"` - } - - err := parameter.GetJSON(r, ¶m) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - dto := input.NewMessageSendToMultiUser(param.AppID, param.UserIDList, param.MessageRequest) - err = h.messageUsecase.SendToMultiUser(ctx, dto) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.Success(ctx, w) -} - -// SendToAllUser ... send to all user handler -func (h *MessageHandler) SendToAllUser(w http.ResponseWriter, r *http.Request) { - - ctx := r.Context() - - var param struct { - AppID string `json:"app_id" validate:"required"` - MessageRequest *input.MessageRequest `json:"message" validate:"required"` - } - - err := parameter.GetJSON(r, ¶m) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - dto := input.NewMessageSendToAllUser(param.AppID, param.MessageRequest) - err = h.messageUsecase.SendToAllUser(ctx, dto) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.Success(ctx, w) -} - -// NewMessageHandler ... new message handler -func NewMessageHandler(messageUsecase usecase.Message) *MessageHandler { - return &MessageHandler{messageUsecase} -} diff --git a/internal/push-notification/handler/api/token.go b/internal/push-notification/handler/api/token.go deleted file mode 100644 index 5561bc530..000000000 --- a/internal/push-notification/handler/api/token.go +++ /dev/null @@ -1,101 +0,0 @@ -package api - -import ( - "net/http" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" - validator "github.com/go-playground/validator" - - "github.com/abyssparanoia/rapid-go/internal/pkg/parameter" - "github.com/abyssparanoia/rapid-go/internal/pkg/renderer" - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase" -) - -// TokenHandler ... token handler struct -type TokenHandler struct { - tokenUsecase usecase.Token -} - -// Set ... token set handler -func (h *TokenHandler) Set(w http.ResponseWriter, r *http.Request) { - - ctx := r.Context() - - var param struct { - AppID string `json:"app_id" validate:"required"` - UserID string `json:"user_id" validate:"required"` - Platform string `json:"platform" validate:"required"` - DeviceID string `json:"device_id" validate:"required"` - Token string `json:"token" validate:"required"` - } - - err := parameter.GetJSON(r, ¶m) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - dto, err := input.NewTokenSet(ctx, param.AppID, param.UserID, param.Platform, param.DeviceID, param.Token) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - err = h.tokenUsecase.Set(ctx, dto) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.Success(ctx, w) -} - -// Delete ... delete token handler -func (h *TokenHandler) Delete(w http.ResponseWriter, r *http.Request) { - - ctx := r.Context() - - var param struct { - AppID string `json:"app_id" validate:"required"` - UserID string `json:"user_id" validate:"required"` - Platform string `json:"platform" validate:"required"` - DeviceID string `json:"device_id" validate:"required"` - } - - err := parameter.GetJSON(r, ¶m) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - v := validator.New() - if err := v.Struct(param); err != nil { - renderer.HandleError(ctx, w, err) - return - } - - dto, err := input.NewTokenDelete(ctx, param.AppID, param.UserID, param.Platform, param.DeviceID) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - err = h.tokenUsecase.Delete(ctx, dto) - if err != nil { - renderer.HandleError(ctx, w, err) - return - } - - renderer.Success(ctx, w) -} - -// NewTokenHandler ... new token handler -func NewTokenHandler(tokenUsecase usecase.Token) *TokenHandler { - return &TokenHandler{tokenUsecase} -} diff --git a/internal/push-notification/handler/empty.go b/internal/push-notification/handler/empty.go deleted file mode 100644 index 7e0625bf9..000000000 --- a/internal/push-notification/handler/empty.go +++ /dev/null @@ -1,7 +0,0 @@ -package handler - -import "net/http" - -// Empty ... empty handler -func Empty(w http.ResponseWriter, r *http.Request) { -} diff --git a/internal/push-notification/handler/ping.go b/internal/push-notification/handler/ping.go deleted file mode 100644 index 27485212f..000000000 --- a/internal/push-notification/handler/ping.go +++ /dev/null @@ -1,11 +0,0 @@ -package handler - -import ( - "net/http" -) - -// Ping ... confirmation survival -func Ping(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.Write([]byte("pongpong")) -} diff --git a/internal/push-notification/infrastructure/internal/entity/message.go b/internal/push-notification/infrastructure/internal/entity/message.go deleted file mode 100644 index 43d284c7c..000000000 --- a/internal/push-notification/infrastructure/internal/entity/message.go +++ /dev/null @@ -1,68 +0,0 @@ -package entity - -import ( - "fmt" - - "firebase.google.com/go/messaging" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" -) - -// NewMessageFromModel ... new message from model -func NewMessageFromModel(m *model.Message, serverKey string) *messaging.Message { - - e := &messaging.Message{} - - if m.IOS == nil { - m.IOS = &model.MessageIOS{ - Badge: 1, - } - } - - if m.Android == nil { - m.Android = &model.MessageAndroid{} - } - - if m.Web == nil { - m.Web = &model.MessageWeb{} - } - - e.Notification = &messaging.Notification{ - Title: m.Title, - Body: m.Body, - } - - e.Data = m.Data - - e.APNS = &messaging.APNSConfig{ - Headers: map[string]string{ - "apns-priority": "10", - }, - Payload: &messaging.APNSPayload{ - Aps: &messaging.Aps{ - Badge: &m.IOS.Badge, - Sound: m.IOS.Sound, - }, - CustomData: map[string]interface{}{ - "notification_foreground": true, - }, - }} - - e.Android = &messaging.AndroidConfig{ - Notification: &messaging.AndroidNotification{ - ClickAction: m.Android.ClickAction, - Sound: m.Android.Sound, - Tag: m.Android.Tag, - }} - - e.Webpush = &messaging.WebpushConfig{ - Headers: map[string]string{ - "Content-Type": "application/json", - "Authorization": fmt.Sprintf("Bearer %s", serverKey), - }, - Notification: &messaging.WebpushNotification{ - Icon: m.Web.Icon, - }, - } - - return e -} diff --git a/internal/push-notification/infrastructure/internal/entity/token.go b/internal/push-notification/infrastructure/internal/entity/token.go deleted file mode 100644 index fdfecf4ff..000000000 --- a/internal/push-notification/infrastructure/internal/entity/token.go +++ /dev/null @@ -1,59 +0,0 @@ -package entity - -import ( - "cloud.google.com/go/firestore" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" -) - -// Token ... token entity -type Token struct { - ID string `firestore:"-" gluefirestore:"id"` - Ref *firestore.DocumentRef `firestore:"-" gluefirestore:"ref"` - AppID string `firestore:"app_id"` - UserID string `firestore:"user_id"` - Platform string `firestore:"platform"` - DeviceID string `firestore:"device_id"` - Value string `firestore:"value"` - CreatedAt int64 `firestore:"created_at"` -} - -// OutputModel ... output model -func (e *Token) OutputModel() *model.Token { - return &model.Token{ - ID: e.ID, - AppID: e.AppID, - UserID: e.UserID, - Platform: model.MustPlatform(e.Platform), - DeviceID: e.DeviceID, - Value: e.Value, - CreatedAt: e.CreatedAt, - } -} - -// NewTokenFromModel ... new token from model -func NewTokenFromModel(m *model.Token) *Token { - e := &Token{} - e.ID = m.ID - e.AppID = m.AppID - e.UserID = m.UserID - e.Platform = m.Platform.String() - e.DeviceID = m.DeviceID - e.Value = m.Value - e.CreatedAt = m.CreatedAt - - return e -} - -// NewTokenMultiOutputModels ... multi output models -func NewTokenMultiOutputModels(dsts []*Token) (tokens []*model.Token) { - for _, dst := range dsts { - tokens = append(tokens, dst.OutputModel()) - } - return tokens -} - -// NewTokenCollectionRef ... new token collection ref -func NewTokenCollectionRef(fCli *firestore.Client) *firestore.CollectionRef { - return fCli.Collection("push-notification-tokens") -} diff --git a/internal/push-notification/infrastructure/repository/fcm_impl.go b/internal/push-notification/infrastructure/repository/fcm_impl.go deleted file mode 100644 index 480d758c4..000000000 --- a/internal/push-notification/infrastructure/repository/fcm_impl.go +++ /dev/null @@ -1,99 +0,0 @@ -package repository - -import ( - "context" - "fmt" - - "github.com/pkg/errors" - - "firebase.google.com/go/messaging" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/repository" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/infrastructure/internal/entity" -) - -type fcm struct { - messagingClient *messaging.Client - serverKey string -} - -func (r *fcm) SubscribeTopic( - ctx context.Context, - topic string, - tokens []string) error { - - res, err := r.messagingClient.SubscribeToTopic(ctx, tokens, topic) - if err != nil { - return err - } - if res.FailureCount > 0 { - for _, rerr := range res.Errors { - return errors.New(fmt.Sprintf("SubscribeToTopic index: %d, reason: %s", rerr.Index, rerr.Reason)) - } - } - return nil -} - -func (r *fcm) Unsubscribe( - ctx context.Context, - topic string, - tokens []string) error { - - res, err := r.messagingClient.UnsubscribeFromTopic(ctx, tokens, topic) - if err != nil { - return err - } - if res.FailureCount > 0 { - for _, rerr := range res.Errors { - return errors.New(fmt.Sprintf("UnsubscribeFromTopic index: %d, reason: %s", rerr.Index, rerr.Reason)) - } - } - return nil -} - -func (r *fcm) SendMessageByTokens( - ctx context.Context, - appID string, - tokens []string, - message *model.Message) error { - - messageEntity := entity.NewMessageFromModel(message, r.serverKey) - - multiMessage := &messaging.MulticastMessage{ - Tokens: tokens, - Notification: messageEntity.Notification, - Data: messageEntity.Data, - APNS: messageEntity.APNS, - Android: messageEntity.Android, - Webpush: messageEntity.Webpush, - } - - _, err := r.messagingClient.SendMulticast(ctx, multiMessage) - if err != nil { - return err - } - return nil - -} - -func (r *fcm) SendMessageByTopic( - ctx context.Context, - appID string, - topic string, - message *model.Message) error { - - messageEntity := entity.NewMessageFromModel(message, r.serverKey) - messageEntity.Topic = topic - _, err := r.messagingClient.Send(ctx, messageEntity) - if err != nil { - return err - } - return nil -} - -// NewFcm ... new fcm repository -func NewFcm(messagingClient *messaging.Client, - serverKey string) repository.Fcm { - return &fcm{messagingClient, serverKey} -} diff --git a/internal/push-notification/infrastructure/repository/token_impl.go b/internal/push-notification/infrastructure/repository/token_impl.go deleted file mode 100644 index 0f860e1e7..000000000 --- a/internal/push-notification/infrastructure/repository/token_impl.go +++ /dev/null @@ -1,140 +0,0 @@ -package repository - -import ( - "context" - - "cloud.google.com/go/firestore" - "github.com/abyssparanoia/rapid-go/internal/pkg/gluefirestore" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/repository" - "github.com/abyssparanoia/rapid-go/internal/push-notification/infrastructure/internal/entity" -) - -type token struct { - firestoreClient *firestore.Client -} - -func (r *token) GetByPlatformAndDeviceIDAndUserID(ctx context.Context, - appID, userID, deviceID string, - platform model.Platform) (*model.Token, error) { - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - query := colRef. - Where("app_id", "==", appID). - Where("user_id", "==", userID). - Where("device_id", "==", deviceID). - Where("platform", "==", platform.String()) - - tokenEntity := &entity.Token{} - exist, err := gluefirestore.GetByQuery(ctx, query, tokenEntity) - if err != nil { - return nil, err - } - if !exist { - return nil, nil - } - - return tokenEntity.OutputModel(), nil -} - -func (r *token) List(ctx context.Context) ([]*model.Token, error) { - - tokenEntityList := []*entity.Token{} - var cursor *firestore.DocumentSnapshot - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - - for { - _tokenEntityList := []*entity.Token{} - var dsnp *firestore.DocumentSnapshot - query := colRef.Query - - if cursor != nil { - query.StartAfter(cursor) - } - - err := gluefirestore.ListByQuery(ctx, query, _tokenEntityList) - if err != nil { - return nil, err - } - - var nCursor *firestore.DocumentSnapshot - if len(_tokenEntityList) == 300 { - nCursor = dsnp - } - for _, tokenEntity := range _tokenEntityList { - tokenEntityList = append(tokenEntityList, tokenEntity) - } - if nCursor == nil { - break - } - cursor = nCursor - } - - return entity.NewTokenMultiOutputModels(tokenEntityList), nil -} - -func (r *token) ListByUserID(ctx context.Context, - appID, userID string) ([]*model.Token, error) { - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - query := colRef. - Where("app_id", "==", appID). - Where("user_id", "==", userID) - - tokenEntityList := []*entity.Token{} - err := gluefirestore.ListByQuery(ctx, query, tokenEntityList) - if err != nil { - return nil, err - } - return entity.NewTokenMultiOutputModels(tokenEntityList), nil -} - -func (r *token) Create(ctx context.Context, - token *model.Token) (*model.Token, error) { - - tokenEntity := entity.NewTokenFromModel(token) - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - - err := gluefirestore.Create(ctx, colRef, tokenEntity) - if err != nil { - return nil, err - } - - return tokenEntity.OutputModel(), nil -} - -func (r *token) Update(ctx context.Context, - token *model.Token) error { - - tokenEntity := entity.NewTokenFromModel(token) - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - docRef := colRef.Doc(token.ID) - err := gluefirestore.Set(ctx, docRef, tokenEntity) - if err != nil { - return err - } - - return nil -} - -func (r *token) Delete(ctx context.Context, - tokenID string) error { - - colRef := entity.NewTokenCollectionRef(r.firestoreClient) - docRef := colRef.Doc(tokenID) - - err := gluefirestore.Delete(ctx, docRef) - if err != nil { - return err - } - - return nil -} - -// NewToken ... new token repository -func NewToken(firestoreClient *firestore.Client) repository.Token { - return &token{firestoreClient} -} diff --git a/internal/push-notification/usecase/input/message.go b/internal/push-notification/usecase/input/message.go deleted file mode 100644 index 526c8e37e..000000000 --- a/internal/push-notification/usecase/input/message.go +++ /dev/null @@ -1,129 +0,0 @@ -package input - -import ( - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" -) - -// MessageRequest ... push notification message -type MessageRequest struct { - Title string `json:"title"` - Body string `json:"body"` - Data map[string]string `json:"data"` - IOS *MessageIOS `json:"ios"` - Android *MessageAndroid `json:"android"` - Web *MessageWeb `json:"web"` -} - -// MessageIOS ... push notification message only ios -type MessageIOS struct { - Badge int `json:"badge,omitempty"` - Sound string `json:"sound,omitempty"` -} - -// OutputModel ... output model -func (e *MessageIOS) OutputModel() *model.MessageIOS { - if e == nil { - return nil - } - return model.NewMessageIOS(e.Badge, e.Sound) -} - -// MessageAndroid ... push notification message only android -type MessageAndroid struct { - ClickAction string `json:"click_action,omitempty"` - Sound string `json:"sound,omitempty"` - Tag string `json:"badge,omitempty"` -} - -// OutputModel ... output model -func (e *MessageAndroid) OutputModel() *model.MessageAndroid { - if e == nil { - return nil - } - return model.NewMessageAndroid(e.ClickAction, e.Sound, e.Tag) -} - -// MessageWeb ... push notification message only web -type MessageWeb struct { - Icon string `json:"icon,omitempty"` -} - -// OutputModel ... output model -func (e *MessageWeb) OutputModel() *model.MessageWeb { - if e == nil { - return nil - } - return model.NewMessageWeb(e.Icon) -} - -// MessageSendToUser ... -type MessageSendToUser struct { - AppID string - UserID string - Message *model.Message -} - -// NewMessageSendToUser ... new message send to user input -func NewMessageSendToUser(appID, userID string, - message *MessageRequest) *MessageSendToUser { - return &MessageSendToUser{ - AppID: appID, - UserID: userID, - Message: &model.Message{ - Title: message.Title, - Body: message.Body, - Data: message.Data, - IOS: message.IOS.OutputModel(), - Android: message.Android.OutputModel(), - Web: message.Web.OutputModel(), - }, - } - -} - -// MessageSendToMultiUser ... -type MessageSendToMultiUser struct { - AppID string - UserIDList []string - Message *model.Message -} - -// NewMessageSendToMultiUser ... -func NewMessageSendToMultiUser(appID string, - userIDList []string, - message *MessageRequest) *MessageSendToMultiUser { - return &MessageSendToMultiUser{ - AppID: appID, - UserIDList: userIDList, - Message: &model.Message{ - Title: message.Title, - Body: message.Body, - Data: message.Data, - IOS: message.IOS.OutputModel(), - Android: message.Android.OutputModel(), - Web: message.Web.OutputModel(), - }, - } -} - -// MessageSendToAllUser ... -type MessageSendToAllUser struct { - AppID string - Message *model.Message -} - -// NewMessageSendToAllUser ... -func NewMessageSendToAllUser(appID string, - message *MessageRequest) *MessageSendToAllUser { - return &MessageSendToAllUser{ - AppID: appID, - Message: &model.Message{ - Title: message.Title, - Body: message.Body, - Data: message.Data, - IOS: message.IOS.OutputModel(), - Android: message.Android.OutputModel(), - Web: message.Web.OutputModel(), - }, - } -} diff --git a/internal/push-notification/usecase/input/token.go b/internal/push-notification/usecase/input/token.go deleted file mode 100644 index 89c0b1b3f..000000000 --- a/internal/push-notification/usecase/input/token.go +++ /dev/null @@ -1,69 +0,0 @@ -package input - -import ( - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - - "context" -) - -// TokenSet ... register set token input -type TokenSet struct { - AppID string - UserID string - Platform model.Platform - DeviceID string - Token string -} - -// NewTokenSet ... new register set token input -func NewTokenSet( - ctx context.Context, - appID string, - userID string, - platform string, - deviceID string, - token string) (*TokenSet, error) { - - _platform, err := model.NewPlatform(ctx, platform) - if err != nil { - return nil, err - } - - return &TokenSet{ - AppID: appID, - UserID: userID, - Platform: _platform, - DeviceID: deviceID, - Token: token, - }, nil -} - -// TokenDelete ... register delete token input -type TokenDelete struct { - AppID string - UserID string - Platform model.Platform - DeviceID string -} - -// NewTokenDelete ... new register delete token input -func NewTokenDelete( - ctx context.Context, - appID string, - userID string, - platform string, - deviceID string, -) (*TokenDelete, error) { - - _platform, err := model.NewPlatform(ctx, platform) - if err != nil { - return nil, err - } - - return &TokenDelete{ - AppID: appID, - UserID: userID, - Platform: _platform, - DeviceID: deviceID, - }, nil -} diff --git a/internal/push-notification/usecase/message.go b/internal/push-notification/usecase/message.go deleted file mode 100644 index 8343a89b3..000000000 --- a/internal/push-notification/usecase/message.go +++ /dev/null @@ -1,17 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" -) - -// Message ... message usecase interface -type Message interface { - SendToUser(ctx context.Context, - dto *input.MessageSendToUser) error - SendToMultiUser(ctx context.Context, - dto *input.MessageSendToMultiUser) error - SendToAllUser(ctx context.Context, - dto *input.MessageSendToAllUser) error -} diff --git a/internal/push-notification/usecase/message_impl.go b/internal/push-notification/usecase/message_impl.go deleted file mode 100644 index 252987b40..000000000 --- a/internal/push-notification/usecase/message_impl.go +++ /dev/null @@ -1,76 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/config" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/repository" - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" -) - -type message struct { - fcmRepository repository.Fcm - tokenRepository repository.Token -} - -func (u *message) SendToUser(ctx context.Context, - dto *input.MessageSendToUser) error { - - tokens, err := u.tokenRepository.ListByUserID(ctx, dto.AppID, dto.UserID) - if err != nil { - return nil - } - if len(tokens) == 0 { - return nil - } - - tokenValues := model.NewTokenValues(tokens) - - err = u.fcmRepository.SendMessageByTokens(ctx, dto.AppID, tokenValues, dto.Message) - if err != nil { - return nil - } - - return nil -} - -func (u *message) SendToMultiUser(ctx context.Context, - dto *input.MessageSendToMultiUser) error { - - tokenValues := []string{} - - for _, userID := range dto.UserIDList { - tokens, err := u.tokenRepository.ListByUserID(ctx, dto.AppID, userID) - if err != nil { - return nil - } - if len(tokens) == 0 { - return nil - } - - tokenValues = append(tokenValues, model.NewTokenValues(tokens)...) - } - - err := u.fcmRepository.SendMessageByTokens(ctx, dto.AppID, tokenValues, dto.Message) - if err != nil { - return nil - } - return nil -} - -func (u *message) SendToAllUser(ctx context.Context, - dto *input.MessageSendToAllUser) error { - - err := u.fcmRepository.SendMessageByTopic(ctx, dto.AppID, config.TopicAll, dto.Message) - if err != nil { - return err - } - return nil - -} - -// NewMessage ... new message usecase -func NewMessage(fcmRepository repository.Fcm, tokenRepository repository.Token) Message { - return &message{fcmRepository, tokenRepository} -} diff --git a/internal/push-notification/usecase/token.go b/internal/push-notification/usecase/token.go deleted file mode 100644 index 153e8a9f4..000000000 --- a/internal/push-notification/usecase/token.go +++ /dev/null @@ -1,15 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" -) - -// Token ... token usecase -type Token interface { - Set(ctx context.Context, - dto *input.TokenSet) error - Delete(ctx context.Context, - dto *input.TokenDelete) error -} diff --git a/internal/push-notification/usecase/token_impl.go b/internal/push-notification/usecase/token_impl.go deleted file mode 100644 index e27066eae..000000000 --- a/internal/push-notification/usecase/token_impl.go +++ /dev/null @@ -1,61 +0,0 @@ -package usecase - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/push-notification/config" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/model" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/repository" - "github.com/abyssparanoia/rapid-go/internal/push-notification/domain/service" - "github.com/abyssparanoia/rapid-go/internal/push-notification/usecase/input" -) - -type token struct { - fcmRepository repository.Fcm - tokenRepository repository.Token - tokenService service.Token -} - -func (u *token) Set(ctx context.Context, - dto *input.TokenSet) error { - - token := model.NewToken(dto.Platform, dto.AppID, dto.DeviceID, dto.Token) - err := u.tokenService.Set(ctx, token) - if err != nil { - return nil - } - - err = u.fcmRepository.SubscribeTopic(ctx, config.TopicAll, []string{token.Value}) - if err != nil { - return nil - } - - return nil -} - -func (u *token) Delete(ctx context.Context, - dto *input.TokenDelete) error { - token, err := u.tokenRepository.GetByPlatformAndDeviceIDAndUserID(ctx, dto.AppID, dto.UserID, dto.DeviceID, dto.Platform) - if err != nil { - return nil - } - if token.Exists() { - err = u.tokenRepository.Delete(ctx, token.ID) - if err != nil { - return nil - } - - err = u.fcmRepository.Unsubscribe(ctx, config.TopicAll, []string{token.Value}) - if err != nil { - return nil - } - } - return nil -} - -// NewToken ... new token usecase -func NewToken(fcmRepository repository.Fcm, - tokenRepository repository.Token, - tokenService service.Token) Token { - return &token{fcmRepository, tokenRepository, tokenService} -} diff --git a/internal/testdata/truncate/default.sql b/internal/testdata/truncate/default.sql deleted file mode 100644 index 75e9657c2..000000000 --- a/internal/testdata/truncate/default.sql +++ /dev/null @@ -1 +0,0 @@ -TRUNCATE TABLE users; \ No newline at end of file diff --git a/internal/testutil/context.go b/internal/testutil/context.go deleted file mode 100644 index 96fa65585..000000000 --- a/internal/testutil/context.go +++ /dev/null @@ -1,22 +0,0 @@ -package testutil - -import ( - "context" - - "github.com/abyssparanoia/rapid-go/internal/pkg/log" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" -) - -var ( - testCtx context.Context -) - -func init() { - logger, _ := log.New("test") - testCtx = ctxzap.ToContext(context.Background(), logger) -} - -// Context ... context for test -func Context() context.Context { - return testCtx -} diff --git a/internal/testutil/db.go b/internal/testutil/db.go deleted file mode 100644 index b6d386b02..000000000 --- a/internal/testutil/db.go +++ /dev/null @@ -1,84 +0,0 @@ -package testutil - -import ( - "database/sql" - "io/ioutil" - "path/filepath" - "runtime" - - "github.com/abyssparanoia/rapid-go/internal/pkg/gluemysql" - env "github.com/caarlos0/env/v6" - "github.com/go-testfixtures/testfixtures/v3" -) - -var ( - fixtures *testfixtures.Loader - envObj *environment -) - -func init() { - envObj = &environment{} - if err := env.Parse(envObj); err != nil { - panic(err) - } -} - -// TruncatDefaultTestDB : -func TruncatDefaultTestDB(db *sql.DB) { - sqlPath := filepath.Join(GetTestDataPath(), "truncate/default.sql") - truncatePsqlTestDatabase(db, sqlPath) -} - -// SetupDefaultTestDB : -func SetupDefaultTestDB() func() { - db := PrepareDefaultTestDB() - return func() { - defer db.Close() - TruncatDefaultTestDB(db) - } -} - -func truncatePsqlTestDatabase(db *sql.DB, path string) { - bytes, err := ioutil.ReadFile(path) - if err != nil { - panic(err) - } - _, err = db.Exec(string(bytes)) - if err != nil { - panic(err) - } -} - -// PrepareDefaultTestDB : -func PrepareDefaultTestDB() *sql.DB { - return prepareDatabaseTest( - envObj.DefaultDBHost, - envObj.DefaultDBUser, - envObj.DefaultDBDatabase, - envObj.DefaultDBPassword, - ) -} - -func prepareDatabaseTest( - host, - user, - dbname, - pass string, -) *sql.DB { - envObj := &environment{} - if err := env.Parse(envObj); err != nil { - panic(err) - } - - dbConn := gluemysql.NewClient(host, user, pass, dbname) - - return dbConn.DB -} - -// GetTestDataPath : -func GetTestDataPath() string { - _, b, _, _ := runtime.Caller(0) - testutilPath := filepath.Dir(b) - projectRoot := filepath.Dir(testutilPath) - return filepath.Join(projectRoot, "testdata") -} diff --git a/internal/testutil/env.go b/internal/testutil/env.go deleted file mode 100644 index 0a5bb8da2..000000000 --- a/internal/testutil/env.go +++ /dev/null @@ -1,9 +0,0 @@ -package testutil - -type environment struct { - DefaultDBHost string `env:"DEFAULT_DB_HOST,required"` - DefaultDBUser string `env:"DEFAULT_DB_USER,required"` - DefaultDBDatabase string `env:"DEFAULT_DB_DATABASE,required"` - DefaultDBPassword string `env:"DEFAULT_DB_PASSWORD,required"` - DBLogEnabled bool `env:"DB_LOG_ENABLED" envDefault:"false"` -} diff --git a/internal/usecase/admin_tenant.go b/internal/usecase/admin_tenant.go new file mode 100644 index 000000000..3c0068803 --- /dev/null +++ b/internal/usecase/admin_tenant.go @@ -0,0 +1,32 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/abyssparanoia/rapid-go/internal/usecase/output" +) + +type AdminTenantInteractor interface { + Get( + ctx context.Context, + param *input.AdminGetTenant, + ) (*model.Tenant, error) + List( + ctx context.Context, + param *input.AdminListTenants, + ) (*output.ListTenants, error) + Create( + ctx context.Context, + param *input.AdminCreateTenant, + ) (*model.Tenant, error) + Update( + ctx context.Context, + param *input.AdminUpdateTenant, + ) (*model.Tenant, error) + Delete( + ctx context.Context, + param *input.AdminDeleteTenant, + ) error +} diff --git a/internal/usecase/admin_tenant_impl.go b/internal/usecase/admin_tenant_impl.go new file mode 100644 index 000000000..b68e84196 --- /dev/null +++ b/internal/usecase/admin_tenant_impl.go @@ -0,0 +1,120 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/abyssparanoia/rapid-go/internal/usecase/output" + "github.com/volatiletech/null/v8" +) + +type adminTenantInteractor struct { + transactable repository.Transactable + tenantRepository repository.Tenant +} + +func NewAdminTenantInteractor( + transactable repository.Transactable, + tenantRepository repository.Tenant, +) AdminTenantInteractor { + return &adminTenantInteractor{ + transactable, + tenantRepository, + } +} + +func (i *adminTenantInteractor) Get( + ctx context.Context, + param *input.AdminGetTenant, +) (*model.Tenant, error) { + if err := param.Validate(); err != nil { + return nil, err + } + return i.tenantRepository.Get(ctx, param.TenantID, true) +} + +func (i *adminTenantInteractor) List( + ctx context.Context, + param *input.AdminListTenants, +) (*output.ListTenants, error) { + if err := param.Validate(); err != nil { + return nil, err + } + tenants, err := i.tenantRepository.List( + ctx, + repository.ListTenantsQuery{ + Page: null.Uint64From(param.Page), + Limit: null.Uint64From(param.Limit), + }, + ) + if err != nil { + return nil, err + } + ttl, err := i.tenantRepository.Count( + ctx, + repository.CountTenantsQuery{}, + ) + if err != nil { + return nil, err + } + return output.NewAdminListTenants( + tenants, + model.NewPagination( + param.Page, + param.Limit, + ttl, + ), + ), nil +} + +func (i *adminTenantInteractor) Create( + ctx context.Context, + param *input.AdminCreateTenant, +) (*model.Tenant, error) { + if err := param.Validate(); err != nil { + return nil, err + } + tenant := model.NewTenant(param.Name, param.RequestTime) + return i.tenantRepository.Create(ctx, tenant) +} + +func (i *adminTenantInteractor) Update( + ctx context.Context, + param *input.AdminUpdateTenant, +) (*model.Tenant, error) { + if err := param.Validate(); err != nil { + return nil, err + } + var tenant *model.Tenant + if err := i.transactable.RWTx(ctx, func(ctx context.Context) error { + var err error + tenant, err = i.tenantRepository.Get(ctx, param.TenantID, true) + if err != nil { + return err + } + tenant.Update( + null.StringFrom(param.Name), + param.RequestTime, + ) + tenant, err = i.tenantRepository.Update(ctx, tenant) + if err != nil { + return err + } + return nil + }); err != nil { + return nil, err + } + return tenant, nil +} + +func (i *adminTenantInteractor) Delete( + ctx context.Context, + param *input.AdminDeleteTenant, +) error { + if err := param.Validate(); err != nil { + return err + } + return i.tenantRepository.Delete(ctx, param.TenantID) +} diff --git a/internal/usecase/admin_tenant_impl_test.go b/internal/usecase/admin_tenant_impl_test.go new file mode 100644 index 000000000..36fa220d3 --- /dev/null +++ b/internal/usecase/admin_tenant_impl_test.go @@ -0,0 +1,402 @@ +package usecase + +import ( + "context" + "testing" + "time" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/model/factory" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + mock_repository "github.com/abyssparanoia/rapid-go/internal/domain/repository/mock" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/ulid" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/abyssparanoia/rapid-go/internal/usecase/output" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/assert" + "github.com/volatiletech/null/v8" +) + +func TestAdminAdminTenantInteractor_Get(t *testing.T) { + testdata := factory.NewFactory() + tenant := testdata.Tenant + + type args struct { + tenantID string + } + + type want struct { + tenant *model.Tenant + expectedResult error + } + + tests := map[string]struct { + args args + usecase func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor + want want + }{ + "invalid argument": { + args: args{}, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + expectedResult: errors.RequestInvalidArgumentErr.New(), + }, + }, + "not found": { + args: args{ + tenantID: tenant.ID, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + Get(gomock.Any(), tenant.ID, true). + Return(nil, errors.NotFoundErr.New()) + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + expectedResult: errors.NotFoundErr.New(), + }, + }, + "success": { + args: args{ + tenantID: tenant.ID, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + Get(gomock.Any(), tenant.ID, true). + Return(tenant, nil) + + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + tenant: tenant, + }, + }, + } + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + u := tc.usecase(ctx, ctrl) + + got, err := u.Get(ctx, input.NewAdminGetTenant( + tc.args.tenantID, + )) + if tc.want.expectedResult == nil { + assert.NoError(t, err) + assert.Equal(t, tc.want.tenant, got) + } else { + assert.ErrorContains(t, err, tc.want.expectedResult.Error()) + } + }) + } +} + +func TestAdminAdminTenantInteractor_List(t *testing.T) { + testdata := factory.NewFactory() + tenant := testdata.Tenant + + type args struct { + page uint64 + limit uint64 + } + + type want struct { + output *output.ListTenants + expectedResult error + } + + tests := map[string]struct { + args args + usecase func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor + want want + }{ + "success": { + args: args{ + page: 2, + limit: 30, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + List(gomock.Any(), repository.ListTenantsQuery{ + Page: null.Uint64From(2), + Limit: null.Uint64From(30), + }). + Return([]*model.Tenant{tenant}, nil) + + mockTenantRepo.EXPECT(). + Count(gomock.Any(), repository.CountTenantsQuery{}). + Return(uint64(60), nil) + + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + output: output.NewAdminListTenants( + []*model.Tenant{tenant}, + model.NewPagination(2, 30, 60), + ), + }, + }, + } + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + u := tc.usecase(ctx, ctrl) + + got, err := u.List(ctx, input.NewAdminListTenants( + tc.args.page, + tc.args.limit, + )) + if tc.want.expectedResult == nil { + assert.NoError(t, err) + assert.Equal(t, tc.want.output, got) + } else { + assert.ErrorContains(t, err, tc.want.expectedResult.Error()) + } + }) + } +} + +func TestAdminAdminTenantInteractor_Create(t *testing.T) { + testdata := factory.NewFactory() + tenant := testdata.Tenant + mockULID := ulid.Mock() + tenant.ID = mockULID + + type args struct { + name string + requestTime time.Time + } + + type want struct { + tenant *model.Tenant + expectedResult error + } + + tests := map[string]struct { + args args + usecase func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor + want want + }{ + "invalid argument": { + args: args{}, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + expectedResult: errors.RequestInvalidArgumentErr.New(), + }, + }, + "success": { + args: args{ + name: tenant.Name, + requestTime: tenant.CreatedAt, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + Create(gomock.Any(), tenant). + Return(tenant, nil) + + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{ + tenant: tenant, + }, + }, + } + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + u := tc.usecase(ctx, ctrl) + + got, err := u.Create(ctx, input.NewAdminCreateTenant( + tc.args.name, + tc.args.requestTime, + )) + if tc.want.expectedResult == nil { + assert.NoError(t, err) + assert.Equal(t, tc.want.tenant, got) + } else { + assert.ErrorContains(t, err, tc.want.expectedResult.Error()) + } + }) + } +} + +func TestAdminAdminTenantInteractor_Update(t *testing.T) { + testdata := factory.NewFactory() + tenant := testdata.Tenant + + type args struct { + tenantID string + name string + requestTime time.Time + } + + type want struct { + tenant *model.Tenant + expectedResult error + } + + tests := map[string]struct { + args args + usecase func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor + want want + }{ + "invalid argument": { + args: args{}, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + return &adminTenantInteractor{} + }, + want: want{ + expectedResult: errors.RequestInvalidArgumentErr.New(), + }, + }, + "success": { + args: args{ + tenantID: tenant.ID, + name: tenant.Name, + requestTime: tenant.UpdatedAt, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + Get(gomock.Any(), tenant.ID, true). + Return(tenant, nil) + mockTenantRepo.EXPECT(). + Update(gomock.Any(), tenant). + Return(tenant, nil) + + return &adminTenantInteractor{ + transactable: mock_repository.TestMockTransactable(), + tenantRepository: mockTenantRepo, + } + }, + want: want{ + tenant: tenant, + }, + }, + } + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + u := tc.usecase(ctx, ctrl) + + got, err := u.Update(ctx, input.NewAdminUpdateTenant( + tc.args.tenantID, + tc.args.name, + tc.args.requestTime, + )) + if tc.want.expectedResult == nil { + assert.NoError(t, err) + assert.Equal(t, tc.want.tenant, got) + } else { + assert.ErrorContains(t, err, tc.want.expectedResult.Error()) + } + }) + } +} + +func TestAdminAdminTenantInteractor_Delete(t *testing.T) { + testdata := factory.NewFactory() + tenant := testdata.Tenant + + type args struct { + tenantID string + } + + type want struct { + expectedResult error + } + + tests := map[string]struct { + args args + usecase func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor + want want + }{ + "invalid argument": { + args: args{}, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + return &adminTenantInteractor{} + }, + want: want{ + expectedResult: errors.RequestInvalidArgumentErr.New(), + }, + }, + "success": { + args: args{ + tenantID: tenant.ID, + }, + usecase: func(ctx context.Context, ctrl *gomock.Controller) AdminTenantInteractor { + mockTenantRepo := mock_repository.NewMockTenant(ctrl) + mockTenantRepo.EXPECT(). + Delete(gomock.Any(), tenant.ID). + Return(nil) + + return &adminTenantInteractor{ + tenantRepository: mockTenantRepo, + } + }, + want: want{}, + }, + } + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + u := tc.usecase(ctx, ctrl) + + err := u.Delete(ctx, input.NewAdminDeleteTenant( + tc.args.tenantID, + )) + if tc.want.expectedResult == nil { + assert.NoError(t, err) + } else { + assert.ErrorContains(t, err, tc.want.expectedResult.Error()) + } + }) + } +} diff --git a/internal/usecase/admin_user.go b/internal/usecase/admin_user.go new file mode 100644 index 000000000..4c52bdd14 --- /dev/null +++ b/internal/usecase/admin_user.go @@ -0,0 +1,15 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type AdminUserInteractor interface { + Create( + ctx context.Context, + param *input.AdminCreateUser, + ) (*model.User, error) +} diff --git a/internal/usecase/admin_user_impl.go b/internal/usecase/admin_user_impl.go new file mode 100644 index 000000000..8b7e793fa --- /dev/null +++ b/internal/usecase/admin_user_impl.go @@ -0,0 +1,84 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type adminUserInteractor struct { + transactable repository.Transactable + authenticationRepository repository.Authentication + userRepository repository.User + tenantRepository repository.Tenant +} + +func NewAdminUserInteractor( + transactable repository.Transactable, + authenticationRepository repository.Authentication, + userRepository repository.User, + tenantRepository repository.Tenant, +) AdminUserInteractor { + return &adminUserInteractor{ + transactable, + authenticationRepository, + userRepository, + tenantRepository, + } +} + +func (i *adminUserInteractor) Create( + ctx context.Context, + param *input.AdminCreateUser, +) (*model.User, error) { + if err := param.Validate(); err != nil { + return nil, err + } + tenant, err := i.tenantRepository.Get( + ctx, + param.TenantID, + true, + ) + if err != nil { + return nil, err + } + + authUID, err := i.authenticationRepository.CreateUser( + ctx, + repository.AuthenticationCreateUserParam{ + Email: param.Email, + }, + ) + if err != nil { + return nil, err + } + + user := model.NewUser( + param.TenantID, + param.Role, + authUID, + param.DisplayName, + "user_profile_images/default_image.jpeg", + param.Email, + param.RequestTime, + ) + + user, err = i.userRepository.Create(ctx, user) + if err != nil { + return nil, err + } + + claims := model.NewClaims(authUID) + claims.SetTenantID(param.TenantID) + claims.SetUserID(user.ID) + claims.SetUserRole(user.Role) + if err := i.authenticationRepository.StoreClaims(ctx, authUID, claims); err != nil { + return nil, err + } + + user.Tenant = tenant + + return user, nil +} diff --git a/internal/usecase/authentication.go b/internal/usecase/authentication.go new file mode 100644 index 000000000..ca64981cd --- /dev/null +++ b/internal/usecase/authentication.go @@ -0,0 +1,15 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type AuthenticationInteractor interface { + VerifyIDToken( + ctx context.Context, + param *input.VerifyIDToken, + ) (*model.Claims, error) +} diff --git a/internal/usecase/authentication_impl.go b/internal/usecase/authentication_impl.go new file mode 100644 index 000000000..8741cf5c2 --- /dev/null +++ b/internal/usecase/authentication_impl.go @@ -0,0 +1,31 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type authenticationInteractor struct { + authenticationRepository repository.Authentication +} + +func NewAuthenticationInteractor( + authenticationRepository repository.Authentication, +) AuthenticationInteractor { + return &authenticationInteractor{ + authenticationRepository, + } +} + +func (i *authenticationInteractor) VerifyIDToken( + ctx context.Context, + param *input.VerifyIDToken, +) (*model.Claims, error) { + if err := param.Validate(); err != nil { + return nil, err + } + return i.authenticationRepository.VerifyIDToken(ctx, param.IDToken) +} diff --git a/internal/usecase/input/admin_tenant.go b/internal/usecase/input/admin_tenant.go new file mode 100644 index 000000000..d94bb0457 --- /dev/null +++ b/internal/usecase/input/admin_tenant.go @@ -0,0 +1,121 @@ +package input + +import ( + "time" + + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type AdminGetTenant struct { + TenantID string `validate:"required"` +} + +func NewAdminGetTenant( + tenantID string, +) *AdminGetTenant { + return &AdminGetTenant{ + TenantID: tenantID, + } +} + +func (p *AdminGetTenant) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} + +type AdminListTenants struct { + Page uint64 + Limit uint64 `validate:"gte=1,lte=100"` +} + +func NewAdminListTenants( + page uint64, + limit uint64, +) *AdminListTenants { + if page == 0 { + page = 1 + } + if limit == 0 { + limit = 30 + } + return &AdminListTenants{ + Page: page, + Limit: limit, + } +} + +func (p *AdminListTenants) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} + +type AdminCreateTenant struct { + Name string `validate:"required"` + RequestTime time.Time `validate:"required"` +} + +func NewAdminCreateTenant( + name string, + requestTime time.Time, +) *AdminCreateTenant { + return &AdminCreateTenant{ + Name: name, + RequestTime: requestTime, + } +} + +func (p *AdminCreateTenant) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} + +type AdminUpdateTenant struct { + TenantID string `validate:"required"` + Name string + RequestTime time.Time `validate:"required"` +} + +func NewAdminUpdateTenant( + tenantID string, + name string, + requestTime time.Time, +) *AdminUpdateTenant { + return &AdminUpdateTenant{ + TenantID: tenantID, + Name: name, + RequestTime: requestTime, + } +} + +func (p *AdminUpdateTenant) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} + +type AdminDeleteTenant struct { + TenantID string `validate:"required"` +} + +func NewAdminDeleteTenant( + tenantID string, +) *AdminDeleteTenant { + return &AdminDeleteTenant{ + TenantID: tenantID, + } +} + +func (p *AdminDeleteTenant) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/input/admin_user.go b/internal/usecase/input/admin_user.go new file mode 100644 index 000000000..d9889c5f7 --- /dev/null +++ b/internal/usecase/input/admin_user.go @@ -0,0 +1,40 @@ +package input + +import ( + "time" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type AdminCreateUser struct { + TenantID string `validate:"required"` + Email string `validate:"required"` + DisplayName string `validate:"required"` + Role model.UserRole `validate:"required"` + RequestTime time.Time `validate:"required"` +} + +func NewAdminCreateUser( + tenantID, + email, + displayName string, + role model.UserRole, + requestTime time.Time, +) *AdminCreateUser { + return &AdminCreateUser{ + TenantID: tenantID, + Email: email, + DisplayName: displayName, + Role: role, + RequestTime: requestTime, + } +} + +func (p *AdminCreateUser) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/input/authentication.go b/internal/usecase/input/authentication.go new file mode 100644 index 000000000..4a3f8d90f --- /dev/null +++ b/internal/usecase/input/authentication.go @@ -0,0 +1,25 @@ +package input + +import ( + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type VerifyIDToken struct { + IDToken string `validate:"required"` +} + +func NewVerifyIDToken( + idToken string, +) *VerifyIDToken { + return &VerifyIDToken{ + IDToken: idToken, + } +} + +func (p *VerifyIDToken) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/input/public_authentication.go b/internal/usecase/input/public_authentication.go new file mode 100644 index 000000000..02fe6dc56 --- /dev/null +++ b/internal/usecase/input/public_authentication.go @@ -0,0 +1,25 @@ +package input + +import ( + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type PublicSignIn struct { + AuthUID string `validate:"required"` +} + +func NewPublicSignIn( + authUID string, +) *PublicSignIn { + return &PublicSignIn{ + AuthUID: authUID, + } +} + +func (p *PublicSignIn) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/input/public_tenant.go b/internal/usecase/input/public_tenant.go new file mode 100644 index 000000000..17ee2bdb6 --- /dev/null +++ b/internal/usecase/input/public_tenant.go @@ -0,0 +1,25 @@ +package input + +import ( + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type PublicGetTenant struct { + TenantID string `validate:"required"` +} + +func NewPublicGetTenant( + tenantID string, +) *PublicGetTenant { + return &PublicGetTenant{ + TenantID: tenantID, + } +} + +func (p *PublicGetTenant) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/input/user.go b/internal/usecase/input/user.go new file mode 100644 index 000000000..7d936b430 --- /dev/null +++ b/internal/usecase/input/user.go @@ -0,0 +1,33 @@ +package input + +import ( + "time" + + "github.com/abyssparanoia/rapid-go/internal/pkg/errors" + "github.com/abyssparanoia/rapid-go/internal/pkg/validation" +) + +type CreateRootUser struct { + Email string `validate:"required"` + Passoword string `validate:"required"` + RequestTime time.Time `validate:"required"` +} + +func NewCreateRootUser( + email string, + password string, + t time.Time, +) *CreateRootUser { + return &CreateRootUser{ + Email: email, + Passoword: password, + RequestTime: t, + } +} + +func (p *CreateRootUser) Validate() error { + if err := validation.Validate(p); err != nil { + return errors.RequestInvalidArgumentErr.Wrap(err) + } + return nil +} diff --git a/internal/usecase/output/admin_tenant.go b/internal/usecase/output/admin_tenant.go new file mode 100644 index 000000000..4dfb768e4 --- /dev/null +++ b/internal/usecase/output/admin_tenant.go @@ -0,0 +1,18 @@ +package output + +import "github.com/abyssparanoia/rapid-go/internal/domain/model" + +type ListTenants struct { + Tenants []*model.Tenant + Pagination *model.Pagination +} + +func NewAdminListTenants( + tenants []*model.Tenant, + pagination *model.Pagination, +) *ListTenants { + return &ListTenants{ + Tenants: tenants, + Pagination: pagination, + } +} diff --git a/internal/usecase/public_authentication.go b/internal/usecase/public_authentication.go new file mode 100644 index 000000000..c724237be --- /dev/null +++ b/internal/usecase/public_authentication.go @@ -0,0 +1,15 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type PublicAuthenticationInteractor interface { + SignIn( + ctx context.Context, + param *input.PublicSignIn, + ) (*model.User, error) +} diff --git a/internal/usecase/public_authentication_impl.go b/internal/usecase/public_authentication_impl.go new file mode 100644 index 000000000..8f95bcdc1 --- /dev/null +++ b/internal/usecase/public_authentication_impl.go @@ -0,0 +1,44 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/volatiletech/null/v8" +) + +type publicAuthenticationInteractor struct { + userRepository repository.User +} + +func NewPublicAuthenticationInteractor( + userRepository repository.User, +) PublicAuthenticationInteractor { + return &publicAuthenticationInteractor{ + userRepository, + } +} + +func (i *publicAuthenticationInteractor) SignIn( + ctx context.Context, + param *input.PublicSignIn, +) (*model.User, error) { + if err := param.Validate(); err != nil { + return nil, err + } + user, err := i.userRepository.Get( + ctx, + repository.GetUserQuery{ + AuthUID: null.StringFrom(param.AuthUID), + }, + true, + true, + ) + if err != nil { + return nil, err + } + + return user, nil +} diff --git a/internal/usecase/public_tenant.go b/internal/usecase/public_tenant.go new file mode 100644 index 000000000..563e4e868 --- /dev/null +++ b/internal/usecase/public_tenant.go @@ -0,0 +1,15 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type PublicTenantInteractor interface { + Get( + ctx context.Context, + param *input.PublicGetTenant, + ) (*model.Tenant, error) +} diff --git a/internal/usecase/public_tenant_impl.go b/internal/usecase/public_tenant_impl.go new file mode 100644 index 000000000..92a9383f0 --- /dev/null +++ b/internal/usecase/public_tenant_impl.go @@ -0,0 +1,34 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type publicTenantInteractor struct { + transactable repository.Transactable + tenantRepository repository.Tenant +} + +func NewPublicTenantInteractor( + transactable repository.Transactable, + tenantRepository repository.Tenant, +) PublicTenantInteractor { + return &publicTenantInteractor{ + transactable, + tenantRepository, + } +} + +func (i *publicTenantInteractor) Get( + ctx context.Context, + param *input.PublicGetTenant, +) (*model.Tenant, error) { + if err := param.Validate(); err != nil { + return nil, err + } + return i.tenantRepository.Get(ctx, param.TenantID, true) +} diff --git a/internal/usecase/user.go b/internal/usecase/user.go new file mode 100644 index 000000000..532174d72 --- /dev/null +++ b/internal/usecase/user.go @@ -0,0 +1,14 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/usecase/input" +) + +type UserInteractor interface { + CreateRoot( + ctx context.Context, + param *input.CreateRootUser, + ) error +} diff --git a/internal/usecase/user_impl.go b/internal/usecase/user_impl.go new file mode 100644 index 000000000..6086531d2 --- /dev/null +++ b/internal/usecase/user_impl.go @@ -0,0 +1,83 @@ +package usecase + +import ( + "context" + + "github.com/abyssparanoia/rapid-go/internal/domain/model" + "github.com/abyssparanoia/rapid-go/internal/domain/repository" + "github.com/abyssparanoia/rapid-go/internal/usecase/input" + "github.com/volatiletech/null/v8" +) + +type userInteractor struct { + transactable repository.Transactable + userRepository repository.User + tenantRepository repository.Tenant + authenticationRepository repository.Authentication +} + +func NewUserInteractor( + transactable repository.Transactable, + userRepository repository.User, + tenantRepository repository.Tenant, + authenticationRepository repository.Authentication, +) UserInteractor { + return &userInteractor{ + transactable, + userRepository, + tenantRepository, + authenticationRepository, + } +} + +func (i *userInteractor) CreateRoot( + ctx context.Context, + param *input.CreateRootUser, +) error { + return i.transactable.RWTx(ctx, func(ctx context.Context) error { + if err := param.Validate(); err != nil { + return err + } + tenant := model.NewTenant("Platformer", param.RequestTime) + if _, err := i.tenantRepository.Create(ctx, tenant); err != nil { + return err + } + + res, err := i.authenticationRepository.GetUserByEmail(ctx, param.Email) + if err != nil { + return err + } + var authUID string + // 存在してない場合、新規作成する + if !res.Exist { + authUID, err = i.authenticationRepository.CreateUser( + ctx, + repository.AuthenticationCreateUserParam{ + Email: param.Email, + Password: null.StringFrom(param.Passoword), + }, + ) + if err != nil { + return err + } + } else { + authUID = res.AuthUID + } + + user := model.NewUser( + tenant.ID, + model.UserRoleAdmin, + authUID, + "Root User", + "user_profile_images/default_image.jpeg", + param.Email, + param.RequestTime, + ) + + if _, err := i.userRepository.Create(ctx, user); err != nil { + return err + } + + return nil + }) +} diff --git a/proto/default/user.pb b/proto/default/user.pb deleted file mode 100644 index 5037339d6..000000000 Binary files a/proto/default/user.pb and /dev/null differ diff --git a/proto/default/user.pb.go b/proto/default/user.pb.go deleted file mode 100644 index 91b91fec9..000000000 --- a/proto/default/user.pb.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: user.proto - -package _default - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type User struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - IconImagePath string `protobuf:"bytes,3,opt,name=icon_image_path,json=iconImagePath,proto3" json:"icon_image_path,omitempty"` - BackgroundImagePath string `protobuf:"bytes,4,opt,name=background_image_path,json=backgroundImagePath,proto3" json:"background_image_path,omitempty"` - Profile string `protobuf:"bytes,5,opt,name=profile,proto3" json:"profile,omitempty"` - Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` - CreatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - DeletedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_116e343673f7ffaf, []int{0} -} - -func (m *User) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_User.Unmarshal(m, b) -} -func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_User.Marshal(b, m, deterministic) -} -func (m *User) XXX_Merge(src proto.Message) { - xxx_messageInfo_User.Merge(m, src) -} -func (m *User) XXX_Size() int { - return xxx_messageInfo_User.Size(m) -} -func (m *User) XXX_DiscardUnknown() { - xxx_messageInfo_User.DiscardUnknown(m) -} - -var xxx_messageInfo_User proto.InternalMessageInfo - -func (m *User) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *User) GetDisplayName() string { - if m != nil { - return m.DisplayName - } - return "" -} - -func (m *User) GetIconImagePath() string { - if m != nil { - return m.IconImagePath - } - return "" -} - -func (m *User) GetBackgroundImagePath() string { - if m != nil { - return m.BackgroundImagePath - } - return "" -} - -func (m *User) GetProfile() string { - if m != nil { - return m.Profile - } - return "" -} - -func (m *User) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *User) GetCreatedAt() *timestamp.Timestamp { - if m != nil { - return m.CreatedAt - } - return nil -} - -func (m *User) GetUpdatedAt() *timestamp.Timestamp { - if m != nil { - return m.UpdatedAt - } - return nil -} - -func (m *User) GetDeletedAt() *timestamp.Timestamp { - if m != nil { - return m.DeletedAt - } - return nil -} - -type GetUserRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserRequest) Reset() { *m = GetUserRequest{} } -func (m *GetUserRequest) String() string { return proto.CompactTextString(m) } -func (*GetUserRequest) ProtoMessage() {} -func (*GetUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_116e343673f7ffaf, []int{1} -} - -func (m *GetUserRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserRequest.Unmarshal(m, b) -} -func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserRequest.Marshal(b, m, deterministic) -} -func (m *GetUserRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserRequest.Merge(m, src) -} -func (m *GetUserRequest) XXX_Size() int { - return xxx_messageInfo_GetUserRequest.Size(m) -} -func (m *GetUserRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserRequest proto.InternalMessageInfo - -func (m *GetUserRequest) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func init() { - proto.RegisterType((*User)(nil), "default.User") - proto.RegisterType((*GetUserRequest)(nil), "default.GetUserRequest") -} - -func init() { proto.RegisterFile("user.proto", fileDescriptor_116e343673f7ffaf) } - -var fileDescriptor_116e343673f7ffaf = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4e, 0xe3, 0x30, - 0x10, 0x86, 0xd5, 0x6c, 0xdb, 0x6c, 0xa6, 0xdb, 0xee, 0xca, 0xbb, 0xab, 0x5a, 0xd1, 0x4a, 0x5b, - 0x7a, 0x40, 0xe5, 0x92, 0x48, 0xe5, 0xc4, 0xb1, 0x5c, 0x50, 0x85, 0x84, 0x50, 0x81, 0x4b, 0x2f, - 0x91, 0x1b, 0x4f, 0x53, 0x8b, 0x24, 0x0e, 0x89, 0x83, 0x84, 0x10, 0x17, 0x5e, 0x81, 0x47, 0xe3, - 0x15, 0x78, 0x06, 0xce, 0xc8, 0x89, 0xd3, 0xc2, 0xa9, 0xc7, 0xf9, 0xe7, 0xfb, 0x9c, 0x78, 0x3c, - 0x00, 0x65, 0x81, 0xb9, 0x97, 0xe5, 0x52, 0x49, 0x62, 0x73, 0x5c, 0xb3, 0x32, 0x56, 0xee, 0xff, - 0x48, 0xca, 0x28, 0x46, 0xbf, 0x8a, 0x57, 0xe5, 0xda, 0x57, 0x22, 0xc1, 0x42, 0xb1, 0x24, 0xab, - 0x49, 0xf7, 0x9f, 0x01, 0x58, 0x26, 0x7c, 0x96, 0xa6, 0x52, 0x31, 0x25, 0x64, 0x5a, 0xd4, 0xdd, - 0xf1, 0xbb, 0x05, 0xed, 0x9b, 0x02, 0x73, 0x32, 0x00, 0x4b, 0x70, 0xda, 0x1a, 0xb5, 0x26, 0xce, - 0xc2, 0x12, 0x9c, 0x1c, 0xc0, 0x0f, 0x2e, 0x8a, 0x2c, 0x66, 0x0f, 0x41, 0xca, 0x12, 0xa4, 0x56, - 0xd5, 0xe9, 0x99, 0xec, 0x82, 0x25, 0x48, 0x0e, 0xe1, 0xa7, 0x08, 0x65, 0x1a, 0x88, 0x84, 0x45, - 0x18, 0x64, 0x4c, 0x6d, 0xe8, 0xb7, 0x8a, 0xea, 0xeb, 0x78, 0xae, 0xd3, 0x4b, 0xa6, 0x36, 0x64, - 0x0a, 0x7f, 0x57, 0x2c, 0xbc, 0x8d, 0x72, 0x59, 0xa6, 0xfc, 0x33, 0xdd, 0xae, 0xe8, 0xdf, 0xbb, - 0xe6, 0xce, 0xa1, 0x60, 0x67, 0xb9, 0x5c, 0x8b, 0x18, 0x69, 0xa7, 0xa2, 0x9a, 0x92, 0xfc, 0x81, - 0x0e, 0x26, 0x4c, 0xc4, 0xb4, 0x5b, 0xe5, 0x75, 0x41, 0x4e, 0x00, 0xc2, 0x1c, 0x99, 0x42, 0x1e, - 0x30, 0x45, 0xbf, 0x8f, 0x5a, 0x93, 0xde, 0xd4, 0xf5, 0xea, 0xab, 0x7b, 0xcd, 0x6c, 0xbc, 0xeb, - 0x66, 0x36, 0x0b, 0xc7, 0xd0, 0x33, 0xa5, 0xd5, 0x32, 0xe3, 0x8d, 0xea, 0xec, 0x57, 0x0d, 0x5d, - 0xab, 0x1c, 0x63, 0x34, 0x2a, 0xec, 0x57, 0x0d, 0x3d, 0x53, 0xe3, 0x23, 0x18, 0x9c, 0xa1, 0xd2, - 0xa3, 0x5f, 0xe0, 0x5d, 0x89, 0x85, 0x22, 0x43, 0xb0, 0xf5, 0x03, 0x07, 0xdb, 0x67, 0xe8, 0xea, - 0x72, 0xce, 0xa7, 0x4b, 0xe8, 0x69, 0xee, 0x0a, 0xf3, 0x7b, 0x11, 0x22, 0x39, 0x07, 0xdb, 0x98, - 0x64, 0xe8, 0x99, 0x35, 0xf0, 0xbe, 0x9e, 0xe5, 0xf6, 0xb7, 0x0d, 0x9d, 0x8e, 0xe9, 0xf3, 0xeb, - 0xdb, 0x8b, 0x45, 0xc8, 0x2f, 0x5f, 0x1f, 0x59, 0xf8, 0x8f, 0xe6, 0x43, 0x4f, 0xa7, 0xce, 0xb2, - 0xd9, 0xa4, 0x55, 0xb7, 0xfa, 0xe1, 0xe3, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x5c, 0x77, - 0x42, 0x67, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// UserServiceClient is the client API for UserService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type UserServiceClient interface { - GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) -} - -type userServiceClient struct { - cc *grpc.ClientConn -} - -func NewUserServiceClient(cc *grpc.ClientConn) UserServiceClient { - return &userServiceClient{cc} -} - -func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) { - out := new(User) - err := c.cc.Invoke(ctx, "/default.UserService/GetUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UserServiceServer is the server API for UserService service. -type UserServiceServer interface { - GetUser(context.Context, *GetUserRequest) (*User, error) -} - -// UnimplementedUserServiceServer can be embedded to have forward compatible implementations. -type UnimplementedUserServiceServer struct { -} - -func (*UnimplementedUserServiceServer) GetUser(ctx context.Context, req *GetUserRequest) (*User, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") -} - -func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) { - s.RegisterService(&_UserService_serviceDesc, srv) -} - -func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/default.UserService/GetUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _UserService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "default.UserService", - HandlerType: (*UserServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetUser", - Handler: _UserService_GetUser_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "user.proto", -} diff --git a/proto/default/user.swagger.json b/proto/default/user.swagger.json deleted file mode 100644 index eac6cc5ae..000000000 --- a/proto/default/user.swagger.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "user.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/users/{userId}": { - "get": { - "operationId": "UserService_GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/defaultUser" - } - }, - "default": { - "description": "An unexpected error response", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "userId", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "UserService" - ] - } - } - }, - "definitions": { - "defaultUser": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "iconImagePath": { - "type": "string" - }, - "backgroundImagePath": { - "type": "string" - }, - "profile": { - "type": "string" - }, - "email": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "deletedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string" - }, - "value": { - "type": "string", - "format": "byte" - } - } - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/proto/user.proto b/proto/user.proto deleted file mode 100644 index 871e326fe..000000000 --- a/proto/user.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; - -package default; -option go_package = "default"; - -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -service UserService { - rpc GetUser(GetUserRequest) returns (User) { - option (google.api.http) = { - get : "/users/{user_id}" - }; - }; -} - -message User { - string id = 1; - string display_name = 2; - string icon_image_path = 3; - string background_image_path = 4; - string profile = 5; - string email = 6; - google.protobuf.Timestamp created_at = 8; - google.protobuf.Timestamp updated_at = 9; - google.protobuf.Timestamp deleted_at = 10; -} - -message GetUserRequest { string user_id = 1; } diff --git a/schema/openapi/apidocs.swagger.json b/schema/openapi/apidocs.swagger.json new file mode 100644 index 000000000..561051b52 --- /dev/null +++ b/schema/openapi/apidocs.swagger.json @@ -0,0 +1,526 @@ +{ + "swagger": "2.0", + "info": { + "title": "rapid/model/v1/tenant.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "AdminV1Service" + }, + { + "name": "DebugV1Service" + }, + { + "name": "PublicV1Service" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/admin/v1/tenants": { + "get": { + "operationId": "ListTenants", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListTenantsResponse" + } + } + }, + "parameters": [ + { + "name": "page", + "in": "query", + "required": false, + "type": "string", + "format": "uint64" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "string", + "format": "uint64" + } + ], + "tags": [ + "AdminV1Service" + ] + }, + "post": { + "operationId": "CreateTenant", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateTenantResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateTenantRequest" + } + } + ], + "tags": [ + "AdminV1Service" + ] + } + }, + "/admin/v1/tenants/{tenant_id}": { + "get": { + "operationId": "GetTenant", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/rapidadmin_apiv1GetTenantResponse" + } + } + }, + "parameters": [ + { + "name": "tenant_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "AdminV1Service" + ] + }, + "delete": { + "operationId": "DeleteTenant", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DeleteTenantResponse" + } + } + }, + "parameters": [ + { + "name": "tenant_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "AdminV1Service" + ] + }, + "patch": { + "operationId": "UpdateTenant", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateTenantResponse" + } + } + }, + "parameters": [ + { + "name": "tenant_id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + ], + "tags": [ + "AdminV1Service" + ] + } + }, + "/admin/v1/users": { + "post": { + "operationId": "CreateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateUserResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateUserRequest" + } + } + ], + "tags": [ + "AdminV1Service" + ] + } + }, + "/debug/v1/id_token": { + "post": { + "operationId": "CreateIDToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateIDTokenResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateIDTokenRequest" + } + } + ], + "tags": [ + "DebugV1Service" + ] + } + }, + "/v1/sign_in": { + "post": { + "operationId": "SignIn", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SignInResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignInRequest" + } + } + ], + "tags": [ + "PublicV1Service" + ] + } + }, + "/v1/tenants/{tenant_id}": { + "get": { + "operationId": "GetTenant", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/rapidpublic_apiv1GetTenantResponse" + } + } + }, + "parameters": [ + { + "name": "tenant_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "PublicV1Service" + ] + } + } + }, + "definitions": { + "rapidadmin_apiv1GetTenantResponse": { + "type": "object", + "properties": { + "tenant": { + "$ref": "#/definitions/v1Tenant" + } + }, + "required": [ + "tenant" + ] + }, + "rapidpublic_apiv1GetTenantResponse": { + "type": "object", + "properties": { + "tenant": { + "$ref": "#/definitions/v1Tenant" + } + }, + "required": [ + "tenant" + ] + }, + "v1CreateIDTokenRequest": { + "type": "object", + "properties": { + "auth_uid": { + "type": "string" + } + }, + "required": [ + "auth_uid" + ] + }, + "v1CreateIDTokenResponse": { + "type": "object", + "properties": { + "id_token": { + "type": "string" + } + }, + "required": [ + "id_token" + ] + }, + "v1CreateTenantRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "v1CreateTenantResponse": { + "type": "object", + "properties": { + "tenant": { + "$ref": "#/definitions/v1Tenant" + } + }, + "required": [ + "tenant" + ] + }, + "v1CreateUserRequest": { + "type": "object", + "properties": { + "tenant_id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/v1UserRole" + } + }, + "required": [ + "tenant_id", + "email", + "display_name", + "role" + ] + }, + "v1CreateUserResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/v1User" + } + }, + "required": [ + "user" + ] + }, + "v1DeleteTenantResponse": { + "type": "object" + }, + "v1ListTenantsResponse": { + "type": "object", + "properties": { + "tenants": { + "type": "array", + "items": { + "$ref": "#/definitions/v1Tenant" + } + }, + "pagination": { + "$ref": "#/definitions/v1Pagination" + } + }, + "required": [ + "tenants", + "pagination" + ] + }, + "v1Pagination": { + "type": "object", + "properties": { + "current_page": { + "type": "string", + "format": "uint64" + }, + "prev_page": { + "type": "string", + "format": "uint64" + }, + "next_page": { + "type": "string", + "format": "uint64" + }, + "total_page": { + "type": "string", + "format": "uint64" + }, + "total_count": { + "type": "string", + "format": "uint64" + }, + "has_next": { + "type": "boolean" + } + }, + "required": [ + "current_page", + "total_page", + "total_count", + "has_next" + ] + }, + "v1SignInRequest": { + "type": "object" + }, + "v1SignInResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/v1User" + } + }, + "required": [ + "user" + ] + }, + "v1Tenant": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "name", + "created_at", + "updated_at" + ] + }, + "v1UpdateTenantResponse": { + "type": "object", + "properties": { + "tenant": { + "$ref": "#/definitions/v1Tenant" + } + }, + "required": [ + "tenant" + ] + }, + "v1User": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "role": { + "$ref": "#/definitions/v1UserRole" + }, + "auth_uid": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "email": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "tenant": { + "$ref": "#/definitions/v1Tenant" + } + }, + "required": [ + "id", + "role", + "auth_uid", + "display_name", + "image_url", + "email", + "created_at", + "updated_at", + "tenant" + ] + }, + "v1UserRole": { + "type": "string", + "enum": [ + "USER_ROLE_UNSPECIFIED", + "USER_ROLE_NORMAL", + "USER_ROLE_ADMIN" + ], + "default": "USER_ROLE_UNSPECIFIED" + } + } +} diff --git a/schema/proto/buf.lock b/schema/proto/buf.lock new file mode 100644 index 000000000..2465567c8 --- /dev/null +++ b/schema/proto/buf.lock @@ -0,0 +1,11 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: e9fcfb66f77242e5b8fd4564d7a01033 + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + commit: bc28b723cd774c32b6fbc77621518765 diff --git a/schema/proto/buf.yaml b/schema/proto/buf.yaml new file mode 100644 index 000000000..e2b9d52a0 --- /dev/null +++ b/schema/proto/buf.yaml @@ -0,0 +1,11 @@ +version: v1 +name: buf.build/moala-meet-and-greet-back/rapid +breaking: + use: + - FILE +lint: + use: + - DEFAULT +deps: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway diff --git a/schema/proto/rapid/admin_api/v1/admin.proto b/schema/proto/rapid/admin_api/v1/admin.proto new file mode 100644 index 000000000..9cd6594f4 --- /dev/null +++ b/schema/proto/rapid/admin_api/v1/admin.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package rapid.admin_api.v1; + + +import "google/api/annotations.proto"; +import "rapid/admin_api/v1/tenant.proto"; +import "rapid/admin_api/v1/user.proto"; + +service AdminV1Service { + rpc GetTenant(GetTenantRequest) returns (GetTenantResponse) { + option (google.api.http) = { + get: "/admin/v1/tenants/{tenant_id}" + }; + } + rpc ListTenants(ListTenantsRequest) returns (ListTenantsResponse) { + option (google.api.http) = { + get: "/admin/v1/tenants" + }; + } + rpc CreateTenant(CreateTenantRequest) returns (CreateTenantResponse) { + option (google.api.http) = { + post: "/admin/v1/tenants", + body: "*" + }; + } + rpc UpdateTenant(UpdateTenantRequest) returns (UpdateTenantResponse) { + option (google.api.http) = { + patch: "/admin/v1/tenants/{tenant_id}", + body: "*" + }; + } + rpc DeleteTenant(DeleteTenantRequest) returns (DeleteTenantResponse) { + option (google.api.http) = { + delete: "/admin/v1/tenants/{tenant_id}", + }; + } + rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) { + option (google.api.http) = { + post: "/admin/v1/users", + body: "*" + }; + } +} \ No newline at end of file diff --git a/schema/proto/rapid/admin_api/v1/tenant.proto b/schema/proto/rapid/admin_api/v1/tenant.proto new file mode 100644 index 000000000..7f5bdc675 --- /dev/null +++ b/schema/proto/rapid/admin_api/v1/tenant.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; + +package rapid.admin_api.v1; + + +import "rapid/model/v1/tenant.proto"; +import "rapid/model/v1/pagination.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message GetTenantRequest { + string tenant_id = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant_id"] + } + }; +} + +message GetTenantResponse { + model.v1.Tenant tenant = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant"] + } + }; +} + +message ListTenantsRequest { + uint64 page = 1; + uint64 limit = 2; +} + +message ListTenantsResponse { + repeated model.v1.Tenant tenants = 1; + model.v1.Pagination pagination = 2; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenants","pagination"] + } + }; +} + +message CreateTenantRequest { + string name = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["name"] + } + }; +} + + +message CreateTenantResponse { + model.v1.Tenant tenant = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant"] + } + }; +} + +message UpdateTenantRequest { + string tenant_id = 1; + string name = 2; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant_id"] + } + }; +} + + +message UpdateTenantResponse { + model.v1.Tenant tenant = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant"] + } + }; +} + +message DeleteTenantRequest { + string tenant_id = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant_id"] + } + }; +} + + +message DeleteTenantResponse { +} \ No newline at end of file diff --git a/schema/proto/rapid/admin_api/v1/user.proto b/schema/proto/rapid/admin_api/v1/user.proto new file mode 100644 index 000000000..4f26ea200 --- /dev/null +++ b/schema/proto/rapid/admin_api/v1/user.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package rapid.admin_api.v1; + +import "rapid/model/v1/user.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message CreateUserRequest { + string tenant_id = 1; + string email = 2; + string display_name = 3; + model.v1.UserRole role = 4; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant_id","email","display_name","role"] + } + }; +} + +message CreateUserResponse { + model.v1.User user = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["user"] + } + }; +} \ No newline at end of file diff --git a/schema/proto/rapid/debug_api/v1/debug.proto b/schema/proto/rapid/debug_api/v1/debug.proto new file mode 100644 index 000000000..e066f3806 --- /dev/null +++ b/schema/proto/rapid/debug_api/v1/debug.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package rapid.debug_api.v1; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +service DebugV1Service { + rpc CreateIDToken(CreateIDTokenRequest) returns (CreateIDTokenResponse) { + option (google.api.http) = { + post: "/debug/v1/id_token", + body: "*" + }; + } +} + +message CreateIDTokenRequest { + string auth_uid = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["auth_uid"] + } + }; +} + +message CreateIDTokenResponse { + string id_token = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["id_token"] + } + }; +} \ No newline at end of file diff --git a/schema/proto/rapid/model/v1/pagination.proto b/schema/proto/rapid/model/v1/pagination.proto new file mode 100644 index 000000000..729cbcecd --- /dev/null +++ b/schema/proto/rapid/model/v1/pagination.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package rapid.model.v1; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +message Pagination { + uint64 current_page = 1; + uint64 prev_page = 2; + uint64 next_page = 3; + uint64 total_page = 4; + uint64 total_count = 5; + bool has_next = 6; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["current_page","total_page","total_count","has_next"] + } + }; +} \ No newline at end of file diff --git a/schema/proto/rapid/model/v1/tenant.proto b/schema/proto/rapid/model/v1/tenant.proto new file mode 100644 index 000000000..7defc50f8 --- /dev/null +++ b/schema/proto/rapid/model/v1/tenant.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package rapid.model.v1; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message Tenant { + string id = 1; + string name = 2; + google.protobuf.Timestamp created_at = 3; + google.protobuf.Timestamp updated_at = 4; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["id","name","created_at","updated_at"] + } + }; +} \ No newline at end of file diff --git a/schema/proto/rapid/model/v1/user.proto b/schema/proto/rapid/model/v1/user.proto new file mode 100644 index 000000000..bcaa25e61 --- /dev/null +++ b/schema/proto/rapid/model/v1/user.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package rapid.model.v1; + +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rapid/model/v1/tenant.proto"; + +message User { + string id = 1; + UserRole role = 2; + string auth_uid = 3; + string display_name = 4; + string image_url = 5; + string email = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + + model.v1.Tenant tenant = 9; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["id","role","auth_uid","display_name","image_url","email","created_at","updated_at","tenant"] + } + }; +} + +enum UserRole { + USER_ROLE_UNSPECIFIED = 0; + USER_ROLE_NORMAL = 1; + USER_ROLE_ADMIN = 2; +} \ No newline at end of file diff --git a/schema/proto/rapid/public_api/v1/authentication.proto b/schema/proto/rapid/public_api/v1/authentication.proto new file mode 100644 index 000000000..b72145733 --- /dev/null +++ b/schema/proto/rapid/public_api/v1/authentication.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package rapid.public_api.v1; + +import "rapid/model/v1/user.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message SignInRequest { +} + +message SignInResponse { + model.v1.User user = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["user"] + } + }; +} \ No newline at end of file diff --git a/schema/proto/rapid/public_api/v1/public.proto b/schema/proto/rapid/public_api/v1/public.proto new file mode 100644 index 000000000..088e3c615 --- /dev/null +++ b/schema/proto/rapid/public_api/v1/public.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package rapid.public_api.v1; + +import "google/api/annotations.proto"; +import "rapid/public_api/v1/tenant.proto"; +import "rapid/public_api/v1/authentication.proto"; + +service PublicV1Service { + rpc SignIn(SignInRequest) returns (SignInResponse) { + option (google.api.http) = { + post: "/v1/sign_in", + body: "*" + }; + } + rpc GetTenant(GetTenantRequest) returns (GetTenantResponse) { + option (google.api.http) = { + get: "/v1/tenants/{tenant_id}" + }; + } +} \ No newline at end of file diff --git a/schema/proto/rapid/public_api/v1/tenant.proto b/schema/proto/rapid/public_api/v1/tenant.proto new file mode 100644 index 000000000..ca344a2e0 --- /dev/null +++ b/schema/proto/rapid/public_api/v1/tenant.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package rapid.public_api.v1; + +import "rapid/model/v1/tenant.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message GetTenantRequest { + string tenant_id = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant_id"] + } + }; +} + +message GetTenantResponse { + model.v1.Tenant tenant = 1; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + required: ["tenant"] + } + }; +} \ No newline at end of file diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 000000000..34866c8c9 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,12 @@ +package tool + +import ( + _ "github.com/bufbuild/buf/cmd/buf" //nolint + _ "github.com/cosmtrek/air" //nolint + _ "github.com/golang/mock/mockgen" //nolint + _ "github.com/golangci/golangci-lint/cmd/golangci-lint" //nolint + _ "github.com/pressly/goose/v3/cmd/goose" //nolint + _ "github.com/volatiletech/sqlboiler/v4" //nolint + _ "github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mysql" //nolint + _ "golang.org/x/tools/cmd/goimports" //nolint +)