diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..53abced --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,32 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.) + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + update-types: + - "major" + - "minor" + - "patch" + reviewers: + - "knight42" + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + groups: + gomod: + update-types: + - "minor" + - "patch" + reviewers: + - "knight42" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ce624b3..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: build - -on: - - push - - pull_request - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - env: - NAME: yuki - GO111MODULE: on - strategy: - matrix: - include: - - os: ubuntu-latest - # GitHub Actions only provides amd64 arch now. - GOOS: linux - GOARCH: amd64 - - services: - mongodb: - image: mongo:3 - ports: - - 27017:27017 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go 1.x - uses: actions/setup-go@v4 - with: - go-version: ^1.20 - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl -s https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Test - run: | - docker pull ustcmirror/test - ci/script.sh - - - name: Deploy - Build - if: startsWith(github.ref, 'refs/tags/') - run: ci/build.sh - env: - GOOS: ${{ matrix.GOOS }} - GOARCH: ${{ matrix.GOARCH }} - - - name: Deploy - Release - if: startsWith(github.ref, 'refs/tags/') - id: create_release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref_name }} - release_name: ${{ github.ref_name }} - files: ${{ env.NAME }}-*.tar.gz - draft: false - prerelease: false diff --git a/.github/workflows/pr-presubmit-checks.yml b/.github/workflows/pr-presubmit-checks.yml new file mode 100644 index 0000000..16996b6 --- /dev/null +++ b/.github/workflows/pr-presubmit-checks.yml @@ -0,0 +1,64 @@ +name: Presubmit Checks + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - master + paths: + - '**.go' + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: stable + check-latest: true + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55.0 + skip-build-cache: true + skip-pkg-cache: true + + unit-test: + name: Unit Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: stable + check-latest: true + - name: Test + run: | + make unit-test + + integration-test: + name: Integration Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: stable + check-latest: true + - name: Integration Test + run: | + set -euo pipefail + docker pull ustcmirror/test + make integration-test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..16f45b2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release + +on: + push: + # run only against tags + tags: + - "v*" + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + +permissions: + contents: write + # packages: write + # issues: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v5 + with: + go-version: stable + # More assembly might be required: Docker logins, GPG, etc. + # It all depends on your needs. + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ec51bf0..f3a40ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ # Build output files -yukictl -yukid +/yukictl +/yukid .idea/ +dist/ *.swp *.[oa] diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..1529035 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,81 @@ +# Options for analysis running. +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 5m + + # Which dirs to skip: issues from them won't be reported. + # Can use regexp here: `generated.*`, regexp is applied on full path. + # Default value is empty list, + # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work on Windows. + skip-dirs: + + # Enables skipping of directories: + # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + # Default: true + skip-dirs-use-default: true + + # If set we pass it to "go list -mod={option}". From "go help modules": + # If invoked with -mod=readonly, the go command is disallowed from the implicit + # automatic updating of go.mod described above. Instead, it fails when any changes + # to go.mod are needed. This setting is most useful to check that go.mod does + # not need updates, such as in a continuous integration and testing system. + # If invoked with -mod=vendor, the go command assumes that the vendor + # directory holds the correct copies of dependencies and ignores + # the dependency descriptions in go.mod. + # + # Allowed values: readonly|vendor|mod + # By default, it isn't set. + modules-download-mode: readonly + +# https://golangci-lint.run/usage/linters/ +linters: + enable: + - exhaustive + - exportloopref + - gci + - gochecknoinits + - goconst + - gocritic + - gofmt + - goimports + - importas + - misspell + - nolintlint + - prealloc + - revive + - staticcheck + - testifylint + - unconvert + - unparam + - usestdlibvars + - whitespace + +linters-settings: + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/ustclug/Yuki) + exhaustive: + # Only run exhaustive check on switches with "//exhaustive:enforce" comment. + explicit-exhaustive-switch: true + # https://golangci-lint.run/usage/linters/#revive + revive: + confidence: 0.6 + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports + - name: blank-imports + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports + - name: dot-imports + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings + - name: error-strings + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf + - name: errorf + +issues: + exclude-rules: + - path: _test.go + linters: + - errcheck diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..33c21d2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,47 @@ +before: + hooks: + - go mod tidy +# TODO: publish docker images +# https://goreleaser.com/customization/docker/#how-it-works +builds: + - + id: yukictl + binary: yukictl + env: + - CGO_ENABLED=0 + main: ./cmd/yukictl + goos: + - linux + goarch: + - amd64 + flags: + - -trimpath + ldflags: + - -s -w -X github.com/ustclug/Yuki/pkg/info.Version={{.Version}} -X github.com/ustclug/Yuki/pkg/info.BuildDate={{.Date}} + - + id: yukid + binary: yukid + main: ./cmd/yukid + env: + # required by sqlite + - CGO_ENABLED=1 + goos: + - linux + goarch: + - amd64 + flags: + - -trimpath + ldflags: + - -s -w -X github.com/ustclug/Yuki/pkg/info.Version={{.Version}} -X github.com/ustclug/Yuki/pkg/info.BuildDate={{.Date}} +archives: + - format: binary +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + use: github-native + +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e5672bb --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +.PHONY: lint +lint: + golangci-lint run --fix ./... + +.PHONY: unit-test +unit-test: + go test -race -v ./pkg/... + +.PHONY: integration-test +integration-test: + go test -v ./test/integration/... + +.PHONY: yukid +yukid: + go build -trimpath ./cmd/yukid + +.PHONY: yukictl +yukictl: + go build -trimpath ./cmd/yukictl + +BUILD_IMAGE ?= golang:1.21-bookworm + +.PHONY: yukid-linux +yukid-linux: + @docker run \ + --rm \ + --mount source=go-cache,destination=/root/.cache/go-build \ + --mount source=go-mod,destination=/go/pkg/mod \ + -v $(PWD):/app \ + $(BUILD_IMAGE) \ + bash -c 'cd /app && make yukid' diff --git a/README.md b/README.md index 0d27182..83f0ec7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ README ======= -[![Build Status](https://github.com/ustclug/Yuki/workflows/build/badge.svg)](https://github.com/ustclug/Yuki/actions) +[![Build Status](https://github.com/ustclug/Yuki/workflows/pr-presubmit-checks/badge.svg)](https://github.com/ustclug/Yuki/actions) [![Go Report](https://goreportcard.com/badge/github.com/ustclug/Yuki)](https://goreportcard.com/report/github.com/ustclug/Yuki) - [Requirements](#requirements) @@ -13,43 +13,91 @@ Sync local repositories with remote. ## Requirements * Docker -* MongoDB +* SQLite ## Quickstart -Download the binary from the [Release](https://github.com/ustclug/Yuki/releases) page, for example: +Download the binaries from the [Release](https://github.com/ustclug/Yuki/releases) page, for example: -``` -$ wget https://github.com/ustclug/Yuki/releases/download/v0.2.2/yuki-v0.2.2-linux-amd64.tar.gz +```bash +wget https://github.com/ustclug/Yuki/releases/download/v0.2.2/yuki-v0.2.2-linux-amd64.tar.gz ``` Configure yukid: -``` -# mkdir /etc/yuki/ -# chown mirror:mirror /etc/yuki -$ curl 'https://raw.githubusercontent.com/ustclug/Yuki/master/dist/daemon.toml' > /etc/yuki/daemon.toml -$ vim /etc/yuki/daemon.toml +```bash +sudo mkdir /etc/yuki/ +sudo useradd -m mirror +mkdir /tmp/repo-logs/ /tmp/repo-configs/ + +cat < /etc/systemd/system/yukid.service +Setup repository: + +```bash +# The repository directory must be created in advance +mkdir /tmp/repos/docker-ce + +# Sync docker-ce repository from mirrors.bfsu.edu.cn +cat < /tmp/repo-configs/docker-ce.yaml +name: docker-ce +# every 1 hour +cron: "0 * * * *" +storageDir: /tmp/repos/docker-ce +image: ustcmirror/rsync:latest +logRotCycle: 2 +envs: + RSYNC_HOST: mirrors.bfsu.edu.cn + RSYNC_PATH: docker-ce/ + RSYNC_EXCLUDE: --exclude=.~tmp~/ + RSYNC_EXTRA: --size-only + RSYNC_MAXDELETE: "50000" +EOF + +yukictl reload +# Verify +yukictl repo ls + +# Trigger synchronization immediately +yukictl sync docker-ce ``` -Start yukid: -``` -# systemctl enable yukid -# systemctl start yukid -``` +For more details of the configuration file, please refer to the [yukid handbook](./cmd/yukid/README.md). ## Handbook * [yukid](./cmd/yukid/README.md): Yuki daemon * [yukictl](./cmd/yukictl/README.md): Yuki cli + +## Migration Guide + +### v0.3.x -> v0.4.x + +For configuration: + +```bash +sed -i.bak 's/log_dir/repo_logs_dir/' /etc/yuki/daemon.toml +# Also remember to update the `images_upgrade_interval` field in /etc/yuki/daemon.toml if it is set. + +sed -i.bak 's/interval/cron/' /path/to/repo/configs/*.yaml +``` + +For post sync hook, the environment variables that are passed to the hook script are changed: +* `Dir` -> `DIR`: the directory of the repository +* `Name` -> `NAME`: the name of the repository diff --git a/ci/build.sh b/ci/build.sh deleted file mode 100755 index f0047b8..0000000 --- a/ci/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -x -HERE=$(dirname "$0") -cd "$HERE/../" || exit 1 - -if [[ -z $GITHUB_TAG ]]; then - GITHUB_TAG=$(git describe --tags || echo 'unknown') -fi - -HERE=$(pwd) -NAME=${NAME:-yuki} - -export GOOS=${GOOS:-$(go env GOOS)} GOARCH=${GOARCH:-$(go env GOARCH)} CGO_ENABLED=0 - -stage="/tmp/$NAME-$GITHUB_TAG-$GOOS-$GOARCH/" -rm -rf "$stage" - -# static linking -go build -trimpath -ldflags '-w -s' -o "$stage/yukid" ./cmd/yukid -go build -trimpath -ldflags '-w -s' -o "$stage/yukictl" ./cmd/yukictl -cp LICENSE dist/{daemon.toml,yukid.service} "$stage" -tar -czf "$HERE/$NAME-$GITHUB_TAG-$GOOS-$GOARCH.tar.gz" -C /tmp -- "${stage#/tmp/}" diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100755 index 31e8878..0000000 --- a/ci/script.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -HERE=$(dirname "$0") -cd "$HERE/../" || exit 1 - -set -ex - -go test -race ./... -go vet ./... diff --git a/cmd/yukictl/README.md b/cmd/yukictl/README.md index 17e635f..40465e5 100644 --- a/cmd/yukictl/README.md +++ b/cmd/yukictl/README.md @@ -8,7 +8,6 @@ - [获取同步状态](#获取同步状态) - [手动开始同步任务](#手动开始同步任务) - [更新仓库同步配置](#更新仓库同步配置) - - [获取同步日志](#获取同步日志) ### Introduction @@ -38,7 +37,7 @@ $ yukictl meta ls [repo] $ yukictl sync ``` -开启同步任务的 debug 模式,并查看同步日志 +开启同步任务的 debug 模式 ```bash $ yukictl sync --debug ``` @@ -56,26 +55,5 @@ $ yukictl reload $ yukictl reload ``` -若需要删除仓库,则可以删除相应的配置文件然后执行 `yukictl repo rm ` 或直接 `yukictl reload` 来从数据库里删除配置。 +若需要删除仓库,则可以删除相应的配置文件,然后执行 `yukictl repo rm ` 或 `yukictl reload` 来从数据库里删除配置。 -#### 获取同步日志 - -当前的同步日志: -```bash -$ yukictl ct logs -``` - -跟踪并从倒数第 5 行开始: -```bash -$ yukictl ct logs --tail 5 -f -``` - -列出以往的同步日志: -```bash -$ yukictl repo logs --stats -``` - -查看以往倒数第二次同步日志的倒数 10 行: -```bash -$ yukictl repo logs -n 1 --tail 10 -``` diff --git a/cmd/yukictl/yukictl.go b/cmd/yukictl/yukictl.go index 6736e91..b47acbe 100644 --- a/cmd/yukictl/yukictl.go +++ b/cmd/yukictl/yukictl.go @@ -1,20 +1,29 @@ package main import ( + "encoding/json" + "github.com/spf13/cobra" + "github.com/ustclug/Yuki/pkg/info" "github.com/ustclug/Yuki/pkg/yukictl" "github.com/ustclug/Yuki/pkg/yukictl/factory" - "github.com/ustclug/Yuki/pkg/yukictl/globalflag" ) func main() { + var printVersion bool rootCmd := &cobra.Command{ - Use: "yukictl", + Use: "yukictl", + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { + if printVersion { + return json.NewEncoder(cmd.OutOrStdout()).Encode(info.VersionInfo) + } + return nil + }, } - gflag := globalflag.New() - gflag.AddFlags(rootCmd.PersistentFlags()) - f := factory.New(gflag) + rootCmd.Flags().BoolVarP(&printVersion, "version", "V", false, "Print version information and quit") + f := factory.New(rootCmd.PersistentFlags()) yukictl.Register(rootCmd, f) _ = rootCmd.Execute() } diff --git a/cmd/yukid/README.md b/cmd/yukid/README.md index 04e4c56..c148283 100644 --- a/cmd/yukid/README.md +++ b/cmd/yukid/README.md @@ -21,64 +21,78 @@ yukid 的配置,路径 `/etc/yuki/daemon.toml` ## 以及在日志里输出程序里打印日志的位置 #debug = true -## 设置 MongoDB 地址 -## 完整格式为 -## [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options] -#db_url = "127.0.0.1:27017" - -## 设置 db 名字 -#db_name = "mirror" - -## 数据所在位置的文件系统 -## 可选的值为 "zfs" | "xfs" | "default" -## 影响获取仓库大小的方式,如果是 "default" 的话仓库大小恒为 `-1` -fs = "default" +## 设置 sqlite 数据库文件的路径 +## 格式可以是文件路径或者是 url(如果需要设置特定参数的话)。例如: +## /var/run/yukid/data.db +## file:///home/fred/data.db?mode=ro&cache=private +## 参考 https://www.sqlite.org/c3ref/open.html +db_url = "/path/to/yukid.db" ## 每个仓库的同步配置存放的文件夹 ## 每个配置的后缀名必须是 `.yaml` ## 配置的格式参考下方 Repo Configuration repo_config_dir = ["/path/to/config-dir"] +## 设置同步日志存放的文件夹 +## 默认值是 /var/log/yuki/ +#repo_logs_dir = "/var/log/yuki/" + +## 数据所在位置的文件系统 +## 可选的值为 "zfs" | "xfs" | "default" +## 影响获取仓库大小的方式,如果是 "default" 的话仓库大小恒为 `-1` +## 默认值是 "default" +#fs = "default" + ## 设置 Docker Daemon 地址 ## unix local socket: unix:///var/run/docker.sock ## tcp: tcp://127.0.0.1:2375 +## 默认值是 "unix:///var/run/docker.sock" #docker_endpoint = "unix:///var/run/docker.sock" ## 设置同步程序的运行时的 uid 跟 gid,会影响仓库文件的 uid 跟 gid ## 格式为 uid:gid +## 默认值是 yukid 进程的 uid 跟 gid #owner = "1000:1000" -## 设置日志所在文件夹 -#log_dir = "/var/log/yuki/" +## 设置 yukid 的日志文件 +## 默认值是 "/dev/stderr" +#log_file = "/path/to/yukid.log" ## 设置 log level ## 可选的值为 "debug" | "info" | "warn" | "error" +## 默认值是 "info" #log_level = "info" ## 设置监听地址 +## 默认值是 "127.0.0.1:9999" #listen_addr = "127.0.0.1:9999" ## 设置同步仓库的时候默认绑定的 IP +## 默认值为空,即不绑定 #bind_ip = "1.2.3.4" ## 设置创建的 container 的名字前缀 +## 默认值是 "syncing-" #name_prefix = "syncing-" ## 设置同步完后执行的命令 +## 默认值为空 #post_sync = ["/path/to/the/program"] ## 设置更新用到的 docker images 的频率 -## 格式为 crontab -#images_upgrade_interval = "@every 1h" +## 默认值为 "1h" +#images_upgrade_interval = "1h" ## 同步超时时间,如果超过了这个时间,同步容器会被强制停止 ## 支持使用 time.ParseDuration() 支持的时间格式,诸如 "10m", "1h" 等 ## 如果为 0 的话则不会超时。注意修改的配置仅对新启动的同步容器生效 +## 默认值为 0 #sync_timeout = "48h" ## 修改同步时的 seccomp profile,用于特殊用途的容器 ## 例如,使用 seccomp user notify 的程序需要放行一些相关的系统调用 ## 留空时使用 docker daemon 默认的 seccomp 配置 +## 默认值为空 #seccomp_profile = "/path/to/seccomp/profile.json" ``` @@ -96,7 +110,7 @@ image: ustcmirror/rsync:latest # required interval: 2 2 31 4 * # required storageDir: /srv/repo/bioc # required logRotCycle: 1 # 保留多少次同步日志 -bindIP: 1.2.3.4 # 可选 +bindIP: 1.2.3.4 # 同步的时候绑定的 IP,可选,默认为空 network: host # 容器所属的 docker network,可选,默认为 host retry: 2 # 同步失败后的重试次数 envs: # 传给同步程序的环境变量 @@ -106,14 +120,13 @@ envs: # 传给同步程序的环境变量 RSYNC_USER: bioc-rsync $UPSTREAM: rsync://rsync.example.com/ # 可选变量,设置 yuki 显示的同步上游 volumes: # 同步的时候需要挂载的 volume - # 注意: 由于 MongoDB 的限制,key 不能包含 `.` /etc/passwd: /etc/passwd:ro - /ssh: /home/mirror/.ssh:ro + /home/mirror/.ssh: /home/mirror/.ssh:ro ``` 当存在多个目录时,配置将被字段级合并,同名字段 last win。举例: -daemon.yaml +daemon.toml ```yaml repo_config_dir = ["common/", "override/"] diff --git a/cmd/yukid/yukid.go b/cmd/yukid/yukid.go index 77f9538..73f4705 100644 --- a/cmd/yukid/yukid.go +++ b/cmd/yukid/yukid.go @@ -2,26 +2,47 @@ package main import ( "context" - "log" + "encoding/json" "os" "os/signal" + "github.com/spf13/cobra" + + "github.com/ustclug/Yuki/pkg/info" "github.com/ustclug/Yuki/pkg/server" ) func main() { - s, err := server.New() - if err != nil { - log.Fatal(err) + var ( + configPath string + printVersion bool + ) + cmd := cobra.Command{ + Use: "yukid", + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { + if printVersion { + return json.NewEncoder(cmd.OutOrStdout()).Encode(info.VersionInfo) + } + + s, err := server.New(configPath) + if err != nil { + return err + } + ctx, cancel := context.WithCancel(context.Background()) + signals := make(chan os.Signal, 2) + signal.Notify(signals, os.Interrupt) + go func() { + <-signals + cancel() + <-signals + os.Exit(1) + }() + return s.Start(ctx) + }, } - ctx, cancel := context.WithCancel(context.Background()) - signals := make(chan os.Signal, 2) - signal.Notify(signals, os.Interrupt) - go func() { - <-signals - cancel() - <-signals - os.Exit(1) - }() - s.Start(ctx) + cmd.Flags().StringVar(&configPath, "config", "/etc/yuki/daemon.toml", "The path to config file") + cmd.Flags().BoolVarP(&printVersion, "version", "V", false, "Print version information and quit") + + _ = cmd.Execute() } diff --git a/dist/yukid.service b/deploy/yukid.service similarity index 100% rename from dist/yukid.service rename to deploy/yukid.service diff --git a/dist/archlinux/.gitignore b/dist/archlinux/.gitignore deleted file mode 100644 index cf8530c..0000000 --- a/dist/archlinux/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -src/ -pkg/ -yuki-* -Yuki/ diff --git a/dist/archlinux/PKGBUILD b/dist/archlinux/PKGBUILD deleted file mode 100644 index 12f1b7d..0000000 --- a/dist/archlinux/PKGBUILD +++ /dev/null @@ -1,36 +0,0 @@ -# Maintainer: Jian Zeng - -pkgname=yuki-git -_pkgname=Yuki -pkgver=r54.ec1390e -pkgrel=1 -pkgdesc='Sync local repos with remote.' -install=yuki.install -arch=('x86_64') -url='https://github.com/ustclug/Yuki' -license=('GPL2') -backup=('etc/yuki/daemon.toml') -makedepends=('dep' 'go') -source=(yuki.install) -source_x86_64=("git+$url.git") -sha256sums=('ec512abfa0726694019885896730e0acac8752a1392cb36101112aa41c35e8e5') -sha256sums_x86_64=('SKIP') - -pkgver() { - cd "$_pkgname/" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" -} - -build() { - cd "$srcdir/$_pkgname/" || exit 1 - dep ensure - go build -o yukid ./cmd/yukid -} - -package() { - cd "$srcdir/$_pkgname/" || exit 1 - install -Dm644 dist/daemon.toml "$pkgdir/etc/yuki/daemon.toml" - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/yuki/LICENSE" - install -Dm644 dist/yukid.service "$pkgdir/usr/lib/systemd/system/yukid.service" - install -Dm755 yukid "$pkgdir/usr/local/bin/yukid" -} diff --git a/dist/archlinux/PKGBUILD-bin b/dist/archlinux/PKGBUILD-bin deleted file mode 100644 index d762cca..0000000 --- a/dist/archlinux/PKGBUILD-bin +++ /dev/null @@ -1,24 +0,0 @@ -# Maintainer: Jian Zeng - -pkgname=yuki-bin -_pkgname=yuki -pkgver=0.0.2 -pkgrel=1 -pkgdesc='Sync local repos with remote.' -install=yuki.install -arch=('x86_64') -url='https://github.com/ustclug/Yuki' -license=('GPL2') -backup=('etc/yuki/daemon.toml') -source=(yuki.install) -source_x86_64=("$url/releases/download/v$pkgver/$_pkgname-v$pkgver-linux-amd64.tar.gz") -sha256sums=('ec512abfa0726694019885896730e0acac8752a1392cb36101112aa41c35e8e5') -sha256sums_x86_64=('5ab0f6b8dfd30299db954b19bc5e0c8e8671d39660d97b82ba627c456ce60c19') - -package() { - cd "$_pkgname-v$pkgver-linux-amd64" || exit 1 - install -Dm644 daemon.toml "$pkgdir/etc/yuki/daemon.toml" - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/yuki/LICENSE" - install -Dm644 yukid.service "$pkgdir/usr/lib/systemd/system/yukid.service" - install -Dm755 yukid "$pkgdir/usr/local/bin/yukid" -} diff --git a/dist/archlinux/yuki.install b/dist/archlinux/yuki.install deleted file mode 100644 index c894454..0000000 --- a/dist/archlinux/yuki.install +++ /dev/null @@ -1,23 +0,0 @@ -post_install() { - # add mirror user and group if doesn't exist - if [ "$(grep mirror /etc/passwd)" == "" ]; then - useradd -r -s /bin/sh -m mirror - fi - - post_upgrade -} - -post_upgrade() { - # adjust owner and permissions for config file - chown -R mirror:mirror /etc/yuki/ - - cat < github.com/docker/engine v1.4.2-0.20191113042239-ea84732a7725 +require ( + // https://github.com/moby/moby/issues/46621 + github.com/docker/docker v25.0.0-beta.3+incompatible + github.com/docker/go-units v0.5.0 + github.com/go-playground/validator/v10 v10.16.0 + github.com/go-resty/resty/v2 v2.11.0 + github.com/labstack/echo/v4 v4.11.4 + github.com/orcaman/concurrent-map/v2 v2.0.1 + github.com/robfig/cron/v3 v3.0.1 + github.com/spf13/cobra v1.8.0 + github.com/spf13/pflag v1.0.5 + github.com/spf13/viper v1.18.2 + github.com/stretchr/testify v1.8.4 + golang.org/x/sync v0.5.0 + gorm.io/driver/sqlite v1.5.4 + gorm.io/gorm v1.25.5 + sigs.k8s.io/yaml v1.4.0 +) require ( github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.7+incompatible + github.com/containerd/log v0.1.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/go-playground/validator/v10 v10.14.0 - github.com/go-resty/resty/v2 v2.1.0 - github.com/labstack/echo/v4 v4.10.2 - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/labstack/gommon v0.4.2 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-sqlite3 v1.14.19 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/robfig/cron/v3 v3.0.1 - github.com/sirupsen/logrus v1.9.2 - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/cobra v1.0.0 - github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.3 + github.com/opencontainers/image-spec v1.1.0-rc3 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/tools v0.9.1 // indirect - gotest.tools/v3 v3.1.0 // indirect - sigs.k8s.io/yaml v1.3.0 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.16.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect ) diff --git a/go.sum b/go.sum index af219a6..16c7897 100644 --- a/go.sum +++ b/go.sum @@ -1,1474 +1,261 @@ -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/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/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -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/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/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/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -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/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -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/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -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/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -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/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= -cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -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/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= -cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= -cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -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/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/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -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/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -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.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -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/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/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -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/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/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -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/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/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -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/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -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/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/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -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/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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/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/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/docker v25.0.0-beta.3+incompatible h1:aoDCVh2PkQ4M/XfvKIJ6MoTPR+RFvwMVfkLqFZKCXS4= +github.com/docker/docker v25.0.0-beta.3+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.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -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= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -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/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -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/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -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/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -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= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-resty/resty/v2 v2.1.0 h1:Z6IefCpUMfnvItVJaJXWv/pMiiD11So35QgwEELsldE= -github.com/go-resty/resty/v2 v2.1.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= +github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -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/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -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/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -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/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -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/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -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= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -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/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -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/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -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/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/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.9/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/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/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= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -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-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-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -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/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -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/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -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/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -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/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= -github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= -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/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.2.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-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-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -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/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -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/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= 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.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= -github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -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/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -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/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -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.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/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/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= -github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= +github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8= +github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8= +github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= +github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -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.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -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.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -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-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -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/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -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/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 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/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/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/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= 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/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 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.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -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/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -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.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= +github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/orcaman/concurrent-map/v2 v2.0.1 h1:jOJ5Pg2w1oeB6PeDurIYf6k9PQ+aTITr/6lP/L/zp6c= +github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM= +github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= +github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -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/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/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.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -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/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/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/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/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -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.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= -github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -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/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -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/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= 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/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -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/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -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/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -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/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -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/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.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= -go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= -go.etcd.io/etcd/client/v2 v2.305.6/go.mod h1:BHha8XJGe8vCIBfWBpbBLVZ4QjOIlfoouvOwydu63E0= -go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= -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/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 h1:digkEZCJWobwBqMwC0cwCq8/wkkRy/OowZg5OArWZrM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0/go.mod h1:/OpE/y70qVkndM0TrxT4KBoN3RsFZP0QaofcfYrj76I= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -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-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 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-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -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/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/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -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= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -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/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -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= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -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/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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-20181114220301-adae6a3d119a/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/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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/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/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/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/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/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-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/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -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-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/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/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-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/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-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/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-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -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/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -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/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -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-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/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/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/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-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/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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/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-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-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-20191204072324-ce4227a45e2e/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-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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/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-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/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-20210225134936-a50acf3fe073/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/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/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/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-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/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-20211103235746-7861aae1554b/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-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/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-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-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-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/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-20220728004956-3c1f35247d10/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-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 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/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -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/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/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.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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-20190311212946-11955173bddd/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-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -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-20190907020128-2ca718005c18/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-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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-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-20200117161641-43d50277825c/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/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/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -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-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -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-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/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/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/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -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/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -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/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -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.77.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/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= -google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -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/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -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/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/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -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/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/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/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-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -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-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/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-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -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-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -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-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -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-20210513213006-bf773b8c8384/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/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -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/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/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/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -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-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-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-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-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -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-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -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/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -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/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -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/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -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/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -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/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -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/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -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/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -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= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -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/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.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -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.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.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= -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/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +gorm.io/driver/sqlite v1.5.4 h1:IqXwXi8M/ZlPzH/947tn5uik3aYQslP9BVveoax0nV0= +gorm.io/driver/sqlite v1.5.4/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= +gorm.io/gorm v1.25.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls= +gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/api/const.go b/pkg/api/const.go new file mode 100644 index 0000000..e2068b9 --- /dev/null +++ b/pkg/api/const.go @@ -0,0 +1,7 @@ +package api + +const ( + LabelRepoName = "org.ustcmirror.name" + LabelStorageDir = "org.ustcmirror.storage-dir" + LabelImages = "org.ustcmirror.images" +) diff --git a/pkg/api/types.go b/pkg/api/types.go index 926c47c..0ffd50e 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -1,80 +1,24 @@ package api -import ( - "time" -) +type ListRepoMetasResponse = []GetRepoMetaResponse -// Container provides the ID and labels of a container. -type Container struct { - ID string - Labels map[string]string +type GetRepoMetaResponse struct { + Name string `json:"name"` + Upstream string `json:"upstream"` + Syncing bool `json:"syncing"` + Size int64 `json:"size"` + ExitCode int `json:"exitCode"` + LastSuccess int64 `json:"lastSuccess"` + UpdatedAt int64 `json:"updatedAt"` + PrevRun int64 `json:"prevRun"` + NextRun int64 `json:"nextRun"` } -// ContainerDetail describes a container in detail. -type ContainerDetail struct { - ID string `json:"id"` - Image string `json:"image"` - Created int64 `json:"created"` - State string `json:"state"` - Status string `json:"status"` - Name string `json:"name"` +type ListReposResponseItem struct { + Name string `json:"name"` + Cron string `json:"cron"` + Image string `json:"image"` + StorageDir string `json:"storageDir"` } -// LogFileStat describes a log file. -type LogFileStat struct { - Name string `json:"name"` - Size int64 `json:"size"` - Mtime time.Time `json:"mtime"` -} - -// Meta represents the metadata of a Repository. -type Meta struct { - Name string `bson:"_id" json:"name"` - Upstream string `bson:"-" json:"upstream"` - Syncing bool `bson:"-" json:"syncing"` - Size int64 `bson:"size" json:"size"` - ExitCode int `bson:"exitCode" json:"exitCode"` - LastSuccess int64 `bson:"lastSuccess,omitempty" json:"lastSuccess"` - CreatedAt int64 `bson:"createdAt,omitempty" json:"createdAt"` - UpdatedAt int64 `bson:"updatedAt,omitempty" json:"updatedAt"` - PrevRun int64 `bson:"prevRun,omitempty" json:"prevRun"` - NextRun int64 `bson:"-" json:"nextRun"` -} - -// M is an alias for a map[string]string map. -type M = map[string]string - -// Repository contains a list of syncing options. -type Repository struct { - Name string `bson:"_id" json:"name" validate:"required"` - Interval string `bson:"interval" json:"interval" validate:"required,cron"` - Image string `bson:"image" json:"image" validate:"required,containsrune=:"` - StorageDir string `bson:"storageDir" json:"storageDir" validate:"required"` - User string `bson:"user,omitempty" json:"user,omitempty" validate:"omitempty,gt=1"` - BindIP string `bson:"bindIP,omitempty" json:"bindIP,omitempty" validate:"omitempty,ip"` - Network string `bson:"network,omitempty" json:"network,omitempty" validate:"omitempty"` - LogRotCycle *int `bson:"logRotCycle,omitempty" json:"logRotCycle,omitempty" validate:"omitempty,min=0"` - Retry int `bson:"retry,omitempty" json:"retry,omitempty" validate:"min=0"` - Envs M `bson:"envs,omitempty" json:"envs,omitempty" validate:"omitempty,dive,keys,required,endkeys,required"` - Volumes M `bson:"volumes,omitempty" json:"volumes,omitempty" validate:"omitempty,dive,keys,required,endkeys,required"` - CreatedAt int64 `bson:"createdAt,omitempty" json:"createdAt,omitempty"` - UpdatedAt int64 `bson:"updatedAt,omitempty" json:"updatedAt,omitempty"` -} - -type RepoSummary struct { - Name string `bson:"_id" json:"name"` - Interval string `bson:"interval" json:"interval"` - Image string `bson:"image" json:"image"` - StorageDir string `bson:"storageDir" json:"storageDir" validate:"required"` -} - -type PreSyncPayload struct { - Name string -} - -type PostSyncPayload struct { - ID string - Name string - Dir string - ExitCode int -} +type ListReposResponse = []ListReposResponseItem diff --git a/pkg/core/docker.go b/pkg/core/docker.go deleted file mode 100644 index 9c98bfc..0000000 --- a/pkg/core/docker.go +++ /dev/null @@ -1,260 +0,0 @@ -package core - -import ( - "context" - "fmt" - "io" - "io/ioutil" - "os" - "path" - "strconv" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/client" - - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/utils" -) - -// SyncOptions provides params to the Sync function. -type SyncOptions struct { - Name string - LogDir string - DefaultOwner string - DefaultBindIP string - SeccompProfile string - NamePrefix string - Debug bool - MountDir bool -} - -// LogsOptions provides params to the GetContainerLogs function. -type LogsOptions struct { - ID string - Stream io.Writer - Tail string - Follow bool -} - -// GetContainerLogs gets all stdout and stderr logs from the given container. -func (c *Core) GetContainerLogs(ctx context.Context, opts LogsOptions) error { - output, err := c.docker.ContainerLogs(ctx, opts.ID, types.ContainerLogsOptions{ - ShowStdout: true, - ShowStderr: true, - Tail: opts.Tail, - Follow: opts.Follow, - }) - if err != nil { - return err - } - defer output.Close() - _, err = io.Copy(opts.Stream, output) - if err != context.Canceled { - return err - } - return nil -} - -func makeFilterArgs(filter map[string][]string) filters.Args { - args := filters.NewArgs() - for k, l := range filter { - for _, i := range l { - args.Add(k, i) - } - } - return args -} - -// ListImages returns a list of docker images. -func (c *Core) ListImages(ctx context.Context, filter map[string][]string) ([]types.ImageSummary, error) { - return c.docker.ImageList(ctx, types.ImageListOptions{ - All: true, - Filters: makeFilterArgs(filter), - }) -} - -// PullImage pulls an image from remote registry. -func (c *Core) PullImage(ctx context.Context, img string) error { - // ctx, cancel := context.WithTimeout(ctx, time.Minute*5) - // defer cancel() - stream, err := c.docker.ImagePull(ctx, img, types.ImagePullOptions{}) - if err != nil { - return err - } - defer stream.Close() - _, err = io.Copy(ioutil.Discard, stream) - return err -} - -// RemoveImage removes the given docker image. -func (c *Core) RemoveImage(ctx context.Context, id string) error { - _, err := c.docker.ImageRemove(ctx, id, types.ImageRemoveOptions{ - PruneChildren: true, - }) - return err -} - -// StopContainer stops the given container. -func (c *Core) StopContainer(ctx context.Context, id string) error { - return c.docker.ContainerStop(ctx, id, container.StopOptions{}) -} - -// ListContainers returns a list of containers. -func (c *Core) ListContainers(ctx context.Context, filter map[string][]string) ([]types.Container, error) { - return c.docker.ContainerList(ctx, types.ContainerListOptions{ - All: true, - Latest: true, - Filters: makeFilterArgs(filter), - }) -} - -// WaitContainer blocks until the given container exits. -func (c *Core) WaitContainer(ctx context.Context, id string) (int, error) { - stream, errCh := c.docker.ContainerWait(ctx, id, container.WaitConditionNotRunning) - select { - case err := <-errCh: - if err != nil { - return -1, err - } - // unreachable - return -1, fmt.Errorf("unreachable") - case resp := <-stream: - return int(resp.StatusCode), nil - } -} - -// RemoveContainer removes the given container. -func (c *Core) RemoveContainer(ctx context.Context, id string) error { - // ctx, cancel := context.WithTimeout(c.ctx, time.Second*20) - // defer cancel() - return c.docker.ContainerRemove(ctx, id, types.ContainerRemoveOptions{ - RemoveVolumes: true, - Force: true, - }) -} - -// Sync creates and starts a predefined container to sync local repository. -func (c *Core) Sync(ctx context.Context, opts SyncOptions) (*api.Container, error) { - r, err := c.GetRepository(opts.Name) - if err != nil { - return nil, fmt.Errorf("cannot find <%s> in the DB", opts.Name) - } - - envMap := map[string]string{} - for k, v := range r.Envs { - envMap[k] = v - } - if len(r.BindIP) == 0 { - r.BindIP = opts.DefaultBindIP - } - if len(r.User) == 0 { - r.User = opts.DefaultOwner - } - - seccomp_item := "" - security_opt := []string{} - if len(opts.SeccompProfile) > 0 { - seccomp_item = "seccomp=" + opts.SeccompProfile - security_opt = append(security_opt, seccomp_item) - } - - if r.LogRotCycle == nil { - ten := 10 - r.LogRotCycle = &ten - } - envMap["REPO"] = r.Name - envMap["OWNER"] = r.User - envMap["BIND_ADDRESS"] = r.BindIP - envMap["RETRY"] = strconv.FormatInt(int64(r.Retry), 10) - envMap["LOG_ROTATE_CYCLE"] = strconv.FormatInt(int64(*r.LogRotCycle), 10) - if opts.Debug { - envMap["DEBUG"] = "true" - } else if envMap["DEBUG"] == "" { - envMap["DEBUG"] = "false" - } - envs := make([]string, 0, len(envMap)) - for k, v := range envMap { - envs = append(envs, k+"="+v) - } - - var binds []string - for k, v := range r.Volumes { - binds = append(binds, fmt.Sprintf("%s:%s", k, v)) - } - - if opts.MountDir { - logdir := path.Join(opts.LogDir, opts.Name) - if err = os.MkdirAll(logdir, os.ModePerm); err != nil { - return nil, fmt.Errorf("not a directory: %s", logdir) - } - if !utils.DirExists(r.StorageDir) { - return nil, fmt.Errorf("not a directory: %s", r.StorageDir) - } - binds = append(binds, fmt.Sprintf("%s:/data/", r.StorageDir), fmt.Sprintf("%s:/log/", logdir)) - } - labels := api.M{ - "org.ustcmirror.name": r.Name, - "org.ustcmirror.syncing": "true", - "org.ustcmirror.storage-dir": r.StorageDir, - } - containerConfig := &container.Config{ - Image: r.Image, - OpenStdin: true, - Env: envs, - Labels: labels, - } - hostConfig := &container.HostConfig{ - Binds: binds, - SecurityOpt: security_opt, - } - networkingConfig := &network.NetworkingConfig{ - EndpointsConfig: make(map[string]*network.EndpointSettings, 1), - } - ctName := opts.NamePrefix + opts.Name - - switch r.Network { - case "", "host": - hostConfig.NetworkMode = "host" - default: - // https://github.com/moby/moby/blob/master/daemon/create_test.go#L15 - networkingConfig.EndpointsConfig[r.Network] = &network.EndpointSettings{} - } - - ct, err := c.docker.ContainerCreate( - ctx, - containerConfig, - hostConfig, - networkingConfig, - nil, - ctName, - ) - if err != nil { - if client.IsErrNotFound(err) { - if err = c.PullImage(ctx, r.Image); err == nil { - ct, err = c.docker.ContainerCreate( - ctx, - containerConfig, - hostConfig, - networkingConfig, - nil, - ctName, - ) - } - } - if err != nil { - return nil, err - } - } - - if err = c.docker.ContainerStart(ctx, ct.ID, types.ContainerStartOptions{}); err != nil { - return nil, err - } - - return &api.Container{ - ID: ct.ID, - Labels: labels, - }, nil -} diff --git a/pkg/core/docker_test.go b/pkg/core/docker_test.go deleted file mode 100644 index f78a2c3..0000000 --- a/pkg/core/docker_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package core - -import ( - "context" - "os" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/ustclug/Yuki/pkg/api" -) - -func TestSync(t *testing.T) { - t.Parallel() - name := "yuki-sync-test-sync-repo" - as := assert.New(t) - cycle := 10 - d := "/tmp/" + name - as.Nil(os.MkdirAll(d, os.ModePerm)) - defer os.RemoveAll(d) - err := c.AddRepository(api.Repository{ - Name: name, - Interval: "1 * * * *", - Image: "ustcmirror/test:latest", - StorageDir: d, - LogRotCycle: &cycle, - }) - as.Nil(err) - prefix := "syncing-" - ct, err := c.Sync(context.TODO(), SyncOptions{ - LogDir: logDir, - MountDir: false, - Name: name, - NamePrefix: prefix, - }) - as.Nil(err) - code, err := c.WaitContainer(context.TODO(), ct.ID) - as.Nil(err) - defer c.RemoveContainer(context.TODO(), ct.ID) - as.Equal(0, code) -} diff --git a/pkg/core/main.go b/pkg/core/main.go deleted file mode 100644 index 9e20f1c..0000000 --- a/pkg/core/main.go +++ /dev/null @@ -1,71 +0,0 @@ -package core - -import ( - "fmt" - - "github.com/docker/docker/client" - "github.com/globalsign/mgo" - - "github.com/ustclug/Yuki/pkg/fs" -) - -// Config contains a list of options used when creating `Core`. -type Config struct { - Debug bool - // DbURL contains username and password - DbURL string - DbName string - GetSizer fs.GetSizer - DockerEndpoint string -} - -// Core is the basic type of this package. It provides methods for interaction with MongoDB and Docker API. -type Core struct { - mgoSess *mgo.Session - repoColl *mgo.Collection - metaColl *mgo.Collection - docker *client.Client - getSizer fs.GetSizer -} - -// NewWithConfig returns a `Core` instance with specified config. -func NewWithConfig(cfg Config) (*Core, error) { - d, err := client.NewClientWithOpts( - client.WithHost(cfg.DockerEndpoint), - client.WithAPIVersionNegotiation(), - ) - if err != nil { - return nil, fmt.Errorf("cannot connect to the Docker daemon at %s", cfg.DockerEndpoint) - } - - mgo.SetDebug(cfg.Debug) - sess, err := mgo.Dial(cfg.DbURL) - if err != nil { - return nil, fmt.Errorf("cannot connect to the MongoDB at %s", cfg.DbURL) - } - sess.SetMode(mgo.Monotonic, true) - - db := sess.DB(cfg.DbName) - c := Core{ - docker: d, - mgoSess: sess, - getSizer: cfg.GetSizer, - } - - c.repoColl = db.C("repositories") - c.metaColl = db.C("metas") - - return &c, nil -} - -func (c *Core) GetSize(dir string) int64 { - return c.getSizer.GetSize(dir) -} - -func (c *Core) PingMongoSession() error { - return c.mgoSess.Ping() -} - -func (c *Core) CloseMongoSession() { - c.mgoSess.Close() -} diff --git a/pkg/core/main_test.go b/pkg/core/main_test.go deleted file mode 100644 index 0320d9f..0000000 --- a/pkg/core/main_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package core - -import ( - "io/ioutil" - "log" - "os" - "testing" -) - -var ( - c *Core - logDir string -) - -func TestMain(m *testing.M) { - var err error - c, err = NewWithConfig(Config{ - DbURL: "127.0.0.1:27017", - DbName: "test", - DockerEndpoint: "unix:///var/run/docker.sock", - }) - if err != nil { - log.Fatal(err) - } - logDir, err = ioutil.TempDir("", "yuki") - if err != nil { - log.Fatal(err) - } - defer os.RemoveAll(logDir) - _ = c.repoColl.DropCollection() - _ = c.metaColl.DropCollection() - os.Exit(m.Run()) -} diff --git a/pkg/core/meta.go b/pkg/core/meta.go deleted file mode 100644 index 34e98b2..0000000 --- a/pkg/core/meta.go +++ /dev/null @@ -1,228 +0,0 @@ -package core - -import ( - "fmt" - "regexp" - "strings" - "time" - - "github.com/globalsign/mgo" - "github.com/globalsign/mgo/bson" - - "github.com/ustclug/Yuki/pkg/api" -) - -var ( - extraSlashes = regexp.MustCompile("([^:])//+") -) - -func getUpstream(t string, envs api.M) (upstream string) { - var ok bool - if upstream, ok := envs["$UPSTREAM"]; ok { - return upstream - } - switch t { - case "archvsync", "rsync": - return fmt.Sprintf("rsync://%s/%s/", envs["RSYNC_HOST"], envs["RSYNC_PATH"]) - case "aptsync", "apt-sync": - return envs["APTSYNC_URL"] - case "crates-io-index": - return "https://github.com/rust-lang/crates.io-index" - case "debian-cd": - return fmt.Sprintf("rsync://%s/%s/", envs["RSYNC_HOST"], envs["RSYNC_MODULE"]) - case "docker-ce": - return "https://download.docker.com/" - case "fedora": - remote, ok := envs["REMOTE"] - if !ok { - remote = "rsync://dl.fedoraproject.org" - } - return fmt.Sprintf("%s/%s", remote, envs["MODULE"]) - case "freebsd-pkg": - if upstream, ok = envs["FBSD_PKG_UPSTREAM"]; !ok { - return "http://pkg.freebsd.org/" - } - case "freebsd-ports": - if upstream, ok = envs["FBSD_PORTS_DISTFILES_UPSTREAM"]; !ok { - return "http://distcache.freebsd.org/ports-distfiles/" - } - case "ghcup": - return "https://www.haskell.org/ghcup/" - case "github-release": - return "https://github.com" - case "gitsync": - return envs["GITSYNC_URL"] - case "google-repo": - if upstream, ok = envs["UPSTREAM"]; !ok { - return "https://android.googlesource.com/mirror/manifest" - } - case "gsutil-rsync": - return envs["GS_URL"] - case "hackage": - if upstream, ok = envs["HACKAGE_BASE_URL"]; !ok { - return "https://hackage.haskell.org/" - } - case "homebrew-bottles": - if upstream, ok = envs["HOMEBREW_BOTTLE_DOMAIN"]; !ok { - return "https://ghcr.io/v2/homebrew/" - } - case "julia-storage": - return "https://us-east.storage.juliahub.com, https://kr.storage.juliahub.com" - case "nix-channels": - if upstream, ok = envs["NIX_MIRROR_UPSTREAM"]; !ok { - return "https://nixos.org/channels" - } - case "lftpsync": - return fmt.Sprintf("%s/%s", envs["LFTPSYNC_HOST"], envs["LFTPSYNC_PATH"]) - case "nodesource": - return "https://nodesource.com/" - case "pypi": - return "https://pypi.python.org/" - case "rclone": - remoteType := envs["RCLONE_CONFIG_REMOTE_TYPE"] - path := envs["RCLONE_PATH"] - domain := "" - if remoteType == "swift" { - domain = envs["RCLONE_SWIFT_STORAGE_URL"] + "/" - } else if remoteType == "http" { - domain = envs["RCLONE_CONFIG_REMOTE_URL"] - } else if remoteType == "s3" { - domain = envs["RCLONE_CONFIG_REMOTE_ENDPOINT"] - } - return fmt.Sprintf("%s%s", domain, path) - case "rubygems": - if upstream, ok = envs["UPSTREAM"]; !ok { - return "http://rubygems.org/" - } - case "stackage": - upstream = "https://github.com/commercialhaskell/" - case "tsumugu": - return envs["UPSTREAM"] - case "winget-source": - if upstream, ok = envs["WINGET_REPO_URL"]; !ok { - return "https://cdn.winget.microsoft.com/cache" - } - case "yum-sync": - return envs["YUMSYNC_URL"] - } - return -} - -func (c *Core) transformMeta(m *api.Meta) { - if r, err := c.GetRepository(m.Name); err == nil { - image := strings.Split(r.Image, ":")[0] - t := strings.Split(image, "/") - // remove extra slashes - m.Upstream = extraSlashes.ReplaceAllString(getUpstream(t[len(t)-1], r.Envs), "${1}/") - } - if m.Upstream == "" { - m.Upstream = "unknown" - } -} - -// GetMeta returns the metadata of the given Repository. -func (c *Core) GetMeta(name string) (*api.Meta, error) { - m := new(api.Meta) - sess := c.mgoSess.Copy() - defer sess.Close() - if err := c.metaColl.With(sess).FindId(name).One(m); err != nil { - return nil, err - } - c.transformMeta(m) - return m, nil -} - -// AddMeta inserts one or more Metas. -func (c *Core) AddMeta(ms ...*api.Meta) error { - now := time.Now().Unix() - docs := make([]interface{}, 0, len(ms)) - for _, m := range ms { - m.CreatedAt = now - docs = append(docs, *m) - } - sess := c.mgoSess.Copy() - defer sess.Close() - return c.metaColl.With(sess).Insert(docs...) -} - -// InitMetas creates metadata for each Repository. -func (c *Core) InitMetas() { - repos := c.ListAllRepositories() - now := time.Now().Unix() - for _, r := range repos { - size := c.GetSize(r.StorageDir) - _, _ = c.metaColl.UpsertId(r.Name, bson.M{ - "$set": bson.M{ - "size": size, - }, - "$setOnInsert": bson.M{ - "createdAt": now, - "exitCode": -1, - }, - }) - } -} - -func (c *Core) UpdatePrevRun(name string) error { - sess := c.mgoSess.Copy() - defer sess.Close() - err := c.metaColl.With(sess).UpdateId(name, bson.M{ - "$set": bson.M{ - "prevRun": time.Now().Unix(), - }, - }) - return err -} - -// UpsertRepoMeta updates the metadata of the given Repository. -func (c *Core) UpsertRepoMeta(name, dir string, code int) error { - now := time.Now().Unix() - set := bson.M{ - "updatedAt": now, - "size": c.GetSize(dir), - } - if code != -1 { - set["exitCode"] = code - } - if code == 0 { - set["lastSuccess"] = now - } - sess := c.mgoSess.Copy() - defer sess.Close() - _, err := c.metaColl.With(sess).UpsertId(name, bson.M{ - "$set": set, - "$setOnInsert": bson.M{ - "createdAt": now, - }, - }) - return err -} - -// RemoveMeta removes the metadata of the given Repository. -func (c *Core) RemoveMeta(name string) error { - sess := c.mgoSess.Copy() - defer sess.Close() - return c.metaColl.With(sess).RemoveId(name) -} - -// ListAllMetas returns the list of metadata of all Repositories. -func (c *Core) ListAllMetas() []api.Meta { - sess := c.mgoSess.Copy() - defer sess.Close() - var ( - result []api.Meta - m api.Meta - ) - iter := c.metaColl.With(sess).Find(nil).Sort("_id").Iter() - defer iter.Close() - for iter.Next(&m) { - c.transformMeta(&m) - result = append(result, m) - } - return result -} - -// FindMeta simply re-export the mgo API. -func (c *Core) FindMeta(query interface{}) *mgo.Query { - return c.metaColl.Find(query) -} diff --git a/pkg/core/meta_test.go b/pkg/core/meta_test.go deleted file mode 100644 index 8a58427..0000000 --- a/pkg/core/meta_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package core - -import ( - "testing" - - "github.com/globalsign/mgo/bson" - "github.com/stretchr/testify/assert" - - "github.com/ustclug/Yuki/pkg/api" -) - -func TestGetMeta(t *testing.T) { - t.Parallel() - name := "test-get-meta" - as := assert.New(t) - cycle := 10 - err := c.AddRepository(api.Repository{ - Name: name, - Interval: "1 * * * *", - Image: "ustcmirror/hackage:latest", - StorageDir: "/tmp/hackage", - LogRotCycle: &cycle, - }) - as.Nil(err) - err = c.AddMeta(&api.Meta{ - Name: name, - Size: -1, - ExitCode: -1, - }) - as.Nil(err) - - m, err := c.GetMeta(name) - as.Nil(err) - as.Equal("https://hackage.haskell.org/", m.Upstream) - - err = c.UpdateRepository(name, bson.M{"image": "ustcmirror/homebrew-bottles:latest"}) - as.Nil(err) - - m, err = c.GetMeta(name) - as.Nil(err) - as.Equal("https://ghcr.io/v2/homebrew/", m.Upstream) -} - -func TestRemoveMeta(t *testing.T) { - t.Parallel() - name := "test-remove-meta" - as := assert.New(t) - err := c.AddMeta(&api.Meta{ - Name: name, - Size: -1, - ExitCode: -1, - }) - as.Nil(err) - - err = c.RemoveMeta(name) - as.Nil(err) - - _, err = c.GetMeta(name) - as.NotNil(err) -} diff --git a/pkg/core/repo.go b/pkg/core/repo.go deleted file mode 100644 index 7b1f6e6..0000000 --- a/pkg/core/repo.go +++ /dev/null @@ -1,77 +0,0 @@ -package core - -import ( - "time" - - "github.com/globalsign/mgo" - "github.com/globalsign/mgo/bson" - - "github.com/ustclug/Yuki/pkg/api" -) - -// GetRepository returns the Repository with the given name. -func (c *Core) GetRepository(name string) (*api.Repository, error) { - sess := c.mgoSess.Copy() - defer sess.Close() - r := new(api.Repository) - if err := c.repoColl.With(sess).FindId(name).One(r); err != nil { - return nil, err - } - return r, nil -} - -// AddRepository creates one or more Repositories. -func (c *Core) AddRepository(repos ...api.Repository) error { - sess := c.mgoSess.Copy() - defer sess.Close() - now := time.Now().Unix() - rs := make([]interface{}, 0, len(repos)) - for _, r := range repos { - if r.LogRotCycle == nil { - cycle := 10 - r.LogRotCycle = &cycle - } - r.CreatedAt = now - r.UpdatedAt = now - rs = append(rs, r) - } - return c.repoColl.With(sess).Insert(rs...) -} - -// UpdateRepository updates the syncing options of the given Repository. -func (c *Core) UpdateRepository(name string, update bson.M) error { - var set bson.M - sess := c.mgoSess.Copy() - defer sess.Close() - switch v := update["$set"].(type) { - case map[string]interface{}: - set = v - case bson.M: - set = v - default: - set = bson.M{} - } - set["updatedAt"] = time.Now().Unix() - return c.repoColl.With(sess).UpdateId(name, update) -} - -// RemoveRepository removes the Repository with given name. -func (c *Core) RemoveRepository(name string) error { - sess := c.mgoSess.Copy() - defer sess.Close() - return c.repoColl.With(sess).RemoveId(name) -} - -// ListAllRepositories returns all Repositories. -func (c *Core) ListAllRepositories() []api.Repository { - sess := c.mgoSess.Copy() - defer sess.Close() - var result []api.Repository - _ = c.repoColl.With(sess).Find(nil).Sort("_id").All(&result) - return result -} - -// FindRepository simply re-export the mgo API. -func (c *Core) FindRepository(query interface{}) *mgo.Query { - return c.repoColl.Find(query) -} diff --git a/pkg/core/repo_test.go b/pkg/core/repo_test.go deleted file mode 100644 index 9f90003..0000000 --- a/pkg/core/repo_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package core - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/ustclug/Yuki/pkg/api" -) - -func TestAddRepository(t *testing.T) { - t.Parallel() - name := "test-add-repo" - as := assert.New(t) - cycle := 10 - err := c.AddRepository(api.Repository{ - Name: name, - Interval: "1 * * * *", - Image: "ustcmirror/hackage:latest", - StorageDir: "/tmp/hackage", - LogRotCycle: &cycle, - }) - as.Nil(err) - repo, err := c.GetRepository(name) - as.Nil(err) - as.Equal("1 * * * *", repo.Interval) -} - -func TestUpdateRepository(t *testing.T) { -} - -func TestRemoveRepository(t *testing.T) { - t.Parallel() - name := "test-remove-repo" - as := assert.New(t) - cycle := 10 - err := c.AddRepository(api.Repository{ - Name: name, - Interval: "1 * * * *", - Image: "ustcmirror/hackage:latest", - StorageDir: "/tmp/hackage", - LogRotCycle: &cycle, - }) - as.Nil(err) - - _, err = c.GetRepository(name) - as.Nil(err) - - err = c.RemoveRepository(name) - as.Nil(err) - - _, err = c.GetRepository(name) - as.NotNil(err) -} diff --git a/pkg/cron/cron.go b/pkg/cron/cron.go deleted file mode 100644 index 1729324..0000000 --- a/pkg/cron/cron.go +++ /dev/null @@ -1,85 +0,0 @@ -// Package cron provides some cron utility functions. -package cron - -import ( - "sync" - - "github.com/robfig/cron/v3" -) - -// Cron wraps `cron.Cron`. -type Cron struct { - inner *cron.Cron -} - -// FuncJob is alias of `cron.FuncJob`. -type FuncJob = cron.FuncJob - -var scheduledJobs sync.Map - -// Parse parses job specification. -func Parse(spec string) (cron.Schedule, error) { - return cron.ParseStandard(spec) -} - -// New returns an instance of Cron. -func New() *Cron { - c := cron.New() - c.Start() - return &Cron{c} -} - -func (c *Cron) Entries() []cron.Entry { - return c.inner.Entries() -} - -// Jobs returns a map of job names to job. -func (c *Cron) Jobs() map[string]cron.Entry { - ret := map[string]cron.Entry{} - entries := c.inner.Entries() - id2name := map[cron.EntryID]string{} - scheduledJobs.Range(func(key, value interface{}) bool { - name := key.(string) - id := value.(cron.EntryID) - id2name[id] = name - return true - }) - for _, entry := range entries { - name, ok := id2name[entry.ID] - if !ok { - continue - } - ret[name] = entry - } - return ret -} - -func (c *Cron) AddFunc(spec string, cmd func()) error { - _, err := c.inner.AddFunc(spec, cmd) - return err -} - -// AddJob removes the job with the same name first and adds a new job. -func (c *Cron) AddJob(name, spec string, cmd FuncJob) error { - c.RemoveJob(name) - id, err := c.inner.AddFunc(spec, cmd) - if err != nil { - return err - } - scheduledJobs.Store(name, id) - return nil -} - -// HasJob returns whether the given job exists. -func (c *Cron) HasJob(name string) bool { - _, ok := scheduledJobs.Load(name) - return ok -} - -// RemoveJob remove the job with the given name. -func (c *Cron) RemoveJob(name string) { - if v, ok := scheduledJobs.Load(name); ok { - c.inner.Remove(v.(cron.EntryID)) - scheduledJobs.Delete(name) - } -} diff --git a/pkg/cron/cron_test.go b/pkg/cron/cron_test.go deleted file mode 100644 index 4e0e097..0000000 --- a/pkg/cron/cron_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package cron - -import ( - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestCron(t *testing.T) { - var wg sync.WaitGroup - now := time.Now() - next := now.Add(time.Second * 4) - wg.Add(1) - cron := New() - err := cron.AddFunc("@every 3s", func() { - wg.Done() - }) - assert.Nil(t, err) - wg.Wait() - now2 := time.Now() - assert.True(t, now2.After(now) && now2.Before(next)) -} diff --git a/pkg/docker/cli.go b/pkg/docker/cli.go new file mode 100644 index 0000000..c9ed195 --- /dev/null +++ b/pkg/docker/cli.go @@ -0,0 +1,161 @@ +package docker + +import ( + "context" + "fmt" + "io" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/client" + "github.com/docker/docker/errdefs" + + "github.com/ustclug/Yuki/pkg/api" +) + +type Client interface { + // RunContainer creates and starts a container with the given config. + // The specified image will be pulled automatically if it does not exist. + RunContainer(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (id string, err error) + PullImage(ctx context.Context, image string) error + WaitContainerWithTimeout(id string, timeout time.Duration) (int, error) + RemoveContainerWithTimeout(id string, timeout time.Duration) error + ListContainersWithTimeout(running bool, timeout time.Duration) ([]types.Container, error) + RemoveDanglingImages() error +} + +func NewClient(endpoint string) (Client, error) { + d, err := client.NewClientWithOpts( + client.WithHost(endpoint), + client.WithAPIVersionNegotiation(), + ) + if err != nil { + return nil, fmt.Errorf("connect to the Docker daemon at %s", endpoint) + } + return &clientImpl{d}, nil +} + +type clientImpl struct { + client *client.Client +} + +func (c *clientImpl) listImages(timeout time.Duration) ([]image.Summary, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return c.client.ImageList(ctx, types.ImageListOptions{ + All: true, + Filters: filters.NewArgs( + filters.Arg("label", api.LabelImages), + filters.Arg("dangling", "true"), + ), + }) +} + +func (c *clientImpl) removeImage(id string, timeout time.Duration) error { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + _, err := c.client.ImageRemove(ctx, id, types.ImageRemoveOptions{ + PruneChildren: true, + }) + return err +} + +func (c *clientImpl) RemoveDanglingImages() error { + images, err := c.listImages(time.Second * 5) + if err != nil { + return fmt.Errorf("list images: %w", err) + } + for _, image := range images { + err = c.removeImage(image.ID, time.Second*20) + if err != nil { + return fmt.Errorf("remove image: %q: %w", image.ID, err) + } + } + return nil +} + +func (c *clientImpl) ListContainersWithTimeout(running bool, timeout time.Duration) ([]types.Container, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + args := filters.NewArgs(filters.Arg("label", api.LabelRepoName)) + var statuses []string + if running { + statuses = append(statuses, "running") + } else { + statuses = append(statuses, "exited", "created", "dead") + } + for _, status := range statuses { + args.Add("status", status) + } + + return c.client.ContainerList(ctx, container.ListOptions{ + All: true, + Filters: args, + }) +} + +func (c *clientImpl) RemoveContainerWithTimeout(id string, timeout time.Duration) error { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return c.client.ContainerRemove(ctx, id, container.RemoveOptions{ + RemoveVolumes: true, + Force: true, + }) +} + +func (c *clientImpl) WaitContainerWithTimeout(id string, timeout time.Duration) (int, error) { + ctx := context.Background() + if timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, timeout) + defer cancel() + } + stream, errCh := c.client.ContainerWait(ctx, id, container.WaitConditionNotRunning) + select { + case err := <-errCh: + return -1, err + case resp := <-stream: + return int(resp.StatusCode), nil + } +} + +func (c *clientImpl) PullImage(ctx context.Context, image string) error { + stream, err := c.client.ImagePull(ctx, image, types.ImagePullOptions{}) + if err != nil { + return fmt.Errorf("invoke ImagePull: %w", err) + } + defer stream.Close() + _, err = io.Copy(io.Discard, stream) + if err != nil { + return fmt.Errorf("read stream: %w", err) + } + return err +} + +func (c *clientImpl) RunContainer(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (string, error) { + ct, err := c.client.ContainerCreate(ctx, config, hostConfig, networkingConfig, nil, containerName) + if err != nil { + if errdefs.IsNotFound(err) { + err = c.PullImage(ctx, config.Image) + if err != nil { + return "", fmt.Errorf("pull image: %w", err) + } + ct, err = c.client.ContainerCreate(ctx, config, hostConfig, networkingConfig, nil, containerName) + } + if err != nil { + return "", fmt.Errorf("create container: %w", err) + } + } + + err = c.client.ContainerStart(ctx, ct.ID, container.StartOptions{}) + if err != nil { + return "", fmt.Errorf("start container: %w", err) + } + + return ct.ID, nil +} diff --git a/pkg/docker/fake/cli.go b/pkg/docker/fake/cli.go new file mode 100644 index 0000000..0ce4123 --- /dev/null +++ b/pkg/docker/fake/cli.go @@ -0,0 +1,88 @@ +package fake + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/errdefs" + + "github.com/ustclug/Yuki/pkg/docker" +) + +type Client struct { + mu sync.Mutex + containers map[string]types.Container +} + +func (f *Client) RunContainer(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (id string, err error) { + f.mu.Lock() + defer f.mu.Unlock() + _, ok := f.containers[containerName] + if ok { + return "", errdefs.Conflict(errors.New("container already exists")) + } + f.containers[containerName] = types.Container{ + ID: containerName, + Names: []string{containerName}, + Labels: config.Labels, + Status: "running", + } + return containerName, nil +} + +func (f *Client) PullImage(ctx context.Context, image string) error { + // TODO implement me + panic("implement me") +} + +func (f *Client) WaitContainerWithTimeout(id string, timeout time.Duration) (int, error) { + f.mu.Lock() + defer f.mu.Unlock() + + ct, ok := f.containers[id] + if !ok { + return 0, fmt.Errorf("container %s not found", id) + } + const delay = 5 * time.Second + if timeout > 0 && timeout < delay { + time.Sleep(timeout) + return 0, context.DeadlineExceeded + } + time.Sleep(delay) + ct.Status = "exited" + f.containers[id] = ct + return 0, nil +} + +func (f *Client) RemoveContainerWithTimeout(id string, timeout time.Duration) error { + f.mu.Lock() + defer f.mu.Unlock() + delete(f.containers, id) + return nil +} + +func (f *Client) ListContainersWithTimeout(running bool, timeout time.Duration) ([]types.Container, error) { + f.mu.Lock() + defer f.mu.Unlock() + l := make([]types.Container, 0, len(f.containers)) + for _, ct := range f.containers { + l = append(l, ct) + } + return l, nil +} + +func (f *Client) RemoveDanglingImages() error { + return nil +} + +func NewClient() docker.Client { + return &Client{ + containers: make(map[string]types.Container), + } +} diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go index 23aa401..9b4bb88 100644 --- a/pkg/fs/fs.go +++ b/pkg/fs/fs.go @@ -9,8 +9,6 @@ import ( "path" "strconv" "strings" - - "github.com/ustclug/Yuki/pkg/utils" ) // Type represents different kinds of file system. @@ -51,7 +49,7 @@ func (f *defaultFs) GetSize(d string) int64 { type zfs struct{} func (f *zfs) GetSize(d string) int64 { - if !utils.DirExists(d) { + if !dirExists(d) { return -1 } var buf bytes.Buffer @@ -73,7 +71,7 @@ func (f *zfs) GetSize(d string) int64 { type xfs struct{} func (f *xfs) GetSize(d string) int64 { - if !utils.DirExists(d) { + if !dirExists(d) { return -1 } @@ -89,11 +87,12 @@ func (f *xfs) GetSize(d string) int64 { scanner := bufio.NewScanner(&buf) scanner.Scan() fields := strings.Fields(scanner.Text()) - if len(fields) == 0 { + switch { + case len(fields) == 0: return -1 - } else if len(fields) >= 2 { + case len(fields) >= 2: kbs, err = strconv.ParseInt(fields[1], 10, 64) - } else { + default: scanner.Scan() fields = strings.Fields(scanner.Text()) kbs, err = strconv.ParseInt(fields[0], 10, 64) diff --git a/pkg/fs/utils.go b/pkg/fs/utils.go new file mode 100644 index 0000000..f7359ff --- /dev/null +++ b/pkg/fs/utils.go @@ -0,0 +1,14 @@ +package fs + +import ( + "os" +) + +// dirExists checks whether given path is an existing directory. +func dirExists(path string) bool { + stat, err := os.Stat(path) + if err != nil { + return false + } + return stat.IsDir() +} diff --git a/pkg/gpool/options.go b/pkg/gpool/options.go deleted file mode 100644 index 9af03dd..0000000 --- a/pkg/gpool/options.go +++ /dev/null @@ -1,19 +0,0 @@ -package gpool - -import ( - "time" -) - -type Option func(pool *poolImpl) - -func WithMaxWorkers(n int32) Option { - return func(pool *poolImpl) { - pool.maxWorkers = n - } -} - -func WithIdleTimeout(timeout time.Duration) Option { - return func(pool *poolImpl) { - pool.idleTimeout = timeout - } -} diff --git a/pkg/gpool/pool.go b/pkg/gpool/pool.go deleted file mode 100644 index 9d718bd..0000000 --- a/pkg/gpool/pool.go +++ /dev/null @@ -1,88 +0,0 @@ -package gpool - -import ( - "sync" - "time" -) - -type Job = func() - -type Pool interface { - Submit(job Job) - Workers() int32 -} - -type poolImpl struct { - maxWorkers int32 - idleTimeout time.Duration - stopCh <-chan struct{} - - mu sync.RWMutex - curWorkers int32 - jobQueue chan Job -} - -func (p *poolImpl) worker() { - for { - select { - case <-p.stopCh: - return - case job := <-p.jobQueue: - job() - case <-time.After(p.idleTimeout): - p.mu.RLock() - if p.curWorkers < 3 { - p.mu.RUnlock() - continue - } - p.mu.RUnlock() - - p.mu.Lock() - p.curWorkers-- - p.mu.Unlock() - return - } - } -} - -func (p *poolImpl) Workers() int32 { - p.mu.RLock() - n := p.curWorkers - p.mu.RUnlock() - return n -} - -func (p *poolImpl) Submit(job Job) { - for { - select { - case p.jobQueue <- job: - return - case <-time.After(time.Millisecond * 10): - p.mu.RLock() - if p.curWorkers < p.maxWorkers { - p.mu.RUnlock() - - p.mu.Lock() - p.curWorkers++ - p.mu.Unlock() - - go p.worker() - continue - } - p.mu.RUnlock() - } - } -} - -func New(stopCh <-chan struct{}, options ...Option) Pool { - p := &poolImpl{ - stopCh: stopCh, - maxWorkers: 5, - idleTimeout: time.Minute * 5, - jobQueue: make(chan Job), - } - for _, op := range options { - op(p) - } - return p -} diff --git a/pkg/gpool/pool_test.go b/pkg/gpool/pool_test.go deleted file mode 100644 index c853fd2..0000000 --- a/pkg/gpool/pool_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package gpool - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestPoolMaxWorkers(t *testing.T) { - as := assert.New(t) - stopCh := make(chan struct{}) - const n int32 = 5 - p := New(stopCh, WithMaxWorkers(n)) - for i := int32(0); i < n; i++ { - p.Submit(func() { - time.Sleep(time.Second * 1) - }) - } - p.Submit(func() { - time.Sleep(time.Second * 1) - }) - as.Equal(n, p.Workers()) - close(stopCh) -} - -func TestPoolIdleTimeout(t *testing.T) { - as := assert.New(t) - stopCh := make(chan struct{}) - const n int32 = 5 - p := New(stopCh, WithIdleTimeout(time.Second), WithMaxWorkers(n)) - - for i := int32(0); i < n; i++ { - p.Submit(func() { - time.Sleep(time.Millisecond * 50) - }) - } - time.Sleep(time.Millisecond * 1100) - as.Equal(int32(2), p.Workers()) - close(stopCh) -} diff --git a/pkg/info/info.go b/pkg/info/info.go new file mode 100644 index 0000000..7894ead --- /dev/null +++ b/pkg/info/info.go @@ -0,0 +1,20 @@ +package info + +import ( + "runtime" +) + +var ( + Version string + BuildDate string +) + +var VersionInfo = struct { + Version string + GoVersion string + BuildDate string +}{ + Version: Version, + BuildDate: BuildDate, + GoVersion: runtime.Version(), +} diff --git a/pkg/model/migrate.go b/pkg/model/migrate.go new file mode 100644 index 0000000..bc32b9c --- /dev/null +++ b/pkg/model/migrate.go @@ -0,0 +1,9 @@ +package model + +import ( + "gorm.io/gorm" +) + +func AutoMigrate(db *gorm.DB) error { + return db.AutoMigrate(&Repo{}, &RepoMeta{}) +} diff --git a/pkg/model/repo.go b/pkg/model/repo.go new file mode 100644 index 0000000..210c49d --- /dev/null +++ b/pkg/model/repo.go @@ -0,0 +1,36 @@ +package model + +type StringMap map[string]string + +// Repo represents a Repository. +type Repo struct { + Name string `gorm:"primaryKey" json:"name" validate:"required"` + // NOTE: the cron validator does not support */number syntax + Cron string `json:"cron" validate:"required"` + Image string `json:"image" validate:"required"` + StorageDir string `json:"storageDir" validate:"required,dir"` + User string `json:"user"` + BindIP string `json:"bindIP" validate:"omitempty,ip"` + Network string `json:"network"` + LogRotCycle int `json:"logRotCycle" validate:"min=0"` + Retry int `json:"retry" validate:"min=0"` + Envs StringMap `gorm:"type:text;serializer:json" json:"envs"` + Volumes StringMap `gorm:"type:text;serializer:json" json:"volumes"` + // sqlite3 does not have builtin datetime type + CreatedAt int64 `gorm:"autoCreateTime" json:"-"` + UpdatedAt int64 `gorm:"autoUpdateTime" json:"-"` +} + +// RepoMeta represents the metadata of a Repository. +type RepoMeta struct { + Name string `gorm:"primaryKey"` + Upstream string + Size int64 + ExitCode int + CreatedAt int64 `gorm:"autoCreateTime"` + UpdatedAt int64 `gorm:"autoUpdateTime"` + LastSuccess int64 + PrevRun int64 + NextRun int64 + Syncing bool +} diff --git a/pkg/server/config.go b/pkg/server/config.go index 268cfb1..148975d 100644 --- a/pkg/server/config.go +++ b/pkg/server/config.go @@ -4,121 +4,35 @@ import ( "fmt" "os" "time" - - "github.com/sirupsen/logrus" - "github.com/spf13/viper" - - "github.com/ustclug/Yuki/pkg/core" - "github.com/ustclug/Yuki/pkg/fs" ) -type AppConfig struct { - Debug bool `mapstructure:"debug,omitempty" validate:"-"` - // DbURL contains username and password - DbURL string `mapstructure:"db_url,omitempty" validate:"omitempty,mongodb"` - DbName string `mapstructure:"db_name,omitempty" validate:"omitempty,alpha"` - FileSystem string `mapstructure:"fs,omitempty" validate:"omitempty,eq=xfs|eq=zfs|eq=default"` - DockerEndpoint string `mapstructure:"docker_endpoint,omitempty" validate:"omitempty,unix_addr|tcp_addr"` - - Owner string `mapstructure:"owner,omitempty" validate:"-"` - LogDir string `mapstructure:"log_dir,omitempty" validate:"-"` - RepoConfigDir []string `mapstructure:"repo_config_dir,omitempty" validate:"required"` - LogLevel string `mapstructure:"log_level,omitempty" validate:"omitempty,eq=debug|eq=info|eq=warn|eq=error"` - ListenAddr string `mapstructure:"listen_addr,omitempty" validate:"omitempty,hostport"` - BindIP string `mapstructure:"bind_ip,omitempty" validate:"omitempty,ip"` - NamePrefix string `mapstructure:"name_prefix,omitempty" validate:"-"` - PostSync []string `mapstructure:"post_sync,omitempty" validate:"-"` - ImagesUpgradeInterval string `mapstructure:"images_upgrade_interval,omitempty" validate:"omitempty,cron"` - SyncTimeout time.Duration `mapstructure:"sync_timeout,omitempty" validate:"omitempty,gte=0"` - SeccompProfile string `mapstructure:"seccomp_profile,omitempty" validate:"-"` -} - type Config struct { - core.Config - Owner string - LogDir string - RepoConfigDir []string - LogLevel logrus.Level - ListenAddr string - BindIP string - NamePrefix string - PostSync []string - ImagesUpgradeInterval string - SyncTimeout time.Duration - SeccompProfile string + Debug bool `mapstructure:"debug"` + DbURL string `mapstructure:"db_url" validate:"required"` + FileSystem string `mapstructure:"fs" validate:"oneof=xfs zfs default"` + DockerEndpoint string `mapstructure:"docker_endpoint" validate:"unix_addr|tcp_addr"` + Owner string `mapstructure:"owner"` + LogFile string `mapstructure:"log_file" validate:"filepath"` + RepoLogsDir string `mapstructure:"repo_logs_dir" validate:"dir"` + RepoConfigDir []string `mapstructure:"repo_config_dir" validate:"required,dive,dir"` + LogLevel string `mapstructure:"log_level" validate:"oneof=debug info warn error"` + ListenAddr string `mapstructure:"listen_addr" validate:"hostname_port"` + BindIP string `mapstructure:"bind_ip" validate:"omitempty,ip"` + NamePrefix string `mapstructure:"name_prefix"` + PostSync []string `mapstructure:"post_sync"` + ImagesUpgradeInterval time.Duration `mapstructure:"images_upgrade_interval" validate:"min=0"` + SyncTimeout time.Duration `mapstructure:"sync_timeout" validate:"min=0"` + SeccompProfile string `mapstructure:"seccomp_profile" validate:"omitempty,filepath"` } -var ( - DefaultServerConfig = Config{ - Config: core.Config{ - Debug: false, - DbURL: "127.0.0.1:27017", - DbName: "mirror", - DockerEndpoint: "unix:///var/run/docker.sock", - }, - Owner: fmt.Sprintf("%d:%d", os.Getuid(), os.Getgid()), - LogDir: "/var/log/yuki/", - ListenAddr: "127.0.0.1:9999", - NamePrefix: "syncing-", - LogLevel: logrus.InfoLevel, - ImagesUpgradeInterval: "@every 1h", - SyncTimeout: 0, - SeccompProfile: "", - } -) - -func LoadConfig() (*Config, error) { - configValidator := NewValidator() - if err := viper.ReadInConfig(); err != nil { - return nil, err - } - appCfg := new(AppConfig) - if err := viper.Unmarshal(appCfg); err != nil { - return nil, err - } - if err := configValidator.Struct(appCfg); err != nil { - return nil, err - } - cfg := Config{ - Config: core.Config{ - Debug: appCfg.Debug, - DbURL: appCfg.DbURL, - DbName: appCfg.DbName, - DockerEndpoint: appCfg.DockerEndpoint, - }, - Owner: appCfg.Owner, - RepoConfigDir: appCfg.RepoConfigDir, - LogDir: appCfg.LogDir, - ListenAddr: appCfg.ListenAddr, - BindIP: appCfg.BindIP, - NamePrefix: appCfg.NamePrefix, - PostSync: appCfg.PostSync, - ImagesUpgradeInterval: appCfg.ImagesUpgradeInterval, - SyncTimeout: appCfg.SyncTimeout, - SeccompProfile: appCfg.SeccompProfile, - } - - switch appCfg.FileSystem { - case "zfs": - cfg.Config.GetSizer = fs.New(fs.ZFS) - case "xfs": - cfg.Config.GetSizer = fs.New(fs.XFS) - default: - cfg.Config.GetSizer = fs.New(fs.DEFAULT) - } - - switch appCfg.LogLevel { - case "debug": - cfg.LogLevel = logrus.DebugLevel - case "warn": - cfg.LogLevel = logrus.WarnLevel - case "error": - cfg.LogLevel = logrus.ErrorLevel - case "info": - fallthrough - default: - cfg.LogLevel = logrus.InfoLevel - } - - return &cfg, nil +var DefaultConfig = Config{ + FileSystem: "default", + DockerEndpoint: "unix:///var/run/docker.sock", + LogFile: "/dev/stderr", + Owner: fmt.Sprintf("%d:%d", os.Getuid(), os.Getgid()), + RepoLogsDir: "/var/log/yuki/", + ListenAddr: "127.0.0.1:9999", + NamePrefix: "syncing-", + LogLevel: "info", + ImagesUpgradeInterval: time.Hour, } diff --git a/pkg/server/config_test.go b/pkg/server/config_test.go index 6fb803c..b6dfa8c 100644 --- a/pkg/server/config_test.go +++ b/pkg/server/config_test.go @@ -1,29 +1,28 @@ package server import ( + "os" "testing" "time" - "github.com/spf13/viper" -) + "github.com/stretchr/testify/require" -func TestDefaultTimeoutConfig(t *testing.T) { - viper.Reset() - viper.SetConfigFile("../../dist/daemon.toml") - _, err := LoadConfig() - if err != nil { - t.Fatal(err) - } -} + testutils "github.com/ustclug/Yuki/test/utils" +) -func TestSyncTimeoutConfig(t *testing.T) { - viper.Reset() - viper.SetConfigFile("../../test/fixtures/sync_timeout.toml") - config, err := LoadConfig() - if err != nil { - t.Fatal(err) - } - if config.SyncTimeout != time.Second*15 { - t.Fatalf("Expected SyncTimeout to be 15s, got %s", config.SyncTimeout) - } +func TestLoadConfig(t *testing.T) { + tmp, err := os.CreateTemp("", "TestLoadConfig*.toml") + require.NoError(t, err) + defer os.Remove(tmp.Name()) + defer tmp.Close() + testutils.WriteFile(t, tmp.Name(), ` +db_url = ":memory:" +repo_logs_dir = "/tmp" +repo_config_dir = "/tmp" +sync_timeout = "15s" +`) + srv, err := New(tmp.Name()) + require.NoError(t, err) + require.EqualValues(t, time.Second*15, srv.config.SyncTimeout) + require.EqualValues(t, "/tmp", srv.config.RepoConfigDir[0]) } diff --git a/pkg/server/flushwriter.go b/pkg/server/flushwriter.go deleted file mode 100644 index 9432596..0000000 --- a/pkg/server/flushwriter.go +++ /dev/null @@ -1,28 +0,0 @@ -package server - -import ( - "io" -) - -type flushWriter struct { - w FlushWriter -} - -type FlushWriter interface { - io.Writer - Flush() -} - -func (f *flushWriter) Flush() { - f.w.Flush() -} - -func (f *flushWriter) Write(p []byte) (n int, err error) { - n, err = f.w.Write(p) - f.w.Flush() - return n, err -} - -func NewFlushWriter(w FlushWriter) FlushWriter { - return &flushWriter{w} -} diff --git a/pkg/server/handlers.go b/pkg/server/handlers.go deleted file mode 100644 index ba190e8..0000000 --- a/pkg/server/handlers.go +++ /dev/null @@ -1,462 +0,0 @@ -package server - -import ( - "compress/gzip" - "context" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "path" - "path/filepath" - "sort" - "strconv" - "strings" - "time" - - "github.com/docker/docker/errdefs" - "github.com/globalsign/mgo" - "github.com/globalsign/mgo/bson" - "github.com/labstack/echo/v4" - "github.com/sirupsen/logrus" - "sigs.k8s.io/yaml" - - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/core" - "github.com/ustclug/Yuki/pkg/tail" -) - -func badRequest(msg interface{}) error { - return &echo.HTTPError{ - Code: http.StatusBadRequest, - Message: msg, - } -} - -func notFound(msg interface{}) error { - return &echo.HTTPError{ - Code: http.StatusNotFound, - Message: msg, - } -} - -func conflict(msg interface{}) error { - return &echo.HTTPError{ - Code: http.StatusConflict, - Message: msg, - } -} - -func (s *Server) registerAPIs(g *echo.Group) { - // public APIs - g.GET("metas", s.listMetas) - g.GET("metas/:name", s.getMeta) - - // private APIs - g.GET("repositories", s.listRepos) - g.POST("repositories", s.reloadAllRepos) - g.GET("repositories/:name", s.getRepo) - g.POST("repositories/:name", s.reloadRepo) - g.DELETE("repositories/:name", s.removeRepo) - g.GET("repositories/:name/logs", s.getRepoLogs) - - g.GET("containers", s.listCts) - g.POST("containers/:name", s.sync) - g.DELETE("containers/:name", s.removeCt) - g.GET("containers/:name/logs", s.getCtLogs) - - g.GET("config", s.exportConfig) -} - -func (s *Server) listRepos(c echo.Context) error { - var repos []api.RepoSummary - _ = s.c.FindRepository(nil).Select(bson.M{ - "interval": 1, - "image": 1, - "storageDir": 1, - }).Sort("_id").All(&repos) - return c.JSON(http.StatusOK, repos) -} - -func (s *Server) getRepo(c echo.Context) error { - name := c.Param("name") - repo, err := s.c.GetRepository(name) - if err != nil { - return notFound(err) - } - return c.JSON(http.StatusOK, repo) -} - -func (s *Server) getRepoLogs(c echo.Context) error { - type repoLogsOptions struct { - N int `query:"n"` - Tail int `query:"tail"` - Stats bool `query:"stats"` - } - - opts := repoLogsOptions{} - if err := c.Bind(&opts); err != nil { - return badRequest(err) - } - - logdir := path.Join(s.config.LogDir, c.Param("name")) - if err := os.MkdirAll(logdir, os.ModePerm); err != nil { - return fmt.Errorf("not a directory: %s", logdir) - } - - files, err := ioutil.ReadDir(logdir) - if err != nil { - return err - } - - if opts.Stats { - var infos []api.LogFileStat - for _, f := range files { - name := f.Name() - if !strings.HasPrefix(name, "result.log.") { - continue - } - infos = append(infos, api.LogFileStat{ - Name: name, - Size: f.Size(), - Mtime: f.ModTime(), - }) - } - sort.Slice(infos, func(i, j int) bool { - return infos[j].Mtime.After(infos[i].Mtime) - }) - return c.JSON(http.StatusOK, infos) - } - - if opts.Tail < 0 { - opts.Tail = 0 - } - - wantedName := fmt.Sprintf("result.log.%d", opts.N) - fileName := "" - for _, f := range files { - realName := f.Name() - if realName == wantedName || (realName == wantedName+".gz") { - // result.log.0 - // result.log.1.gz - // result.log.2.gz - // result.log.10.gz - fileName = realName - break - } - } - - if len(fileName) == 0 { - return notFound(fmt.Sprintf("no such file: %s", wantedName)) - } - - content, err := os.Open(path.Join(logdir, fileName)) - if err != nil { - return err - } - defer content.Close() - - var t *tail.Tail - - switch path.Ext(fileName) { - case ".gz": - gr, err := gzip.NewReader(content) - if err != nil { - return err - } - defer gr.Close() - tmpfile, err := ioutil.TempFile(logdir, "extracted") - if err != nil { - return err - } - defer os.Remove(tmpfile.Name()) - defer tmpfile.Close() - _, err = io.Copy(tmpfile, gr) - if err != nil { - return err - } - _, err = tmpfile.Seek(0, io.SeekStart) - if err != nil { - return err - } - t = tail.New(tmpfile, opts.Tail) - default: - t = tail.New(content, opts.Tail) - } - - _, err = t.WriteTo(c.Response()) - return err -} - -func (s *Server) removeRepo(c echo.Context) error { - name := c.Param("name") - if err := s.c.RemoveRepository(name); err != nil { - return err - } - _ = s.c.RemoveMeta(name) - return c.NoContent(http.StatusNoContent) -} - -func (s *Server) listCts(c echo.Context) error { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - apiCts, err := s.c.ListContainers(ctx, map[string][]string{ - "label": {"org.ustcmirror.syncing=true"}, - }) - if err != nil { - return err - } - cts := make([]api.ContainerDetail, 0, len(apiCts)) - for _, ct := range apiCts { - cts = append(cts, api.ContainerDetail{ - ID: ct.ID[:10], - Image: ct.Image, - Created: ct.Created, - State: ct.State, - Status: ct.Status, - Name: strings.TrimLeft(ct.Names[0], "/"), - }) - } - return c.JSON(http.StatusOK, cts) -} - -func (s *Server) sync(c echo.Context) error { - name := c.Param("name") - debug, err := strconv.ParseBool(c.QueryParam("debug")) - if err != nil { - debug = false - } - - logrus.Infof("Syncing %s", name) - ct, err := s.c.Sync(s.context(), core.SyncOptions{ - Name: name, - NamePrefix: s.config.NamePrefix, - LogDir: s.config.LogDir, - DefaultOwner: s.config.Owner, - MountDir: true, - Debug: debug, - DefaultBindIP: s.config.BindIP, - }) - if err != nil { - if errdefs.IsConflict(err) { - return conflict(err) - } - return err - } - go func() { - err := s.waitForSync(ct) - if err != nil { - logrus.Warningf("waitForSync: %s", err) - } - }() - return c.NoContent(http.StatusCreated) -} - -func (s *Server) getCtID(name string) string { - if s.cron.HasJob(name) { - // repo name - return s.config.NamePrefix + name - } - // container ID - return name -} - -func (s *Server) getCtLogs(c echo.Context) error { - type logsOptions struct { - Follow bool `query:"follow"` - Tail string `query:"tail"` - } - id := s.getCtID(c.Param("name")) - var opts logsOptions - if err := c.Bind(&opts); err != nil { - return badRequest(err) - } - fw := NewFlushWriter(c.Response()) - return s.c.GetContainerLogs(c.Request().Context(), core.LogsOptions{ - ID: id, - Stream: fw, - Tail: opts.Tail, - Follow: opts.Follow, - }) -} - -func (s *Server) removeCt(c echo.Context) error { - id := s.getCtID(c.Param("name")) - ctx, cancel := s.contextWithTimeout(time.Second * 10) - _ = s.c.StopContainer(ctx, id) - cancel() - ctx, cancel = s.contextWithTimeout(time.Second * 10) - _ = s.c.RemoveContainer(ctx, id) - cancel() - return c.NoContent(http.StatusNoContent) -} - -func (s *Server) updateSyncStatus(m *api.Meta) { - _, ok := s.syncStatus.Load(m.Name) - m.Syncing = ok -} - -func (s *Server) listMetas(c echo.Context) error { - ms := s.c.ListAllMetas() - jobs := s.cron.Jobs() - for i := 0; i < len(ms); i++ { - job, ok := jobs[ms[i].Name] - if ok { - ms[i].NextRun = job.Next.Unix() - } - s.updateSyncStatus(&ms[i]) - } - return c.JSON(http.StatusOK, ms) -} - -func (s *Server) getMeta(c echo.Context) error { - name := c.Param("name") - m, err := s.c.GetMeta(name) - if err != nil { - return notFound(err) - } - s.updateSyncStatus(m) - jobs := s.cron.Jobs() - job, ok := jobs[m.Name] - if ok { - m.NextRun = job.Next.Unix() - } - return c.JSON(http.StatusOK, m) -} - -func (s *Server) exportConfig(c echo.Context) error { - var query bson.M - names := c.QueryParam("names") - if names != "" { - nameLst := strings.Split(names, ",") - query = bson.M{ - "_id": bson.M{"$in": nameLst}, - } - } - var repos []api.Repository - _ = s.c.FindRepository(query).Select(bson.M{"updatedAt": 0, "createdAt": 0}).Sort("_id").All(&repos) - return c.JSON(http.StatusOK, repos) -} - -func (s *Server) loadRepo(dirs []string, file string) (*api.Repository, error) { - var repo api.Repository - errn := len(dirs) - for _, dir := range dirs { - data, err := ioutil.ReadFile(filepath.Join(dir, file)) - if err != nil { - errn-- - if errn > 0 && os.IsNotExist(err) { - continue - } else { - return nil, badRequest(err) - } - } - err = yaml.Unmarshal(data, &repo) - if err != nil { - return nil, badRequest(err) - } - } - if err := s.e.Validator.Validate(&repo); err != nil { - return nil, badRequest(err) - } - err := s.c.RemoveRepository(repo.Name) - if err != nil && err != mgo.ErrNotFound { - return nil, err - } - err = s.c.AddRepository(repo) - if err != nil { - return nil, err - } - err = s.cron.AddJob(repo.Name, repo.Interval, s.newJob(repo.Name)) - if err != nil { - return nil, err - } - _ = s.c.UpsertRepoMeta(repo.Name, repo.StorageDir, -1) - return &repo, nil -} - -func (s *Server) reloadRepo(c echo.Context) error { - name := c.Param("name") - _, err := s.loadRepo(s.config.RepoConfigDir, name+".yaml") - if err != nil { - return err - } - return c.NoContent(http.StatusNoContent) -} - -func (s *Server) reloadAllRepos(c echo.Context) error { - repos := s.c.ListAllRepositories() - toDelete := map[string]struct{}{} - for _, r := range repos { - toDelete[r.Name] = struct{}{} - } - for _, dir := range s.config.RepoConfigDir { - infos, err := ioutil.ReadDir(dir) - if err != nil { - return err - } - for _, info := range infos { - fileName := info.Name() - if info.IsDir() || fileName[0] == '.' || !strings.HasSuffix(fileName, ".yaml") { - continue - } - repo, err := s.loadRepo(s.config.RepoConfigDir, fileName) - if err != nil { - return err - } - delete(toDelete, repo.Name) - } - - } - for name := range toDelete { - err := s.c.RemoveRepository(name) - if err != nil { - logrus.WithField("repo", name).Errorf("remove repository: %s", err) - } - _ = s.c.RemoveMeta(name) - s.cron.RemoveJob(name) - } - return c.NoContent(http.StatusNoContent) -} - -func (s *Server) httpErrorHandler(err error, c echo.Context) { - var ( - code = http.StatusInternalServerError - msg string - respMsg echo.Map - ) - - if he, ok := err.(*echo.HTTPError); ok { - code = he.Code - msg = fmt.Sprintf("%v", he.Message) - if he.Internal != nil { - msg = fmt.Sprintf("%v, %v", err, he.Internal) - } - } else { - msg = err.Error() - } - respMsg = echo.Map{"message": msg} - - logrus.WithFields(logrus.Fields{ - "remote_ip": c.RealIP(), - "status": code, - "method": c.Request().Method, - "uri": c.Request().RequestURI, - }).Error(msg) - - // Send response - if !c.Response().Committed { - if c.Request().Method == echo.HEAD { // Issue echo#608 - err = c.NoContent(code) - } else { - err = c.JSON(code, respMsg) - } - if err != nil { - logrus.WithFields(logrus.Fields{ - "method": c.Request().Method, - "uri": c.Request().RequestURI, - }).Errorln(err) - } - } -} diff --git a/pkg/server/handlers_test.go b/pkg/server/handlers_test.go deleted file mode 100644 index 50e9ecc..0000000 --- a/pkg/server/handlers_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package server - -import ( - "context" - "testing" - - "github.com/spf13/viper" - "github.com/stretchr/testify/require" -) - -func TestRepoLoad(t *testing.T) { - req := require.New(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - viper.Reset() - viper.SetConfigFile("../../test/fixtures/sync_timeout.toml") - - prefix := "syncing-" - name := "yuki-reload-test-sync-repo" - d := "/tmp/" + name - server, err := getTestingServer(ctx, prefix, name, d) - req.Nil(err) - - repo, err := server.loadRepo([]string{"../../test/fixtures/repo/"}, "test.yaml") - req.Nil(err) - - req.Equal("test", repo.Name) - req.Equal("cernet", repo.Network) -} diff --git a/pkg/server/main.go b/pkg/server/main.go index 32820ac..57c733d 100644 --- a/pkg/server/main.go +++ b/pkg/server/main.go @@ -4,435 +4,207 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" + "log/slog" + "net/http" "os" - "os/exec" - "path" - "reflect" - "sync" - "time" - "github.com/docker/docker/api/types" - "github.com/docker/docker/errdefs" + "github.com/go-playground/validator/v10" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" - "github.com/sirupsen/logrus" + cmap "github.com/orcaman/concurrent-map/v2" + "github.com/robfig/cron/v3" "github.com/spf13/viper" + "gorm.io/driver/sqlite" + "gorm.io/gorm" - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/core" - "github.com/ustclug/Yuki/pkg/cron" - "github.com/ustclug/Yuki/pkg/gpool" + "github.com/ustclug/Yuki/pkg/docker" + "github.com/ustclug/Yuki/pkg/fs" + "github.com/ustclug/Yuki/pkg/model" ) type Server struct { - e *echo.Echo - c *core.Core - ctx context.Context - syncStatus sync.Map - gpool gpool.Pool - config *Config - cron *cron.Cron - quit chan struct{} - preSyncCh chan api.PreSyncPayload - postSyncCh chan api.PostSyncPayload -} + repoSchedules cmap.ConcurrentMap[string, cron.Schedule] -func init() { - viper.SetEnvPrefix("YUKI") - viper.SetConfigFile("/etc/yuki/daemon.toml") + e *echo.Echo + dockerCli docker.Client + config Config + db *gorm.DB + logger *slog.Logger + getSize func(string) int64 } -func New() (*Server, error) { - cfg, err := LoadConfig() +func New(configPath string) (*Server, error) { + v := viper.New() + v.SetConfigFile(configPath) + err := v.ReadInConfig() if err != nil { return nil, err } - return NewWithConfig(cfg) -} - -type varAndDefVal struct { - Var interface{} - DefVal interface{} -} - -func setDefault(us []varAndDefVal) { - for _, u := range us { - val := reflect.ValueOf(u.Var) - dstType := val.Type().Elem() - dstVal := reflect.Indirect(val) - if reflect.DeepEqual(dstVal.Interface(), reflect.Zero(dstType).Interface()) { - dstVal.Set(reflect.ValueOf(u.DefVal)) - } + cfg := DefaultConfig + if err := v.Unmarshal(&cfg); err != nil { + return nil, err + } + validate := validator.New() + if err := validate.Struct(&cfg); err != nil { + return nil, err } + return NewWithConfig(cfg) } -func NewWithConfig(cfg *Config) (*Server, error) { - setDefault([]varAndDefVal{ - {&cfg.DbURL, DefaultServerConfig.DbURL}, - {&cfg.DbName, DefaultServerConfig.DbName}, - {&cfg.DockerEndpoint, DefaultServerConfig.DockerEndpoint}, - - {&cfg.Owner, DefaultServerConfig.Owner}, - {&cfg.LogDir, DefaultServerConfig.LogDir}, - {&cfg.ListenAddr, DefaultServerConfig.ListenAddr}, - {&cfg.NamePrefix, DefaultServerConfig.NamePrefix}, - {&cfg.ImagesUpgradeInterval, DefaultServerConfig.ImagesUpgradeInterval}, +func NewWithConfig(cfg Config) (*Server, error) { + // TODO: enforce shared cache mode? + db, err := gorm.Open(sqlite.Open(cfg.DbURL), &gorm.Config{ + QueryFields: true, + SkipDefaultTransaction: true, }) - - if err := os.MkdirAll(cfg.LogDir, os.ModePerm); err != nil { - return nil, err - } - for _, dir := range cfg.RepoConfigDir { - if err := os.MkdirAll(dir, os.ModePerm); err != nil { - return nil, err - } - } - coreCfg := core.Config{ - Debug: cfg.Debug, - DbURL: cfg.DbURL, - DbName: cfg.DbName, - GetSizer: cfg.GetSizer, - DockerEndpoint: cfg.DockerEndpoint, - } - c, err := core.NewWithConfig(coreCfg) if err != nil { - return nil, err + return nil, fmt.Errorf("open db: %w", err) } - stopCh := make(chan struct{}) - s := Server{ - c: c, - e: echo.New(), - cron: cron.New(), - config: cfg, - gpool: gpool.New(stopCh, gpool.WithMaxWorkers(5)), - quit: stopCh, - preSyncCh: make(chan api.PreSyncPayload), - postSyncCh: make(chan api.PostSyncPayload), - } - - s.e.Validator = &myValidator{NewValidator()} - s.e.Debug = cfg.Debug - s.e.HideBanner = true - s.e.HTTPErrorHandler = s.httpErrorHandler - s.e.Logger.SetOutput(ioutil.Discard) - logfile, err := os.OpenFile(path.Join(cfg.LogDir, "yukid.log"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + dockerCli, err := docker.NewClient(cfg.DockerEndpoint) if err != nil { return nil, err } - logrus.SetLevel(cfg.LogLevel) - logrus.SetReportCaller(cfg.Debug) - logrus.SetFormatter(new(logrus.TextFormatter)) - logrus.SetOutput(logfile) - - // middlewares - s.e.Use(middleware.BodyLimit("2M")) - g := s.e.Group("/api/v1/") - s.registerAPIs(g) - - return &s, nil -} - -func (s *Server) schedRepos() { - repos := s.c.ListAllRepositories() - logrus.Infof("Scheduling %d repositories", len(repos)) - for _, r := range repos { - if err := s.cron.AddJob(r.Name, r.Interval, s.newJob(r.Name)); err != nil { - logrus.WithField("repo", r.Name).Errorln(err) - } + // workaround a systemd bug. + // See also https://github.com/ustclug/Yuki/issues/4 + logfile, err := os.OpenFile(cfg.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + return nil, err } -} -func (s *Server) newJob(name string) cron.FuncJob { - return func() { - ct, err := s.c.Sync(s.context(), core.SyncOptions{ - LogDir: s.config.LogDir, - DefaultOwner: s.config.Owner, - NamePrefix: s.config.NamePrefix, - Name: name, - MountDir: true, - DefaultBindIP: s.config.BindIP, - SeccompProfile: s.config.SeccompProfile, - }) - entry := logrus.WithField("repo", name) - if err != nil { - if errdefs.IsConflict(err) { - entry.Warningln(err) - } else { - entry.Errorln(err) - } - return - } - logrus.Infof("Syncing %s", name) - if err := s.waitForSync(ct); err != nil { - entry.Warningln(err) - } + var logLvl slog.Level + switch cfg.LogLevel { + case "debug": + logLvl = slog.LevelDebug + case "warn": + logLvl = slog.LevelWarn + case "error": + logLvl = slog.LevelError + default: + logLvl = slog.LevelInfo } -} -func (s *Server) Start(ctx context.Context) { - s.ctx = ctx + slogger := newSlogger(logfile, cfg.Debug, logLvl) - logrus.Infof("Listening at %s", s.config.ListenAddr) - go func() { - if err := s.e.Start(s.config.ListenAddr); err != nil { - logrus.Warnf("Shutting down the server: %v", err) - } - }() - - go s.onPreSync() - go s.onPostSync() + s := Server{ + e: echo.New(), + db: db, + logger: slogger, + dockerCli: dockerCli, + config: cfg, + repoSchedules: cmap.New[cron.Schedule](), + } + switch cfg.FileSystem { + case "zfs": + s.getSize = fs.New(fs.ZFS).GetSize + case "xfs": + s.getSize = fs.New(fs.XFS).GetSize + default: + s.getSize = fs.New(fs.DEFAULT).GetSize + } + + validate := validator.New() + s.e.Validator = echoValidator(validate.Struct) + s.e.Debug = cfg.Debug + s.e.HideBanner = true + s.e.Logger.SetOutput(io.Discard) + + // Middlewares. + // The order matters. + s.e.Use(middleware.RequestID()) + s.e.Use(setLogger(slogger)) + s.e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{ + LogStatus: true, + LogLatency: true, + LogUserAgent: true, + LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error { + attrs := []slog.Attr{ + slog.Int("status", v.Status), + slog.String("user_agent", v.UserAgent), + slog.Duration("latency", v.Latency), + } + l := getLogger(c) + l.LogAttrs(context.Background(), slog.LevelDebug, "REQUEST", attrs...) + return nil + }, + })) - s.cleanDeadContainers() + s.registerAPIs(s.e) - s.waitRunningContainers() + return &s, nil +} - s.schedRepos() - s.c.InitMetas() +func (s *Server) Start(rootCtx context.Context) error { + l := s.logger + ctx, cancel := context.WithCancelCause(rootCtx) + defer cancel(context.Canceled) - err := s.cron.AddFunc(s.config.ImagesUpgradeInterval, func() { - logrus.Info("Upgrading images") - s.upgradeImages() - logrus.Info("Cleaning images") - s.cleanImages() - }) + l.Info("Initializing database") + err := model.AutoMigrate(s.db) if err != nil { - logrus.Fatalf("cron.AddFunc: %s", err) + return fmt.Errorf("init db: %w", err) } - go func() { - ticker := time.NewTicker(time.Second * 20) - fail := 0 - const threshold int = 3 - for range ticker.C { - if err := s.c.PingMongoSession(); err != nil { - fail++ - if fail > threshold { - logrus.Errorln("Failed to connect to MongoDB, exit...") - close(s.quit) - return - } - logrus.Warnf("Failed to connect to MongoDB: %d", fail) - } else if fail != 0 { - logrus.Warnln("Reconnected to MongoDB") - fail = 0 - } - } - }() - - select { - case <-ctx.Done(): - close(s.quit) - case <-s.quit: + l.Info("Initializing repo metas") + err = s.initRepoMetas() + if err != nil { + return fmt.Errorf("init meta: %w", err) } - s.teardown() -} -func (s *Server) teardown() { - s.c.CloseMongoSession() - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - if err := s.e.Shutdown(ctx); err != nil { - logrus.Warningln(err) - } -} - -func (s *Server) context() context.Context { - return s.ctx -} - -func (s *Server) contextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc) { - return context.WithTimeout(s.ctx, timeout) -} - -func (s *Server) upgradeImages() { - var images []string - err := s.c.FindRepository(nil).Distinct("image", &images) + l.Info("Cleaning dead containers") + err = s.cleanDeadContainers() if err != nil { - return + return fmt.Errorf("clean dead containers: %w", err) } - var wg sync.WaitGroup - wg.Add(len(images)) - for _, i := range images { - img := i - s.gpool.Submit(func() { - ctx, cancel := s.contextWithTimeout(time.Minute * 5) - err := s.c.PullImage(ctx, img) - cancel() - wg.Done() - if err != nil { - logrus.Warningf("pullImage: %s", err) - } - }) - } - wg.Wait() -} -func (s *Server) cleanImages() { - ctx, cancel := s.contextWithTimeout(time.Second * 5) - defer cancel() - imgs, err := s.c.ListImages(ctx, map[string][]string{ - "label": {"org.ustcmirror.images=true"}, - "dangling": {"true"}, - }) + l.Info("Waiting running containers") + err = s.waitRunningContainers() if err != nil { - logrus.Warningf("listImages: %s", err) - return + return fmt.Errorf("wait running containers: %w", err) } - for _, i := range imgs { - ctx, cancel := s.contextWithTimeout(time.Second * 5) - err := s.c.RemoveImage(ctx, i.ID) - cancel() - if err != nil { - logrus.Warningf("removeImage: %s", err) - } - } -} -func (s *Server) onPreSync() { - for { - select { - case <-s.quit: - return - case data := <-s.preSyncCh: - err := s.c.UpdatePrevRun(data.Name) - if err != nil { - logrus.WithField("repo", data.Name).Errorf("failed to update prevRun: %s", err) - } - s.syncStatus.Store(data.Name, struct{}{}) - } - } -} + l.Info("Scheduling tasks") + s.scheduleTasks(ctx) -func (s *Server) onPostSync() { - cmds := s.config.PostSync - for { - select { - case <-s.quit: - return - case data := <-s.postSyncCh: - s.syncStatus.Delete(data.Name) - ctx, cancel := s.contextWithTimeout(time.Second * 20) - err := s.c.RemoveContainer(ctx, data.ID) - cancel() - entry := logrus.WithField("repo", data.Name) - if err != nil { - entry.Errorf("failed to remove container: %s", err) - } - err = s.c.UpsertRepoMeta(data.Name, data.Dir, data.ExitCode) - if err != nil { - entry.Errorf("failed to upsert repo meta: %s", err) - } - envs := []string{ - fmt.Sprintf("ID=%s", data.ID), - fmt.Sprintf("Name=%s", data.Name), - fmt.Sprintf("Dir=%s", data.Dir), - fmt.Sprintf("ExitCode=%d", data.ExitCode), - } - go func() { - for _, cmd := range cmds { - prog := exec.Command("sh", "-c", cmd) - prog.Env = envs - if err := prog.Run(); err != nil { - logrus.WithFields(logrus.Fields{ - "command": cmd, - }).Errorln(err) - } - } - }() + go func() { + l.Info("Running HTTP server", slog.String("addr", s.config.ListenAddr)) + if err := s.e.Start(s.config.ListenAddr); err != nil && !errors.Is(err, http.ErrServerClosed) { + l.Error("Fail to run HTTP server", slogErrAttr(err)) + cancel(err) } - } -} + }() -// cleanDeadContainers removes containers which status are `created`, `exited` or `dead`. -func (s *Server) cleanDeadContainers() { - logrus.Info("Cleaning dead containers") + <-ctx.Done() + l.Info("Shutting down HTTP server") + _ = s.e.Shutdown(context.Background()) - ctx, cancel := context.WithTimeout(context.TODO(), time.Second*10) - defer cancel() - cts, err := s.c.ListContainers(ctx, map[string][]string{ - "label": {"org.ustcmirror.syncing=true"}, - "status": {"created", "exited", "dead"}, - }) - if err != nil { - logrus.Errorf("listContainers: %s", err) - return - } - for _, ct := range cts { - ctx, cancel := s.contextWithTimeout(time.Second * 20) - err := s.c.RemoveContainer(ctx, ct.ID) - cancel() - if err != nil { - logrus.WithField("container", ct.Names[0]).Errorf("removeContainer: %s", err) - } + caused := context.Cause(ctx) + if errors.Is(caused, context.Canceled) { + return nil } + return caused } -// waitRunningContainers waits for all syncing containers to stop and remove them. -func (s *Server) waitRunningContainers() { - cts, err := s.c.ListContainers(context.Background(), map[string][]string{ - "label": {"org.ustcmirror.syncing=true"}, - "status": {"running"}, - }) - if err != nil { - logrus.Errorf("listContainers: %s", err) - return - } - for _, ct := range cts { - go func(ct types.Container) { - if err := s.waitForSync(&api.Container{ - ID: ct.ID, - Labels: ct.Labels, - }); err != nil { - logrus.WithField("container", ct.Names[0]).Warningf("waitForSync: %s", err) - } - }(ct) - } +// ListenAddr returns the actual address the server is listening on. +// It is useful when the server is configured to listen on a random port. +func (s *Server) ListenAddr() string { + return s.e.Listener.Addr().String() } -// waitForSync emits `SyncStart` event at first, then blocks until the container stops and emits the `SyncEnd` event. -func (s *Server) waitForSync(ct *api.Container) error { - s.preSyncCh <- api.PreSyncPayload{ - Name: ct.Labels["org.ustcmirror.name"], - } - - ctx := s.context() - if s.config.SyncTimeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, s.config.SyncTimeout) - defer cancel() - } - - code, err := s.c.WaitContainer(ctx, ct.ID) - if err != nil { - if !errors.Is(ctx.Err(), context.DeadlineExceeded) { - return err - } else { - // When the error is timeout, we expect that - // container will be stopped and removed in onPostSync() goroutine - // Here we set a special exit code to indicate that the container is timeout in meta. - code = -2 - } - } +func (s *Server) registerAPIs(e *echo.Echo) { + v1API := e.Group("/api/v1/") - name, ok := ct.Labels["org.ustcmirror.name"] - if !ok { - return fmt.Errorf("missing label: org.ustcmirror.name") - } - dir, ok := ct.Labels["org.ustcmirror.storage-dir"] - if !ok { - return fmt.Errorf("missing label: org.ustcmirror.storage-dir") - } + // public APIs + v1API.GET("metas", s.handlerListRepoMetas) + v1API.GET("metas/:name", s.handlerGetRepoMeta) - s.postSyncCh <- api.PostSyncPayload{ - ID: ct.ID, - Name: name, - Dir: dir, - ExitCode: code, - } - // returns context.DeadlineExceeded when timeout - // or nil when it succeeded - return err + // private APIs + v1API.GET("repos", s.handlerListRepos) + v1API.GET("repos/:name", s.handlerGetRepo) + v1API.DELETE("repos/:name", s.handlerRemoveRepo) + v1API.POST("repos/:name", s.handlerReloadRepo) + v1API.POST("repos", s.handlerReloadAllRepos) + v1API.POST("repos/:name/sync", s.handlerSyncRepo) } diff --git a/pkg/server/main_test.go b/pkg/server/main_test.go index c019ed9..11a575f 100644 --- a/pkg/server/main_test.go +++ b/pkg/server/main_test.go @@ -2,77 +2,97 @@ package server import ( "context" + "crypto/rand" + "encoding/base64" + "log/slog" + "net/http/httptest" "os" "testing" - "github.com/spf13/viper" - "github.com/stretchr/testify/assert" + "github.com/go-playground/validator/v10" + "github.com/go-resty/resty/v2" + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" + cmap "github.com/orcaman/concurrent-map/v2" + "github.com/robfig/cron/v3" "github.com/stretchr/testify/require" - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/core" -) - -func getTestingServer(ctx context.Context, prefix string, name string, storageDir string) (*Server, error) { - s, err := New() - if err != nil { - return nil, err - } - - defer os.RemoveAll("/tmp/log_yuki") - defer os.RemoveAll("/tmp/config_yuki") + "gorm.io/driver/sqlite" + "gorm.io/gorm" - err = os.MkdirAll(storageDir, os.ModePerm) - if err != nil { - return nil, err - } - defer os.RemoveAll(storageDir) - // remove existing repository and container - _ = s.c.RemoveRepository(name) - _ = s.c.RemoveContainer(ctx, prefix+name) - - s.ctx = ctx - go s.onPreSync() - go s.onPostSync() + fakedocker "github.com/ustclug/Yuki/pkg/docker/fake" + "github.com/ustclug/Yuki/pkg/fs" + "github.com/ustclug/Yuki/pkg/model" +) - return s, nil +type TestEnv struct { + t *testing.T + httpSrv *httptest.Server + server *Server } -func TestWaitForSync(t *testing.T) { - as := assert.New(t) - req := require.New(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() +func (t *TestEnv) RESTClient() *resty.Client { + return resty.New().SetBaseURL(t.httpSrv.URL + "/api/v1") +} - viper.Reset() - viper.SetConfigFile("../../test/fixtures/sync_timeout.toml") +func (t *TestEnv) RandomString() string { + var buf [6]byte + _, _ = rand.Read(buf[:]) + suffix := base64.RawURLEncoding.EncodeToString(buf[:]) + return t.t.Name() + suffix +} - prefix := "syncing-" - name := "yuki-wait-test-sync-repo" - d := "/tmp/" + name - cycle := 10 +func NewTestEnv(t *testing.T) *TestEnv { + slogger := newSlogger(os.Stderr, true, slog.LevelInfo) - s, err := getTestingServer(ctx, prefix, name, d) - req.Nil(err) + e := echo.New() + e.HideBanner = true + e.HidePort = true + v := validator.New() + e.Validator = echoValidator(v.Struct) - err = s.c.AddRepository(api.Repository{ - Name: name, - Interval: "1 * * * *", - Image: "ustcmirror/test:latest", - StorageDir: d, - LogRotCycle: &cycle, - Envs: map[string]string{"SLEEP_INFINITY": "1"}, + dbFile, err := os.CreateTemp("", "yukid*.db") + require.NoError(t, err) + t.Cleanup(func() { + _ = dbFile.Close() + _ = os.Remove(dbFile.Name()) }) - as.Nil(err) - - ct, err := s.c.Sync(ctx, core.SyncOptions{ - MountDir: false, - Name: name, - NamePrefix: prefix, + db, err := gorm.Open(sqlite.Open(dbFile.Name()), &gorm.Config{ + QueryFields: true, + SkipDefaultTransaction: true, }) - as.Nil(err) - defer s.c.RemoveContainer(ctx, ct.ID) - err = s.waitForSync(ct) - if err != context.DeadlineExceeded && err.Error() != "" { - t.Fatalf("Expected error to be context.DeadlineExceeded, got %v", err) + require.NoError(t, err) + sqlDB, err := db.DB() + require.NoError(t, err) + // To resolve the "database is locked" error. + // See also https://github.com/mattn/go-sqlite3/issues/209 + sqlDB.SetMaxOpenConns(1) + require.NoError(t, model.AutoMigrate(db)) + + s := &Server{ + e: e, + db: db, + logger: slogger, + dockerCli: fakedocker.NewClient(), + getSize: fs.New(fs.DEFAULT).GetSize, + + repoSchedules: cmap.New[cron.Schedule](), + } + s.e.Use(setLogger(slogger)) + s.e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{ + LogStatus: true, + LogMethod: true, + LogURI: true, + LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error { + l := getLogger(c) + l.LogAttrs(context.Background(), slog.LevelInfo, "REQUEST", slog.Int("status", v.Status)) + return nil + }, + })) + s.registerAPIs(e) + srv := httptest.NewServer(e) + return &TestEnv{ + t: t, + httpSrv: srv, + server: s, } } diff --git a/pkg/server/meta_handlers.go b/pkg/server/meta_handlers.go new file mode 100644 index 0000000..fb8b777 --- /dev/null +++ b/pkg/server/meta_handlers.go @@ -0,0 +1,66 @@ +package server + +import ( + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/model" +) + +func (s *Server) handlerListRepoMetas(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + var metas []model.RepoMeta + err := s.getDB(c).Find(&metas).Error + if err != nil { + const msg = "Fail to list RepoMetas" + l.Error(msg, slogErrAttr(err)) + return &echo.HTTPError{ + Code: http.StatusInternalServerError, + Message: msg, + } + } + resp := make(api.ListRepoMetasResponse, len(metas)) + for i, meta := range metas { + resp[i] = s.convertModelRepoMetaToGetMetaResponse(meta) + } + return c.JSON(http.StatusOK, resp) +} + +func (s *Server) handlerGetRepoMeta(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + name, err := getRepoNameFromRoute(c) + if err != nil { + return err + } + + var meta model.RepoMeta + res := s.getDB(c). + Where(model.RepoMeta{ + Name: name, + }). + Limit(1). + Find(&meta) + if res.Error != nil { + const msg = "Fail to get RepoMeta" + l.Error(msg, slogErrAttr(res.Error)) + return &echo.HTTPError{ + Code: http.StatusInternalServerError, + Message: msg, + } + } + if res.RowsAffected == 0 { + return &echo.HTTPError{ + Code: http.StatusNotFound, + Message: "RepoMeta not found", + } + } + + resp := s.convertModelRepoMetaToGetMetaResponse(meta) + return c.JSON(http.StatusOK, resp) +} diff --git a/pkg/server/meta_handlers_test.go b/pkg/server/meta_handlers_test.go new file mode 100644 index 0000000..a42fa07 --- /dev/null +++ b/pkg/server/meta_handlers_test.go @@ -0,0 +1,59 @@ +package server + +import ( + "net/http" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ustclug/Yuki/pkg/model" +) + +func TestHandlerListRepoMetas(t *testing.T) { + te := NewTestEnv(t) + require.NoError(t, te.server.db.Create([]model.RepoMeta{ + { + Name: t.Name(), + }, + }).Error) + + var metas []model.RepoMeta + cli := te.RESTClient() + resp, err := cli.R().SetResult(&metas).Get("/metas") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + require.Len(t, metas, 1) + require.EqualValues(t, t.Name(), metas[0].Name) +} + +func TestHandlerGetRepoMeta(t *testing.T) { + te := NewTestEnv(t) + require.NoError(t, te.server.db.Create([]model.RepoMeta{ + { + Name: t.Name(), + }, + }).Error) + + cli := te.RESTClient() + testCases := map[string]struct { + name string + expectStatus int + }{ + "ok": { + name: t.Name(), + expectStatus: http.StatusOK, + }, + "not found": { + name: "not found", + expectStatus: http.StatusNotFound, + }, + } + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + resp, err := cli.R().Get("/metas/" + tc.name) + require.NoError(t, err) + require.EqualValues(t, tc.expectStatus, resp.StatusCode()) + }) + } +} diff --git a/pkg/server/middlewares.go b/pkg/server/middlewares.go new file mode 100644 index 0000000..ccc0534 --- /dev/null +++ b/pkg/server/middlewares.go @@ -0,0 +1,37 @@ +package server + +import ( + "fmt" + "log/slog" + + "github.com/labstack/echo/v4" +) + +const ctxKeyLogger = "yukid-logger" + +func setLogger(logger *slog.Logger) echo.MiddlewareFunc { + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + reqID := c.Response().Header().Get(echo.HeaderXRequestID) + attrs := []any{ + slog.String("req_id", reqID), + } + routePath := c.Path() + if len(routePath) > 0 { + attrs = append( + attrs, + slog.String("endpoint", fmt.Sprintf("%s %s", c.Request().Method, routePath)), + ) + } + c.Set( + ctxKeyLogger, + logger.With(attrs...), + ) + return next(c) + } + } +} + +func getLogger(c echo.Context) *slog.Logger { + return c.Get(ctxKeyLogger).(*slog.Logger) +} diff --git a/pkg/server/repo_handlers.go b/pkg/server/repo_handlers.go new file mode 100644 index 0000000..6614c6d --- /dev/null +++ b/pkg/server/repo_handlers.go @@ -0,0 +1,266 @@ +package server + +import ( + "errors" + "fmt" + "log/slog" + "net/http" + "os" + "path/filepath" + "strings" + "time" + + "github.com/docker/docker/errdefs" + "github.com/labstack/echo/v4" + "github.com/robfig/cron/v3" + "gorm.io/gorm/clause" + "sigs.k8s.io/yaml" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/model" + "github.com/ustclug/Yuki/pkg/set" +) + +func (s *Server) handlerListRepos(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + var repos []model.Repo + err := s.getDB(c). + Select("name", "cron", "image", "storage_dir"). + Find(&repos).Error + if err != nil { + const msg = "Fail to list Repos" + l.Error(msg, slogErrAttr(err)) + return newHTTPError(http.StatusInternalServerError, msg) + } + + resp := make(api.ListReposResponse, len(repos)) + for i, repo := range repos { + resp[i] = api.ListReposResponseItem{ + Name: repo.Name, + Cron: repo.Cron, + Image: repo.Image, + StorageDir: repo.StorageDir, + } + } + return c.JSON(http.StatusOK, resp) +} + +func (s *Server) handlerGetRepo(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + name, err := getRepoNameFromRoute(c) + if err != nil { + return err + } + + var repo model.Repo + res := s.getDB(c). + Where(model.Repo{Name: name}). + Limit(1). + Find(&repo) + if err != nil { + const msg = "Fail to get Repo" + l.Error(msg, slogErrAttr(err)) + return newHTTPError(http.StatusInternalServerError, msg) + } + if res.RowsAffected == 0 { + return newHTTPError(http.StatusNotFound, "Repo not found") + } + + return c.JSON(http.StatusOK, repo) +} + +func (s *Server) handlerRemoveRepo(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + name, err := getRepoNameFromRoute(c) + if err != nil { + return err + } + + db := s.getDB(c) + err = db.Where(model.Repo{Name: name}).Delete(&model.Repo{}).Error + if err != nil { + const msg = "Fail to delete Repo" + l.Error(msg, slogErrAttr(err), slog.String("repo", name)) + return newHTTPError(http.StatusInternalServerError, msg) + } + err = db.Where(model.RepoMeta{Name: name}).Delete(&model.RepoMeta{}).Error + if err != nil { + l.Error("Fail to delete RepoMeta", slogErrAttr(err), slog.String("repo", name)) + } + s.repoSchedules.Remove(name) + return c.NoContent(http.StatusNoContent) +} + +func (s *Server) loadRepo(c echo.Context, logger *slog.Logger, dirs []string, file string) (*model.Repo, error) { + l := logger.With(slog.String("config", file)) + + var repo model.Repo + errn := len(dirs) + for _, dir := range dirs { + data, err := os.ReadFile(filepath.Join(dir, file)) + if err != nil { + errn-- + if errn > 0 && os.IsNotExist(err) { + continue + } else { + return nil, newHTTPError(http.StatusNotFound, fmt.Sprintf("File not found: %q", file)) + } + } + err = yaml.Unmarshal(data, &repo) + if err != nil { + return nil, newHTTPError(http.StatusBadRequest, fmt.Sprintf("Fail to parse config: %q: %v", file, err)) + } + } + + if err := s.e.Validator.Validate(&repo); err != nil { + return nil, newHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid config: %q: %v", file, err)) + } + + schedule, err := cron.ParseStandard(repo.Cron) + if err != nil { + return nil, newHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid cron: %q: %v", repo.Cron, err)) + } + s.repoSchedules.Set(repo.Name, schedule) + + logDir := filepath.Join(s.config.RepoLogsDir, repo.Name) + err = os.MkdirAll(logDir, 0o755) + if err != nil { + return nil, newHTTPError(http.StatusInternalServerError, fmt.Sprintf("Fail to create log dir: %q", logDir)) + } + + db := s.getDB(c) + err = db. + Clauses(clause.OnConflict{UpdateAll: true}). + Create(&repo).Error + if err != nil { + const msg = "Fail to create Repo" + l.Error(msg, slogErrAttr(err)) + return nil, newHTTPError(http.StatusInternalServerError, msg) + } + + upstream := getUpstream(repo.Image, repo.Envs) + nextRun := schedule.Next(time.Now()).Unix() + err = db. + Clauses(clause.OnConflict{ + DoUpdates: clause.Assignments(map[string]any{ + "upstream": upstream, + "next_run": nextRun, + }), + }). + Create(&model.RepoMeta{ + Name: repo.Name, + Upstream: upstream, + Size: s.getSize(repo.StorageDir), + NextRun: nextRun, + }).Error + if err != nil { + const msg = "Fail to create RepoMeta" + l.Error(msg, slogErrAttr(err)) + return nil, newHTTPError(http.StatusInternalServerError, msg) + } + return &repo, nil +} + +func (s *Server) handlerReloadAllRepos(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + var repoNames []string + db := s.getDB(c) + err := db.Model(&model.Repo{}).Pluck("name", &repoNames).Error + if err != nil { + const msg = "Fail to list Repos" + l.Error(msg, slogErrAttr(err)) + return newHTTPError(http.StatusInternalServerError, msg) + } + + l.Debug("Reloading all repos") + toDelete := set.New(repoNames...) + for _, dir := range s.config.RepoConfigDir { + infos, err := os.ReadDir(dir) + if err != nil { + if !os.IsNotExist(err) { + l.Warn("Fail to list dir", slogErrAttr(err), slog.String("dir", dir)) + } + continue + } + for _, info := range infos { + fileName := info.Name() + if info.IsDir() || fileName[0] == '.' || !strings.HasSuffix(fileName, suffixYAML) { + continue + } + repo, err := s.loadRepo(c, l, s.config.RepoConfigDir, fileName) + if err != nil { + return err + } + toDelete.Del(repo.Name) + } + } + + toDeleteNames := toDelete.ToList() + l.Debug("Deleting unnecessary repos", slog.Any("repos", toDeleteNames)) + err = db.Where("name IN ?", toDeleteNames).Delete(&model.Repo{}).Error + if err != nil { + const msg = "Fail to delete Repos" + l.Error(msg, slogErrAttr(err)) + return newHTTPError(http.StatusInternalServerError, msg) + } + err = db.Where("name IN ?", toDeleteNames).Delete(&model.RepoMeta{}).Error + if err != nil { + const msg = "Fail to delete RepoMetas" + l.Error(msg, slogErrAttr(err)) + } + for name := range toDelete { + s.repoSchedules.Remove(name) + } + return c.NoContent(http.StatusNoContent) +} + +func (s *Server) handlerReloadRepo(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + name, err := getRepoNameFromRoute(c) + if err != nil { + return err + } + _, err = s.loadRepo(c, l.With(slog.String("repo", name)), s.config.RepoConfigDir, name+suffixYAML) + if err != nil { + return err + } + return c.NoContent(http.StatusNoContent) +} + +func (s *Server) handlerSyncRepo(c echo.Context) error { + l := getLogger(c) + l.Debug("Invoked") + + name, err := getRepoNameFromRoute(c) + if err != nil { + return err + } + l = l.With(slog.String("repo", name)) + + debug := len(c.QueryParam("debug")) > 0 + err = s.syncRepo(c.Request().Context(), name, debug) + if err != nil { + if errors.Is(err, errNotFound) { + return newHTTPError(http.StatusNotFound, "Repo not found") + } + // https://github.com/moby/moby/issues/47018 + var dkErr errdefs.ErrConflict + if errors.As(err, &dkErr) { + return newHTTPError(http.StatusConflict, "Repo is syncing") + } + const msg = "Fail to sync Repo" + l.Error(msg, slogErrAttr(err)) + return newHTTPError(http.StatusInternalServerError, msg) + } + return c.NoContent(http.StatusCreated) +} diff --git a/pkg/server/repo_handlers_test.go b/pkg/server/repo_handlers_test.go new file mode 100644 index 0000000..45b76c7 --- /dev/null +++ b/pkg/server/repo_handlers_test.go @@ -0,0 +1,179 @@ +package server + +import ( + "fmt" + "os" + "path/filepath" + "testing" + "time" + + "github.com/robfig/cron/v3" + "github.com/stretchr/testify/require" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/model" + testutils "github.com/ustclug/Yuki/test/utils" +) + +func TestHandlerListRepos(t *testing.T) { + te := NewTestEnv(t) + require.NoError(t, te.server.db.Create([]model.Repo{ + { + Name: te.RandomString(), + StorageDir: "/data/1", + }, + { + Name: te.RandomString(), + StorageDir: "/data/2", + }, + }).Error) + + var repos api.ListReposResponse + cli := te.RESTClient() + resp, err := cli.R().SetResult(&repos).Get("/repos") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + require.Len(t, repos, 2) + require.EqualValues(t, "/data/2", repos[1].StorageDir) +} + +func TestHandlerReloadAllRepos(t *testing.T) { + te := NewTestEnv(t) + rootDir, err := os.MkdirTemp("", t.Name()) + require.NoError(t, err) + t.Cleanup(func() { + _ = os.RemoveAll(rootDir) + }) + cfgDir1 := filepath.Join(rootDir, "cfg1") + cfgDir2 := filepath.Join(rootDir, "cfg2") + require.NoError(t, os.Mkdir(cfgDir1, 0o755)) + require.NoError(t, os.Mkdir(cfgDir2, 0o755)) + te.server.config = Config{ + RepoLogsDir: filepath.Join(rootDir, "logs"), + RepoConfigDir: []string{"/no/such/dir", cfgDir1, cfgDir2}, + } + te.server.repoSchedules.Set("should-be-deleted", cron.Schedule(nil)) + + require.NoError(t, te.server.db.Create([]model.Repo{ + { + Name: "should-be-deleted", + }, + { + Name: "repo0", + Cron: "1 * * * *", + }, + }).Error) + + require.NoError(t, te.server.db.Create([]model.RepoMeta{ + { + Name: "should-be-deleted", + }, + { + Name: "repo0", + Upstream: "http://foo.com", + }, + }).Error) + + for i := 0; i < 2; i++ { + testutils.WriteFile( + t, + filepath.Join(cfgDir1, fmt.Sprintf("repo%d.yaml", i)), + fmt.Sprintf(` +name: repo%d +cron: "* * * * *" +image: "alpine:latest" +storageDir: /tmp +`, i), + ) + } + testutils.WriteFile(t, filepath.Join(cfgDir2, "repo0.yaml"), ` +image: ubuntu +envs: + UPSTREAM: http://bar.com +`) + + cli := te.RESTClient() + resp, err := cli.R().Post("/repos") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + require.EqualValues(t, 2, te.server.repoSchedules.Count()) + + var repos []model.Repo + require.NoError(t, te.server.db.Order("name").Find(&repos).Error) + require.Len(t, repos, 2) + + require.EqualValues(t, "repo0", repos[0].Name) + require.EqualValues(t, "ubuntu", repos[0].Image) + require.EqualValues(t, "* * * * *", repos[0].Cron) + require.NotEmpty(t, repos[0].Envs) + + require.EqualValues(t, "repo1", repos[1].Name) + require.EqualValues(t, "alpine:latest", repos[1].Image) + + var metas []model.RepoMeta + require.NoError(t, te.server.db.Order("name").Find(&metas).Error) + require.Len(t, repos, 2) + require.EqualValues(t, "repo0", metas[0].Name) + require.EqualValues(t, "http://bar.com", metas[0].Upstream) + + require.EqualValues(t, "repo1", metas[1].Name) +} + +func TestHandlerSyncRepo(t *testing.T) { + te := NewTestEnv(t) + name := te.RandomString() + require.NoError(t, te.server.db.Create(&model.Repo{ + Name: name, + Cron: "@every 1h", + Image: "alpine:latest", + StorageDir: "/data", + }).Error) + schedule, _ := cron.ParseStandard("@every 1h") + te.server.repoSchedules.Set(name, schedule) + + require.NoError(t, te.server.db.Create(&model.RepoMeta{Name: name}).Error) + + cli := te.RESTClient() + resp, err := cli.R().Post(fmt.Sprintf("/repos/%s/sync", name)) + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + meta := model.RepoMeta{ + Name: name, + } + testutils.PollUntilTimeout(t, time.Minute, func() bool { + require.NoError(t, te.server.db.Take(&meta).Error) + return !meta.Syncing + }) + + require.NoError(t, te.server.db.Take(&meta).Error) + require.NotEmpty(t, meta.PrevRun, "PrevRun") + require.Empty(t, meta.ExitCode, "ExitCode") + require.NotEmpty(t, meta.LastSuccess, "LastSuccess") + require.NotEmpty(t, meta.NextRun, "NextRun") +} + +func TestHandlerRemoveRepo(t *testing.T) { + te := NewTestEnv(t) + name := te.RandomString() + require.NoError(t, te.server.db.Create(&model.Repo{ + Name: name, + Cron: "@every 1h", + Image: "alpine:latest", + StorageDir: "/data", + }).Error) + require.NoError(t, te.server.db.Create(&model.RepoMeta{Name: name}).Error) + schedule, _ := cron.ParseStandard("@every 1h") + te.server.repoSchedules.Set(name, schedule) + + cli := te.RESTClient() + resp, err := cli.R().Delete(fmt.Sprintf("/repos/%s", name)) + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + require.False(t, te.server.repoSchedules.Has(name)) + require.ErrorContains(t, te.server.db.First(&model.Repo{Name: name}).Error, "record not found") + require.ErrorContains(t, te.server.db.First(&model.RepoMeta{Name: name}).Error, "record not found") +} diff --git a/pkg/server/utils.go b/pkg/server/utils.go new file mode 100644 index 0000000..cf641e2 --- /dev/null +++ b/pkg/server/utils.go @@ -0,0 +1,518 @@ +package server + +import ( + "context" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "os/exec" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/mount" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/errdefs" + "github.com/labstack/echo/v4" + "github.com/robfig/cron/v3" + "golang.org/x/sync/errgroup" + "gorm.io/gorm" + "gorm.io/gorm/clause" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/model" +) + +const suffixYAML = ".yaml" + +var errNotFound = errors.New("not found") + +func (s *Server) getDB(c echo.Context) *gorm.DB { + return s.db.WithContext(c.Request().Context()) +} + +func getRepoNameFromRoute(c echo.Context) (string, error) { + val := c.Param("name") + if len(val) == 0 { + return "", newHTTPError(http.StatusBadRequest, "Missing required repo name") + } + return val, nil +} + +func (s *Server) convertModelRepoMetaToGetMetaResponse(in model.RepoMeta) api.GetRepoMetaResponse { + return api.GetRepoMetaResponse{ + Name: in.Name, + Upstream: in.Upstream, + Syncing: in.Syncing, + Size: in.Size, + ExitCode: in.ExitCode, + LastSuccess: in.LastSuccess, + UpdatedAt: in.UpdatedAt, + PrevRun: in.PrevRun, + NextRun: in.NextRun, + } +} + +func slogErrAttr(err error) slog.Attr { + return slog.Any("err", err) +} + +func newHTTPError(code int, msg string) error { + return &echo.HTTPError{ + Code: code, + Message: msg, + } +} + +func (s *Server) waitForSync(name, ctID, storageDir string) { + l := s.logger.With(slog.String("repo", name)) + code, err := s.dockerCli.WaitContainerWithTimeout(ctID, s.config.SyncTimeout) + if err != nil { + if !errors.Is(err, context.DeadlineExceeded) { + l.Error("Fail to wait for container", slogErrAttr(err)) + return + } else { + // Here we set a special exit code to indicate that the container is timeout in meta. + code = -2 + } + } + err = s.dockerCli.RemoveContainerWithTimeout(ctID, time.Second*20) + if err != nil { + l.Error("Fail to remove container", slogErrAttr(err)) + } + + var lastSuccess int64 + if code == 0 { + lastSuccess = time.Now().Unix() + } + + err = s.db. + Model(&model.RepoMeta{}). + Where(model.RepoMeta{Name: name}). + Updates(map[string]any{ + "size": s.getSize(storageDir), + "exit_code": code, + "last_success": lastSuccess, + "syncing": false, + }).Error + if err != nil { + l.Error("Fail to update RepoMeta", slogErrAttr(err)) + } + + if len(s.config.PostSync) == 0 { + return + } + go func() { + envs := []string{ + fmt.Sprintf("NAME=%s", name), + fmt.Sprintf("DIR=%s", storageDir), + } + for _, cmd := range s.config.PostSync { + prog := exec.Command("sh", "-c", cmd) + prog.Env = envs + output, err := prog.CombinedOutput() + if err != nil { + l.Error("PostSync program exit abnormally", + slog.String("output", string(output)), + slog.String("command", cmd), + ) + } + } + }() +} + +func getUpstream(image string, envs model.StringMap) (upstream string) { + image = strings.SplitN(image, ":", 2)[0] + parts := strings.Split(image, "/") + t := parts[len(parts)-1] + + var ok bool + if upstream, ok = envs["$UPSTREAM"]; ok { + return upstream + } + if upstream, ok = envs["UPSTREAM"]; ok { + return upstream + } + switch t { + case "archvsync", "rsync": + return fmt.Sprintf("rsync://%s/%s", envs["RSYNC_HOST"], envs["RSYNC_PATH"]) + case "aptsync", "apt-sync": + return envs["APTSYNC_URL"] + case "crates-io-index": + return "https://github.com/rust-lang/crates.io-index" + case "debian-cd": + return fmt.Sprintf("rsync://%s/%s", envs["RSYNC_HOST"], envs["RSYNC_MODULE"]) + case "docker-ce": + return "https://download.docker.com/" + case "fedora": + remote, ok := envs["REMOTE"] + if !ok { + remote = "rsync://dl.fedoraproject.org" + } + return fmt.Sprintf("%s/%s", remote, envs["MODULE"]) + case "freebsd-pkg": + if upstream, ok = envs["FBSD_PKG_UPSTREAM"]; !ok { + return "http://pkg.freebsd.org/" + } + case "freebsd-ports": + if upstream, ok = envs["FBSD_PORTS_DISTFILES_UPSTREAM"]; !ok { + return "http://distcache.freebsd.org/ports-distfiles/" + } + case "ghcup": + return "https://www.haskell.org/ghcup/" + case "github-release": + return "https://github.com" + case "gitsync": + return envs["GITSYNC_URL"] + case "google-repo": + return "https://android.googlesource.com/mirror/manifest" + case "gsutil-rsync": + return envs["GS_URL"] + case "hackage": + if upstream, ok = envs["HACKAGE_BASE_URL"]; !ok { + return "https://hackage.haskell.org/" + } + case "homebrew-bottles": + if upstream, ok = envs["HOMEBREW_BOTTLE_DOMAIN"]; !ok { + return "https://ghcr.io/v2/homebrew/" + } + case "julia-storage": + return "https://us-east.storage.juliahub.com, https://kr.storage.juliahub.com" + case "nix-channels": + if upstream, ok = envs["NIX_MIRROR_UPSTREAM"]; !ok { + return "https://nixos.org/channels" + } + case "lftpsync": + return fmt.Sprintf("%s/%s", envs["LFTPSYNC_HOST"], envs["LFTPSYNC_PATH"]) + case "nodesource": + return "https://nodesource.com/" + case "pypi": + return "https://pypi.python.org/" + case "rclone": + remoteType := envs["RCLONE_CONFIG_REMOTE_TYPE"] + path := envs["RCLONE_PATH"] + domain := "" + switch remoteType { + case "swift": + domain = envs["RCLONE_SWIFT_STORAGE_URL"] + "/" + case "http": + domain = envs["RCLONE_CONFIG_REMOTE_URL"] + case "s3": + domain = envs["RCLONE_CONFIG_REMOTE_ENDPOINT"] + } + return fmt.Sprintf("%s%s", domain, path) + case "rubygems": + return "http://rubygems.org/" + case "stackage": + upstream = "https://github.com/commercialhaskell/" + case "tsumugu": + return envs["UPSTREAM"] + case "winget-source": + if upstream, ok = envs["WINGET_REPO_URL"]; !ok { + return "https://cdn.winget.microsoft.com/cache" + } + case "yum-sync": + return envs["YUMSYNC_URL"] + } + return +} + +// cleanDeadContainers removes containers which status are `created`, `exited` or `dead`. +func (s *Server) cleanDeadContainers() error { + cts, err := s.dockerCli.ListContainersWithTimeout(false, time.Second*10) + if err != nil { + return fmt.Errorf("list containers: %w", err) + } + + for _, ct := range cts { + err := s.dockerCli.RemoveContainerWithTimeout(ct.ID, time.Second*20) + if err != nil { + return fmt.Errorf("remove container %q: %w", ct.ID, err) + } + } + return nil +} + +// waitRunningContainers waits for all syncing containers to stop and remove them. +func (s *Server) waitRunningContainers() error { + cts, err := s.dockerCli.ListContainersWithTimeout(true, time.Second*10) + if err != nil { + // logger.Error("Fail to list containers", slogErrAttr(err)) + return fmt.Errorf("list containers: %w", err) + } + for _, ct := range cts { + name := ct.Labels[api.LabelRepoName] + dir := ct.Labels[api.LabelStorageDir] + ctID := ct.ID + err := s.db. + Where(model.RepoMeta{Name: name}). + Updates(&model.RepoMeta{Syncing: true}). + Error + if err != nil { + s.logger.Error("Fail to set syncing to true", slogErrAttr(err), slog.String("repo", name)) + } + go s.waitForSync(name, ctID, dir) + } + return nil +} + +func (s *Server) upgradeImages() { + db := s.db + logger := s.logger + logger.Debug("Upgrading images") + + var images []string + err := db.Model(&model.Repo{}). + Distinct("image"). + Pluck("image", &images).Error + if err != nil { + logger.Error("Fail to query images", slogErrAttr(err)) + return + } + eg, egCtx := errgroup.WithContext(context.Background()) + eg.SetLimit(5) + for _, i := range images { + img := i + eg.Go(func() error { + pullCtx, cancel := context.WithTimeout(egCtx, time.Minute*5) + defer cancel() + err := s.dockerCli.PullImage(pullCtx, img) + if err != nil { + logger.Error("Fail to pull image", slogErrAttr(err), slog.String("image", img)) + } + return nil + }) + } + _ = eg.Wait() + + logger.Debug("Removing dangling images") + + err = s.dockerCli.RemoveDanglingImages() + if err != nil { + logger.Error("Fail to remove dangling images", slogErrAttr(err)) + } +} + +func (s *Server) scheduleTasks(ctx context.Context) { + // sync repos + go func() { + ticker := time.NewTicker(time.Second * 10) + defer ticker.Stop() + for { + var metas []model.RepoMeta + s.db.Select("name").Where("next_run <= ?", time.Now().Unix()).Find(&metas) + for _, meta := range metas { + name := meta.Name + l := s.logger.With(slog.String("repo", name)) + err := s.syncRepo(context.Background(), name, false) + if err != nil { + var dkErr errdefs.ErrConflict + if errors.As(err, &dkErr) { + l.Warn("Still syncing") + } else { + l.Error("Fail to sync", slogErrAttr(err)) + } + } + } + select { + case <-ctx.Done(): + return + case <-ticker.C: + } + } + }() + + // upgrade images + if s.config.ImagesUpgradeInterval > 0 { + go func() { + ticker := time.NewTicker(s.config.ImagesUpgradeInterval) + defer ticker.Stop() + for { + s.upgradeImages() + select { + case <-ctx.Done(): + return + case <-ticker.C: + } + } + }() + } +} + +func (s *Server) initRepoMetas() error { + db := s.db + var repos []model.Repo + return db.Select("name", "storage_dir", "cron"). + FindInBatches(&repos, 10, func(*gorm.DB, int) error { + for _, repo := range repos { + schedule, _ := cron.ParseStandard(repo.Cron) + s.repoSchedules.Set(repo.Name, schedule) + nextRun := schedule.Next(time.Now()).Unix() + size := s.getSize(repo.StorageDir) + err := db.Clauses(clause.OnConflict{ + DoUpdates: clause.Assignments(map[string]any{ + "size": size, + "syncing": false, + "next_run": nextRun, + }), + }).Create(&model.RepoMeta{ + Name: repo.Name, + Size: size, + NextRun: nextRun, + ExitCode: -1, + }).Error + if err != nil { + return fmt.Errorf("init meta for repo %q: %w", repo.Name, err) + } + } + return nil + }).Error +} + +func (s *Server) syncRepo(ctx context.Context, name string, debug bool) error { + db := s.db.WithContext(ctx) + var repo model.Repo + res := db.Where(model.Repo{Name: name}).Limit(1).Find(&repo) + if res.Error != nil { + return fmt.Errorf("get repo %q: %w", name, res.Error) + } + if res.RowsAffected == 0 { + return fmt.Errorf("get repo %q: %w", name, errNotFound) + } + + // Update next_run unconditionally + logger := s.logger.With(slog.String("repo", name)) + now := time.Now() + var nextRun int64 + schedule, ok := s.repoSchedules.Get(repo.Name) + if ok { + nextRun = schedule.Next(now).Unix() + } else { + logger.Warn("No schedule found for repo. Fallback to 1 hour") + nextRun = now.Add(time.Hour).Unix() + } + err := db. + Where(model.RepoMeta{Name: name}). + Updates(&model.RepoMeta{NextRun: nextRun}).Error + if err != nil { + logger.Error("Fail to update next_run", slogErrAttr(err)) + } + + if len(repo.BindIP) == 0 { + repo.BindIP = s.config.BindIP + } + if len(repo.User) == 0 { + repo.User = s.config.Owner + } + + var securityOpt []string + if len(s.config.SeccompProfile) > 0 { + securityOpt = append(securityOpt, "seccomp="+s.config.SeccompProfile) + } + + envMap := repo.Envs + if len(envMap) == 0 { + envMap = make(map[string]string) + } + envMap["REPO"] = repo.Name + envMap["OWNER"] = repo.User + envMap["BIND_ADDRESS"] = repo.BindIP + envMap["RETRY"] = strconv.Itoa(repo.Retry) + envMap["LOG_ROTATE_CYCLE"] = strconv.Itoa(repo.LogRotCycle) + if debug { + envMap["DEBUG"] = "true" + } + + envs := make([]string, 0, len(envMap)) + for k, v := range envMap { + envs = append(envs, k+"="+v) + } + + binds := []string{ + repo.StorageDir + ":/data", + filepath.Join(s.config.RepoLogsDir, name) + ":/log", + } + for k, v := range repo.Volumes { + binds = append(binds, k+":"+v) + } + + containerConfig := &container.Config{ + Image: repo.Image, + OpenStdin: true, + Env: envs, + Labels: map[string]string{ + api.LabelRepoName: repo.Name, + api.LabelStorageDir: repo.StorageDir, + }, + } + hostConfig := &container.HostConfig{ + SecurityOpt: securityOpt, + // NOTE: difference between "-v" and "--mount": + // https://docs.docker.com/storage/bind-mounts/#choose-the--v-or---mount-flag + Mounts: []mount.Mount{ + { + // TODO: make it configurable? + Type: mount.TypeTmpfs, + Target: "/tmp", + }, + }, + Binds: binds, + } + networkingConfig := &network.NetworkingConfig{ + EndpointsConfig: make(map[string]*network.EndpointSettings, 1), + } + switch repo.Network { + case "", "host": + hostConfig.NetworkMode = "host" + default: + // https://github.com/moby/moby/blob/master/daemon/create_test.go#L15 + networkingConfig.EndpointsConfig[repo.Network] = &network.EndpointSettings{} + } + ctName := s.config.NamePrefix + name + + ctID, err := s.dockerCli.RunContainer( + ctx, + containerConfig, + hostConfig, + networkingConfig, + ctName, + ) + if err != nil { + return fmt.Errorf("run container: %w", err) + } + + err = db. + Where(model.RepoMeta{Name: name}). + Updates(&model.RepoMeta{ + PrevRun: now.Unix(), + Syncing: true, + }).Error + if err != nil { + logger.Error("Fail to update RepoMeta", slogErrAttr(err)) + } + go s.waitForSync(name, ctID, repo.StorageDir) + + return nil +} + +func newSlogger(writer io.Writer, addSource bool, level slog.Leveler) *slog.Logger { + return slog.New(slog.NewTextHandler(writer, &slog.HandlerOptions{ + AddSource: addSource, + Level: level, + ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr { + // Taken from https://gist.github.com/HalCanary/6bd335057c65f3b803088cc55b9ebd2b + if a.Key == slog.SourceKey { + source, _ := a.Value.Any().(*slog.Source) + if source != nil { + _, after, _ := strings.Cut(source.File, "Yuki") + source.File = after + } + } + return a + }, + })) +} diff --git a/pkg/server/utils_test.go b/pkg/server/utils_test.go new file mode 100644 index 0000000..9e0c730 --- /dev/null +++ b/pkg/server/utils_test.go @@ -0,0 +1,128 @@ +package server + +import ( + "context" + "sync" + "testing" + "time" + + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/network" + "github.com/stretchr/testify/require" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/docker" + "github.com/ustclug/Yuki/pkg/model" + testutils "github.com/ustclug/Yuki/test/utils" +) + +func TestInitRepoMetas(t *testing.T) { + te := NewTestEnv(t) + require.NoError(t, te.server.db.Create([]model.Repo{ + { + Name: "repo0", + Cron: "@every 1h", + }, + { + Name: "repo1", + Cron: "@every 1h", + }, + }).Error) + require.NoError(t, te.server.db.Create([]model.RepoMeta{ + { + Name: "repo0", + Size: 100, + ExitCode: 0, + }, + }).Error) + + require.NoError(t, te.server.initRepoMetas()) + + var metas []model.RepoMeta + require.NoError(t, te.server.db.Order("name").Find(&metas).Error) + require.Len(t, metas, 2) + require.EqualValues(t, -1, metas[0].Size) + require.EqualValues(t, 0, metas[0].ExitCode) + + require.EqualValues(t, -1, metas[1].Size) + require.EqualValues(t, -1, metas[1].ExitCode) +} + +type fakeImageClient struct { + docker.Client + pullImage func(ctx context.Context, image string) error +} + +func (f *fakeImageClient) PullImage(ctx context.Context, image string) error { + return f.pullImage(ctx, image) +} + +func TestUpgradeImages(t *testing.T) { + te := NewTestEnv(t) + var ( + mu sync.Mutex + pulledImages []string + ) + dockerCli := &fakeImageClient{ + Client: te.server.dockerCli, + pullImage: func(ctx context.Context, image string) error { + mu.Lock() + defer mu.Unlock() + pulledImages = append(pulledImages, image) + return nil + }, + } + te.server.dockerCli = dockerCli + + require.NoError(t, te.server.db.Create([]model.Repo{ + { + Name: "repo0", + Image: "image0", + }, + { + Name: "repo1", + Image: "image1", + }, + { + Name: "repo2", + Image: "image0", + }, + }).Error) + te.server.upgradeImages() + + require.Len(t, pulledImages, 2) + require.Contains(t, pulledImages, "image0") + require.Contains(t, pulledImages, "image1") +} + +func TestWaitRunningContainers(t *testing.T) { + te := NewTestEnv(t) + require.NoError(t, te.server.db.Create(&model.RepoMeta{ + Name: "repo0", + }).Error) + _, err := te.server.dockerCli.RunContainer( + context.TODO(), + &container.Config{ + Labels: map[string]string{ + api.LabelRepoName: "repo0", + api.LabelStorageDir: "/data", + }, + }, + &container.HostConfig{}, + &network.NetworkingConfig{}, + "sync-repo0", + ) + require.NoError(t, err) + require.NoError(t, te.server.waitRunningContainers()) + + meta := model.RepoMeta{ + Name: "repo0", + } + require.NoError(t, te.server.db.First(&meta).Error) + require.True(t, meta.Syncing) + + testutils.PollUntilTimeout(t, time.Minute, func() bool { + require.NoError(t, te.server.db.First(&meta).Error) + return !meta.Syncing + }) +} diff --git a/pkg/server/validate.go b/pkg/server/validate.go deleted file mode 100644 index 558ae12..0000000 --- a/pkg/server/validate.go +++ /dev/null @@ -1,141 +0,0 @@ -package server - -import ( - "fmt" - "net" - "reflect" - "strconv" - "strings" - "time" - - "github.com/globalsign/mgo" - "github.com/go-playground/validator/v10" - - "github.com/ustclug/Yuki/pkg/cron" -) - -func isNum(k reflect.Kind) bool { - return k == reflect.Float32 || - k == reflect.Float64 || - k == reflect.Int || - k == reflect.Int8 || - k == reflect.Int32 || - k == reflect.Int64 || - k == reflect.Uint || - k == reflect.Uint8 || - k == reflect.Uint32 || - k == reflect.Uint64 -} - -func getJSONName(tag string) (name string, hasName bool) { - specs := strings.Split(tag, ",") - for _, s := range specs { - switch s { - case "omitempty": - - case "", "-": - return "", false - - default: - return s, true - } - } - return "", false -} - -type myValidator struct { - v *validator.Validate -} - -func (mv *myValidator) Validate(i interface{}) error { - return mv.v.Struct(i) -} - -func (mv *myValidator) CheckMap(m map[string]interface{}, i interface{}) error { - ty := reflect.ValueOf(i).Type() - if ty.Kind() != reflect.Struct { - return fmt.Errorf("not a struct: %s", ty.Name()) - } - fields := ty.NumField() - fieldMap := make(map[string]reflect.StructField) - for i := 0; i < fields; i++ { - field := ty.Field(i) - if name, ok := getJSONName(field.Tag.Get("json")); ok { - fieldMap[name] = field - } - } - for k, v := range m { - if strings.HasPrefix(k, "envs.") { - continue - } - if strings.HasPrefix(k, "volumes.") { - if reflect.ValueOf(v).Kind() != reflect.String { - return fmt.Errorf("not a string: %v", v) - } - continue - } - field, ok := fieldMap[k] - if !ok { - return fmt.Errorf("unexpected key: %s", k) - } - expectedKind := field.Type.Kind() - actualKind := reflect.ValueOf(v).Kind() - - // try converting string to float - if isNum(expectedKind) && actualKind == reflect.String { - s := v.(string) - if f, err := strconv.ParseFloat(s, 64); err == nil { - m[k] = f - continue - } - } - if actualKind == reflect.Float64 && isNum(expectedKind) { - // do nothing - } else if actualKind != expectedKind { - return fmt.Errorf("mismatched kind of <%s>, expect %s, get %s", k, expectedKind, actualKind) - } - - if rule, ok := field.Tag.Lookup("validate"); ok { - if err := mv.v.Var(v, rule); err != nil { - return fmt.Errorf("invalid key: %s", k) - } - } - } - return nil -} - -func NewValidator() *validator.Validate { - v := validator.New() - v.RegisterValidation("mongodb", isMongoDB) - v.RegisterValidation("cron", isCron) - v.RegisterValidation("hostport", isHostPort) - v.RegisterValidation("duration", isDuration) - return v -} - -func isDuration(fl validator.FieldLevel) bool { - s := fl.Field().String() - dur, err := time.ParseDuration(s) - if err != nil { - return false - } - return dur >= 0 -} - -func isMongoDB(fl validator.FieldLevel) bool { - url := fl.Field().String() - _, err := mgo.ParseURL(url) - return err == nil -} - -func isCron(fl validator.FieldLevel) bool { - s := fl.Field().String() - _, err := cron.Parse(s) - return err == nil -} - -func isHostPort(fl validator.FieldLevel) bool { - s := fl.Field().String() - _, err := net.ResolveTCPAddr("tcp", s) - return err == nil -} diff --git a/pkg/server/validator.go b/pkg/server/validator.go new file mode 100644 index 0000000..8f500b1 --- /dev/null +++ b/pkg/server/validator.go @@ -0,0 +1,7 @@ +package server + +type echoValidator func(i any) error + +func (v echoValidator) Validate(i any) error { + return v(i) +} diff --git a/pkg/set/set.go b/pkg/set/set.go new file mode 100644 index 0000000..a99ca02 --- /dev/null +++ b/pkg/set/set.go @@ -0,0 +1,27 @@ +package set + +type Set[T comparable] map[T]struct{} + +func New[T comparable](elements ...T) Set[T] { + s := make(Set[T], len(elements)) + s.Add(elements...) + return s +} + +func (s Set[T]) Add(elements ...T) { + for _, v := range elements { + s[v] = struct{}{} + } +} + +func (s Set[T]) Del(ele T) { + delete(s, ele) +} + +func (s Set[T]) ToList() []T { + list := make([]T, 0, len(s)) + for k := range s { + list = append(list, k) + } + return list +} diff --git a/pkg/tail/tail.go b/pkg/tail/tail.go deleted file mode 100644 index 328ba28..0000000 --- a/pkg/tail/tail.go +++ /dev/null @@ -1,85 +0,0 @@ -// Package tail provides support for outputing the last N lines of a ReadSeeker. -package tail - -import ( - "bytes" - "io" -) - -const blockSize = 1024 - -var eol = []byte("\n") - -// Tail prints the last N lines. -type Tail struct { - r io.ReadSeeker - n int -} - -// New returns an instance of Tail. -func New(r io.ReadSeeker, n int) *Tail { - return &Tail{r, n} -} - -// WriteTo writes last N lines to the Writer. -func (t *Tail) WriteTo(w io.Writer) (n int64, err error) { - if t.n == 0 { - n, err = io.Copy(w, t.r) - return - } - - size, err := t.r.Seek(0, io.SeekEnd) - if err != nil { - return 0, err - } - - var b, data []byte - block := -1 - cnt := 0 - - for t.n >= cnt { - step := int64(block * blockSize) - left := size + step // how many bytes to beginning - if left < 0 { - if _, err = t.r.Seek(0, io.SeekStart); err != nil { - return 0, err - } - b = make([]byte, blockSize+left) - if _, err = t.r.Read(b); err != nil { - return 0, err - } - data = append(b, data...) - break - } else { - if _, err = t.r.Seek(left, io.SeekStart); err != nil { - return 0, err - } - b = make([]byte, blockSize) - if _, err = t.r.Read(b); err != nil { - return 0, err - } - data = append(b, data...) - } - cnt += bytes.Count(b, eol) - block-- - } - - if bytes.HasSuffix(data, eol) { - data = data[:len(data)-1] - } - lines := bytes.Split(data, eol) - nLines := len(lines) - if t.n < nLines { - lines = lines[nLines-t.n:] - } - - for _, l := range lines { - l = append(l, eol...) - written, err := w.Write(l) - n += int64(written) - if err != nil { - return n, err - } - } - return n, nil -} diff --git a/pkg/tail/tail_test.go b/pkg/tail/tail_test.go deleted file mode 100644 index 98fa9de..0000000 --- a/pkg/tail/tail_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package tail - -import ( - "bytes" - "reflect" - "testing" -) - -type config struct { - lens []int - n int -} - -func TestWithoutEOL(t *testing.T) { - t.Parallel() - l := []int{1, 2, 3, 4} - testReadLines(t, config{l, 10}, false) -} - -func TestReadLongLines(t *testing.T) { - t.Parallel() - l := []int{128 * 1024, 256 * 1024, 3, 4, 5} - testReadLines(t, config{l, 3}, true) -} - -// Excerpt from https://github.com/kubernetes/kubernetes/pull/23265/files -func testReadLines(t *testing.T, cfg config, hasEOL bool) { - var ( - lines [][]byte - input []byte - expected []byte - ) - for _, leng := range cfg.lens { - line := make([]byte, 0, leng) - for i := 1; i < leng; i++ { - line = append(line, 'a') - } - line = append(line, '\n') - lines = append(lines, line) - input = append(input, line...) - } - i := len(lines) - cfg.n - if i < 0 { - i = 0 - } - for ; i < len(lines); i++ { - expected = append(expected, lines[i]...) - } - if !hasEOL { - input = input[:len(input)-1] - } - reader := bytes.NewReader(input) - tail := New(reader, cfg.n) - buffer := new(bytes.Buffer) - written, err := tail.WriteTo(buffer) - if err != nil { - t.Fatal(err) - } - if written != int64(len(expected)) { - t.Fatalf("expected length: %d, but got %d", len(expected), written) - } - if !reflect.DeepEqual(buffer.Bytes(), expected) { - t.Fatalf("expected content:\n%s\nbut got:\n%s", string(expected), buffer.String()) - } -} diff --git a/pkg/utils/checkerror.go b/pkg/utils/checkerror.go deleted file mode 100644 index d12533e..0000000 --- a/pkg/utils/checkerror.go +++ /dev/null @@ -1,13 +0,0 @@ -package utils - -import ( - "fmt" - "os" -) - -func CheckError(err error) { - if err != nil { - _, _ = fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} diff --git a/pkg/utils/dir.go b/pkg/utils/dir.go deleted file mode 100644 index 5cbc4b4..0000000 --- a/pkg/utils/dir.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package utils provides some helper functions. -package utils - -import "os" - -// DirExists checks whether given path is an existing directory. -func DirExists(path string) bool { - stat, err := os.Stat(path) - if err != nil { - return false - } - return stat.IsDir() -} diff --git a/pkg/utils/dir_test.go b/pkg/utils/dir_test.go deleted file mode 100644 index 853d8dc..0000000 --- a/pkg/utils/dir_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package utils - -import "testing" - -func TestDirExists(t *testing.T) { - if !DirExists("/") { - t.Fatal("/ is not a directory?") - } -} diff --git a/pkg/utils/size.go b/pkg/utils/size.go deleted file mode 100644 index 3118ad3..0000000 --- a/pkg/utils/size.go +++ /dev/null @@ -1,21 +0,0 @@ -package utils - -import ( - "fmt" -) - -func PrettySize(size int64) string { - if size < 0 { - return "unknown" - } - const n = float64(1024) - a := float64(size) - units := []string{"B", "KiB", "MiB", "GiB"} - for _, u := range units { - if a < n { - return fmt.Sprintf("%.1f %s", a, u) - } - a /= n - } - return fmt.Sprintf("%.1f TiB", a) -} diff --git a/pkg/yukictl/cmd/completion.go b/pkg/yukictl/cmd/completion.go index 6b6e7b2..fb37530 100644 --- a/pkg/yukictl/cmd/completion.go +++ b/pkg/yukictl/cmd/completion.go @@ -1,8 +1,6 @@ package cmd import ( - "os" - "github.com/spf13/cobra" ) @@ -14,14 +12,14 @@ func NewCmdCompletion() *cobra.Command { bashCmd := &cobra.Command{ Use: "bash", - Run: func(cmd *cobra.Command, args []string) { - _ = cmd.Root().GenBashCompletion(os.Stdout) + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Root().GenBashCompletion(cmd.OutOrStdout()) }, } zshCmd := &cobra.Command{ Use: "zsh", - Run: func(cmd *cobra.Command, args []string) { - _ = cmd.Root().GenZshCompletion(os.Stdout) + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Root().GenZshCompletion(cmd.OutOrStdout()) }, } rootCmd.AddCommand(bashCmd, zshCmd) diff --git a/pkg/yukictl/cmd/ct/ct.go b/pkg/yukictl/cmd/ct/ct.go deleted file mode 100644 index aeeaad8..0000000 --- a/pkg/yukictl/cmd/ct/ct.go +++ /dev/null @@ -1,20 +0,0 @@ -package ct - -import ( - "github.com/spf13/cobra" - - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -func NewCmdContainer(f factory.Factory) *cobra.Command { - cmd := &cobra.Command{ - Use: "ct", - Short: "Manage containers", - } - cmd.AddCommand( - NewCmdContainerLs(f), - NewCmdContainerLogs(f), - NewCmdContainerRemove(f), - ) - return cmd -} diff --git a/pkg/yukictl/cmd/ct/logs.go b/pkg/yukictl/cmd/ct/logs.go deleted file mode 100644 index 067caee..0000000 --- a/pkg/yukictl/cmd/ct/logs.go +++ /dev/null @@ -1,68 +0,0 @@ -package ct - -import ( - "fmt" - "os" - "strconv" - - "github.com/docker/docker/pkg/stdcopy" - "github.com/labstack/echo/v4" - "github.com/spf13/cobra" - - "github.com/ustclug/Yuki/pkg/utils" - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -type logsOptions struct { - name string - tail uint32 - follow bool -} - -func (o *logsOptions) Complete(args []string) error { - o.name = args[0] - return nil -} - -func (o *logsOptions) Run(f factory.Factory) error { - u, err := f.MakeURL("api/v1/containers/%s/logs", o.name) - if err != nil { - return err - } - var errMsg echo.HTTPError - req := f.RESTClient().R().SetError(&errMsg).SetDoNotParseResponse(true) - if o.follow { - req.SetQueryParam("follow", strconv.FormatBool(true)) - } - if o.tail > 0 { - req.SetQueryParam("tail", strconv.FormatUint(uint64(o.tail), 10)) - } - resp, err := req.Get(u.String()) - if err != nil { - return err - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - body := resp.RawBody() - defer body.Close() - _, err = stdcopy.StdCopy(os.Stdout, os.Stderr, body) - return err -} - -func NewCmdContainerLogs(f factory.Factory) *cobra.Command { - o := logsOptions{} - cmd := &cobra.Command{ - Use: "logs", - Short: "Container logs", - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) - }, - } - flags := cmd.Flags() - flags.BoolVarP(&o.follow, "follow", "f", false, "Follow log output") - flags.Uint32VarP(&o.tail, "tail", "t", 0, "Number of lines to show from the end of the logs") - return cmd -} diff --git a/pkg/yukictl/cmd/ct/ls.go b/pkg/yukictl/cmd/ct/ls.go deleted file mode 100644 index 3836f76..0000000 --- a/pkg/yukictl/cmd/ct/ls.go +++ /dev/null @@ -1,59 +0,0 @@ -package ct - -import ( - "fmt" - "os" - - "github.com/labstack/echo/v4" - "github.com/spf13/cobra" - - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/tabwriter" - "github.com/ustclug/Yuki/pkg/utils" - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -type lsOptions struct { -} - -func (o *lsOptions) Run(f factory.Factory) error { - var errMsg echo.HTTPError - req := f.RESTClient().R().SetError(&errMsg) - u, err := f.MakeURL("api/v1/containers") - if err != nil { - return err - } - var result []api.ContainerDetail - resp, err := req.SetResult(&result).Get(u.String()) - if err != nil { - return err - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - printer := tabwriter.New(os.Stdout) - printer.SetHeader([]string{ - "id", - "name", - "image", - "state", - "status", - }) - for _, ct := range result { - printer.Append(ct.ID, ct.Name, ct.Image, ct.State, ct.Status) - } - return printer.Render() -} - -func NewCmdContainerLs(f factory.Factory) *cobra.Command { - o := lsOptions{} - cmd := &cobra.Command{ - Use: "ls", - Short: "List all containers", - Args: cobra.MaximumNArgs(0), - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Run(f)) - }, - } - return cmd -} diff --git a/pkg/yukictl/cmd/ct/rm.go b/pkg/yukictl/cmd/ct/rm.go deleted file mode 100644 index e744099..0000000 --- a/pkg/yukictl/cmd/ct/rm.go +++ /dev/null @@ -1,53 +0,0 @@ -package ct - -import ( - "fmt" - - "github.com/labstack/echo/v4" - "github.com/spf13/cobra" - - "github.com/ustclug/Yuki/pkg/utils" - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -type rmOptions struct { - name string -} - -func (o *rmOptions) Complete(args []string) error { - o.name = args[0] - return nil -} - -func (o *rmOptions) Run(f factory.Factory) error { - u, err := f.MakeURL("api/v1/containers/%s", o.name) - if err != nil { - return err - } - var errMsg echo.HTTPError - resp, err := f.RESTClient().R(). - SetError(&errMsg). - Delete(u.String()) - if err != nil { - return err - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - fmt.Printf("Successfully deletes container: <%s>\n", o.name) - return nil -} - -func NewCmdContainerRemove(f factory.Factory) *cobra.Command { - o := rmOptions{} - cmd := &cobra.Command{ - Use: "rm", - Short: "Remove the given container", - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) - }, - } - return cmd -} diff --git a/pkg/yukictl/cmd/export.go b/pkg/yukictl/cmd/export.go deleted file mode 100644 index f56064f..0000000 --- a/pkg/yukictl/cmd/export.go +++ /dev/null @@ -1,77 +0,0 @@ -package cmd - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/labstack/echo/v4" - "github.com/spf13/cobra" - "sigs.k8s.io/yaml" - - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/utils" - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -type exportOptions struct { - args []string - dir string -} - -func (o *exportOptions) Complete(args []string) error { - o.args = args - return nil -} - -func (o *exportOptions) Run(f factory.Factory) error { - req := f.RESTClient().R() - if len(o.args) > 0 { - req.SetQueryParam("names", strings.Join(o.args, ",")) - } - var ( - repos []api.Repository - errMsg echo.HTTPError - ) - u, err := f.MakeURL("api/v1/config") - if err != nil { - return err - } - resp, err := req. - SetResult(&repos). - SetError(&errMsg). - Get(u.String()) - if err != nil { - return fmt.Errorf("send request: %s", err) - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - if len(o.dir) > 0 { - for _, r := range repos { - data, _ := yaml.Marshal(r) - err := ioutil.WriteFile(filepath.Join(o.dir, r.Name+".yaml"), data, 0644) - if err != nil { - return err - } - } - return nil - } - return f.JSONEncoder(os.Stdout).Encode(repos) -} - -func NewCmdExport(f factory.Factory) *cobra.Command { - o := &exportOptions{} - cmd := &cobra.Command{ - Use: "export [name]", - Short: "Export config", - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) - }, - } - cmd.Flags().StringVarP(&o.dir, "dir", "d", "", "Dest directory") - return cmd -} diff --git a/pkg/yukictl/cmd/meta/ls.go b/pkg/yukictl/cmd/meta/ls.go index 9aaa8f4..2f2350d 100644 --- a/pkg/yukictl/cmd/meta/ls.go +++ b/pkg/yukictl/cmd/meta/ls.go @@ -2,104 +2,73 @@ package meta import ( "fmt" - "net/url" "os" "time" + "github.com/docker/go-units" "github.com/labstack/echo/v4" "github.com/spf13/cobra" "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/utils" + "github.com/ustclug/Yuki/pkg/tabwriter" "github.com/ustclug/Yuki/pkg/yukictl/factory" ) -type outputMeta struct { - api.Meta `json:",inline"` - Size string `json:"size"` - LastSuccess *time.Time `json:"lastSuccess,omitempty"` - CreatedAt *struct{} `json:"createdAt,omitempty"` // ignore - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - PrevRun *time.Time `json:"prevRun,omitempty"` - NextRun *time.Time `json:"nextRun,omitempty"` -} - -func (o *outputMeta) From(m api.Meta) *outputMeta { - o.Meta = m - o.Size = utils.PrettySize(m.Size) - if m.LastSuccess > 0 { - t := time.Unix(m.LastSuccess, 0) - o.LastSuccess = &t - } - if m.UpdatedAt > 0 { - t := time.Unix(m.UpdatedAt, 0) - o.UpdatedAt = &t - } - if m.PrevRun > 0 { - t := time.Unix(m.PrevRun, 0) - o.PrevRun = &t - } - if m.NextRun > 0 { - t := time.Unix(m.NextRun, 0) - o.NextRun = &t - } - return o -} - type lsOptions struct { name string } -func (o *lsOptions) Complete(args []string) error { - if len(args) > 0 { - o.name = args[0] - } - return nil -} - func (o *lsOptions) Run(f factory.Factory) error { var ( - u *url.URL err error errMsg echo.HTTPError ) req := f.RESTClient().R().SetError(&errMsg) encoder := f.JSONEncoder(os.Stdout) if len(o.name) > 0 { - u, err = f.MakeURL("api/v1/metas/%s", o.name) - if err != nil { - return err - } - var result api.Meta - resp, err := req.SetResult(&result).Get(u.String()) + var result api.GetRepoMetaResponse + resp, err := req. + SetResult(&result). + SetPathParam("name", o.name). + Get("api/v1/metas/{name}") if err != nil { return err } if resp.IsError() { return fmt.Errorf("%s", errMsg.Message) } - var out outputMeta - return encoder.Encode(out.From(result)) - } - u, err = f.MakeURL("api/v1/metas") - if err != nil { - return err + return encoder.Encode(result) } - var result []api.Meta - resp, err := req.SetResult(&result).Get(u.String()) + + var result api.ListRepoMetasResponse + resp, err := req.SetResult(&result).Get("api/v1/metas") if err != nil { return err } if resp.IsError() { return fmt.Errorf("%s", errMsg.Message) } - var outs []outputMeta + tw := tabwriter.New(os.Stdout) + tw.SetHeader([]string{"name", "upstream", "syncing", "size", "last-success", "next-run"}) for _, r := range result { - var out outputMeta - out.From(r) - outs = append(outs, out) + lastSuccess := "" + nextRun := "" + if r.LastSuccess > 0 { + lastSuccess = time.Unix(r.LastSuccess, 0).Format(time.RFC3339) + } + if r.NextRun > 0 { + nextRun = time.Unix(r.NextRun, 0).Format(time.RFC3339) + } + tw.Append( + r.Name, + r.Upstream, + r.Syncing, + units.BytesSize(float64(r.Size)), + lastSuccess, + nextRun, + ) } - return encoder.Encode(outs) + return tw.Render() } func NewCmdMetaLs(f factory.Factory) *cobra.Command { @@ -107,9 +76,11 @@ func NewCmdMetaLs(f factory.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "ls", Short: "List one or all metadata", - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) + RunE: func(cmd *cobra.Command, args []string) error { + if len(args) > 0 { + o.name = args[0] + } + return o.Run(f) }, } return cmd diff --git a/pkg/yukictl/cmd/reload.go b/pkg/yukictl/cmd/reload.go index 4ac851b..4eaa389 100644 --- a/pkg/yukictl/cmd/reload.go +++ b/pkg/yukictl/cmd/reload.go @@ -6,7 +6,6 @@ import ( "github.com/labstack/echo/v4" "github.com/spf13/cobra" - "github.com/ustclug/Yuki/pkg/utils" "github.com/ustclug/Yuki/pkg/yukictl/factory" ) @@ -14,24 +13,14 @@ type reloadOptions struct { repo string } -func (o *reloadOptions) Complete(args []string) error { - if len(args) > 0 { - o.repo = args[0] - } - return nil -} - func (o *reloadOptions) Run(f factory.Factory) error { req := f.RESTClient().R() - u, err := f.MakeURL("api/v1/repositories") - if err != nil { - return err - } + path := "api/v1/repos" if len(o.repo) > 0 { - u.Path += "/" + o.repo + path += "/" + o.repo } var errMsg echo.HTTPError - resp, err := req.SetError(&errMsg).Post(u.String()) + resp, err := req.SetError(&errMsg).Post(path) if err != nil { return err } @@ -51,9 +40,11 @@ func NewCmdReload(f factory.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "reload [name]", Short: "Reload config of one or all repos", - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) + RunE: func(cmd *cobra.Command, args []string) error { + if len(args) > 0 { + o.repo = args[0] + } + return o.Run(f) }, } return cmd diff --git a/pkg/yukictl/cmd/repo/logs.go b/pkg/yukictl/cmd/repo/logs.go deleted file mode 100644 index cc18b9d..0000000 --- a/pkg/yukictl/cmd/repo/logs.go +++ /dev/null @@ -1,102 +0,0 @@ -package repo - -import ( - "fmt" - "io" - "os" - "strconv" - "time" - - "github.com/labstack/echo/v4" - "github.com/spf13/cobra" - - "github.com/ustclug/Yuki/pkg/api" - "github.com/ustclug/Yuki/pkg/tabwriter" - "github.com/ustclug/Yuki/pkg/utils" - "github.com/ustclug/Yuki/pkg/yukictl/factory" -) - -type logsOptions struct { - name string - tail uint8 - nth uint8 - stats bool -} - -func (o *logsOptions) Complete(cmd *cobra.Command, args []string) error { - o.name = args[0] - flags := cmd.Flags() - if flags.Changed("stats") && (flags.Changed("tail") || flags.Changed("nth")) { - return fmt.Errorf("--stats cannot be used with --tail or --nth") - } - return nil -} - -func (o *logsOptions) Run(cmd *cobra.Command, f factory.Factory) error { - u, err := f.MakeURL("api/v1/repositories/%s/logs", o.name) - if err != nil { - return err - } - - flags := cmd.Flags() - - var errMsg echo.HTTPError - req := f.RESTClient().R().SetError(&errMsg) - - if o.stats { - var stats []api.LogFileStat - resp, err := req. - SetQueryParam("stats", strconv.FormatBool(true)). - SetResult(&stats). - Get(u.String()) - if err != nil { - return err - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - printer := tabwriter.New(os.Stdout) - printer.SetHeader([]string{"name", "mtime", "size"}) - for _, s := range stats { - printer.Append(s.Name, s.Mtime.Format(time.RFC3339), utils.PrettySize(s.Size)) - } - return printer.Render() - } - - if flags.Changed("nth") { - req.SetQueryParam("n", strconv.FormatUint(uint64(o.nth), 10)) - } - if flags.Changed("tail") { - req.SetQueryParam("tail", strconv.FormatUint(uint64(o.tail), 10)) - } - - resp, err := req.SetDoNotParseResponse(true).Get(u.String()) - if err != nil { - return err - } - if resp.IsError() { - return fmt.Errorf("%s", errMsg.Message) - } - body := resp.RawBody() - defer body.Close() - _, err = io.Copy(os.Stdout, body) - return err -} - -func NewCmdRepoLogs(f factory.Factory) *cobra.Command { - o := logsOptions{} - cmd := &cobra.Command{ - Use: "logs", - Short: "View logs of the given repository", - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(cmd, args)) - utils.CheckError(o.Run(cmd, f)) - }, - } - flags := cmd.Flags() - flags.Uint8Var(&o.tail, "tail", 0, "Output the last N lines") - flags.Uint8VarP(&o.nth, "nth", "n", 0, "View the nth log file") - flags.BoolVar(&o.stats, "stats", false, "Get the information of log files") - return cmd -} diff --git a/pkg/yukictl/cmd/repo/ls.go b/pkg/yukictl/cmd/repo/ls.go index 6e4cadf..a5b691f 100644 --- a/pkg/yukictl/cmd/repo/ls.go +++ b/pkg/yukictl/cmd/repo/ls.go @@ -2,15 +2,14 @@ package repo import ( "fmt" - "net/url" "os" "github.com/labstack/echo/v4" "github.com/spf13/cobra" "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/model" "github.com/ustclug/Yuki/pkg/tabwriter" - "github.com/ustclug/Yuki/pkg/utils" "github.com/ustclug/Yuki/pkg/yukictl/factory" ) @@ -18,28 +17,16 @@ type repoLsOptions struct { name string } -func (o *repoLsOptions) Complete(args []string) error { - if len(args) > 0 { - o.name = args[0] - } - return nil -} - func (o *repoLsOptions) Run(f factory.Factory) error { var ( - u *url.URL err error errMsg echo.HTTPError ) req := f.RESTClient().R().SetError(&errMsg) encoder := f.JSONEncoder(os.Stdout) if len(o.name) > 0 { - u, err = f.MakeURL("api/v1/repositories/%s", o.name) - if err != nil { - return err - } - var result api.Repository - resp, err := req.SetResult(&result).Get(u.String()) + var result model.Repo + resp, err := req.SetResult(&result).SetPathParam("name", o.name).Get("api/v1/repos/{name}") if err != nil { return err } @@ -48,12 +35,9 @@ func (o *repoLsOptions) Run(f factory.Factory) error { } return encoder.Encode(result) } - u, err = f.MakeURL("api/v1/repositories") - if err != nil { - return err - } - var result []api.RepoSummary - resp, err := req.SetResult(&result).Get(u.String()) + + var result api.ListReposResponse + resp, err := req.SetResult(&result).Get("api/v1/repos") if err != nil { return err } @@ -63,12 +47,12 @@ func (o *repoLsOptions) Run(f factory.Factory) error { printer := tabwriter.New(os.Stdout) printer.SetHeader([]string{ "name", - "interval", + "cron", "image", "storage-dir", }) for _, r := range result { - printer.Append(r.Name, r.Interval, r.Image, r.StorageDir) + printer.Append(r.Name, r.Cron, r.Image, r.StorageDir) } return printer.Render() } @@ -78,9 +62,11 @@ func NewCmdRepoLs(f factory.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "ls", Short: "List one or all repositories", - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) + RunE: func(cmd *cobra.Command, args []string) error { + if len(args) > 0 { + o.name = args[0] + } + return o.Run(f) }, } return cmd diff --git a/pkg/yukictl/cmd/repo/repo.go b/pkg/yukictl/cmd/repo/repo.go index 10fef78..d25b60d 100644 --- a/pkg/yukictl/cmd/repo/repo.go +++ b/pkg/yukictl/cmd/repo/repo.go @@ -13,7 +13,6 @@ func NewCmdRepo(f factory.Factory) *cobra.Command { } cmd.AddCommand( NewCmdRepoLs(f), - NewCmdRepoLogs(f), NewCmdRepoRm(f), ) return cmd diff --git a/pkg/yukictl/cmd/repo/rm.go b/pkg/yukictl/cmd/repo/rm.go index 324191d..c014180 100644 --- a/pkg/yukictl/cmd/repo/rm.go +++ b/pkg/yukictl/cmd/repo/rm.go @@ -6,7 +6,6 @@ import ( "github.com/labstack/echo/v4" "github.com/spf13/cobra" - "github.com/ustclug/Yuki/pkg/utils" "github.com/ustclug/Yuki/pkg/yukictl/factory" ) @@ -14,20 +13,12 @@ type rmOptions struct { name string } -func (o *rmOptions) Complete(args []string) error { - o.name = args[0] - return nil -} - func (o *rmOptions) Run(f factory.Factory) error { - u, err := f.MakeURL("api/v1/repositories/%s", o.name) - if err != nil { - return err - } var errMsg echo.HTTPError resp, err := f.RESTClient().R(). SetError(&errMsg). - Delete(u.String()) + SetPathParam("name", o.name). + Delete("api/v1/repos/{name}") if err != nil { return err } @@ -44,10 +35,10 @@ func NewCmdRepoRm(f factory.Factory) *cobra.Command { Use: "rm", Short: "Remove repository from database", Example: " yukictl repo rm REPO", - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + o.name = args[0] + return o.Run(f) }, } } diff --git a/pkg/yukictl/cmd/sync.go b/pkg/yukictl/cmd/sync.go index 65c008e..2c91372 100644 --- a/pkg/yukictl/cmd/sync.go +++ b/pkg/yukictl/cmd/sync.go @@ -2,14 +2,10 @@ package cmd import ( "fmt" - "os" - "strconv" - "github.com/docker/docker/pkg/stdcopy" "github.com/labstack/echo/v4" "github.com/spf13/cobra" - "github.com/ustclug/Yuki/pkg/utils" "github.com/ustclug/Yuki/pkg/yukictl/factory" ) @@ -18,22 +14,16 @@ type syncOptions struct { name string } -func (o *syncOptions) Complete(args []string) error { - o.name = args[0] - return nil -} - func (o *syncOptions) Run(f factory.Factory) error { req := f.RESTClient().R() - u, err := f.MakeURL("api/v1/containers/%s", o.name) - if err != nil { - return err - } var errMsg echo.HTTPError + if o.debug { + req.SetQueryParam("debug", "true") + } resp, err := req. SetError(&errMsg). - SetQueryParam("debug", strconv.FormatBool(o.debug)). - Post(u.String()) + SetPathParam("name", o.name). + Post("api/v1/repos/{name}/sync") if err != nil { return err } @@ -41,36 +31,20 @@ func (o *syncOptions) Run(f factory.Factory) error { return fmt.Errorf("%s", errMsg.Message) } - if !o.debug { - fmt.Printf("Syncing <%s>\n", o.name) - return nil - } - - u.Path += "/logs" - resp, err = f.RESTClient().R(). - SetError(&errMsg). - SetDoNotParseResponse(true). - SetQueryParam("follow", strconv.FormatBool(true)). - Get(u.String()) - if err != nil { - return err - } - body := resp.RawBody() - defer body.Close() - _, err = stdcopy.StdCopy(os.Stdout, os.Stderr, body) - return err + fmt.Printf("Syncing <%s>\n", o.name) + return nil } func NewCmdSync(f factory.Factory) *cobra.Command { o := syncOptions{} cmd := &cobra.Command{ Use: "sync", - Args: cobra.MinimumNArgs(1), + Args: cobra.ExactArgs(1), Example: " yukictl sync REPO", Short: "Sync local repository with remote", - Run: func(cmd *cobra.Command, args []string) { - utils.CheckError(o.Complete(args)) - utils.CheckError(o.Run(f)) + RunE: func(cmd *cobra.Command, args []string) error { + o.name = args[0] + return o.Run(f) }, } cmd.Flags().BoolVarP(&o.debug, "debug", "v", false, "Debug mode") diff --git a/pkg/yukictl/factory/factory.go b/pkg/yukictl/factory/factory.go index b485692..c28ffb2 100644 --- a/pkg/yukictl/factory/factory.go +++ b/pkg/yukictl/factory/factory.go @@ -3,7 +3,6 @@ package factory import ( "encoding/json" "io" - "net/url" "github.com/go-resty/resty/v2" ) @@ -11,5 +10,4 @@ import ( type Factory interface { RESTClient() *resty.Client JSONEncoder(w io.Writer) *json.Encoder - MakeURL(format string, a ...interface{}) (*url.URL, error) } diff --git a/pkg/yukictl/factory/impl.go b/pkg/yukictl/factory/impl.go index 3770ef3..3cf62d1 100644 --- a/pkg/yukictl/factory/impl.go +++ b/pkg/yukictl/factory/impl.go @@ -5,16 +5,15 @@ import ( "io" "github.com/go-resty/resty/v2" - - "github.com/ustclug/Yuki/pkg/yukictl/globalflag" + "github.com/spf13/pflag" ) type factoryImpl struct { - *globalflag.FlagSet + remote string } func (f *factoryImpl) RESTClient() *resty.Client { - return resty.New() + return resty.New().SetBaseURL(f.remote) } func (f *factoryImpl) JSONEncoder(w io.Writer) *json.Encoder { @@ -23,9 +22,8 @@ func (f *factoryImpl) JSONEncoder(w io.Writer) *json.Encoder { return encoder } -func New(flags *globalflag.FlagSet) Factory { - s := factoryImpl{ - FlagSet: flags, - } +func New(flags *pflag.FlagSet) Factory { + s := factoryImpl{} + flags.StringVarP(&s.remote, "remote", "r", "http://127.0.0.1:9999/", "Remote address") return &s } diff --git a/pkg/yukictl/globalflag/flag.go b/pkg/yukictl/globalflag/flag.go deleted file mode 100644 index e2d4f19..0000000 --- a/pkg/yukictl/globalflag/flag.go +++ /dev/null @@ -1,31 +0,0 @@ -package globalflag - -import ( - "fmt" - "net/url" - "path" - - "github.com/spf13/pflag" -) - -type FlagSet struct { - remote string -} - -func (f *FlagSet) MakeURL(format string, args ...interface{}) (*url.URL, error) { - p := fmt.Sprintf(format, args...) - u, err := url.Parse(f.remote) - if err != nil { - return nil, fmt.Errorf("invalid url: %s", err) - } - u.Path = path.Join(u.Path, p) - return u, nil -} - -func (f *FlagSet) AddFlags(flags *pflag.FlagSet) { - flags.StringVarP(&f.remote, "remote", "r", "http://127.0.0.1:9999/", "Remote address") -} - -func New() *FlagSet { - return &FlagSet{} -} diff --git a/pkg/yukictl/register.go b/pkg/yukictl/register.go index 7c477d5..4f54840 100644 --- a/pkg/yukictl/register.go +++ b/pkg/yukictl/register.go @@ -4,7 +4,6 @@ import ( "github.com/spf13/cobra" "github.com/ustclug/Yuki/pkg/yukictl/cmd" - "github.com/ustclug/Yuki/pkg/yukictl/cmd/ct" "github.com/ustclug/Yuki/pkg/yukictl/cmd/meta" "github.com/ustclug/Yuki/pkg/yukictl/cmd/repo" "github.com/ustclug/Yuki/pkg/yukictl/factory" @@ -13,11 +12,9 @@ import ( func Register(root *cobra.Command, f factory.Factory) { root.AddCommand( cmd.NewCmdCompletion(), - ct.NewCmdContainer(f), - cmd.NewCmdExport(f), - meta.NewCmdMeta(f), cmd.NewCmdReload(f), - repo.NewCmdRepo(f), cmd.NewCmdSync(f), + meta.NewCmdMeta(f), + repo.NewCmdRepo(f), ) } diff --git a/test/fixtures/normal.toml b/test/fixtures/normal.toml deleted file mode 100644 index fa9d5aa..0000000 --- a/test/fixtures/normal.toml +++ /dev/null @@ -1,7 +0,0 @@ -fs = "default" - -db_name = "test" - -log_dir = "/tmp/log_yuki/" - -repo_config_dir = "/tmp/config_yuki" diff --git a/test/fixtures/repo/test.yaml b/test/fixtures/repo/test.yaml deleted file mode 100644 index a3ab97b..0000000 --- a/test/fixtures/repo/test.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: test # required -image: ustcmirror/rsync:latest # required -interval: 2 2 31 4 * # required -storageDir: /srv/repo/test # required -logRotCycle: 1 # 保留多少次同步日志 -bindIP: 1.2.3.4 -network: cernet -retry: 2 # 同步失败后的重试次数 -envs: # 传给同步程序的环境变量 - RSYNC_HOST: rsync.exmaple.com - RSYNC_PATH: / - RSYNC_RSH: ssh -i /home/mirror/.ssh/id_rsa - RSYNC_USER: bioc-rsync - $UPSTREAM: rsync://rsync.example.com/ # 可选变量,设置 yuki 显示的同步上游 -volumes: # 同步的时候需要挂载的 volume - # 注意: 由于 MongoDB 的限制,key 不能包含 `.` - /etc/passwd: /etc/passwd:ro - /ssh: /home/mirror/.ssh:ro \ No newline at end of file diff --git a/test/fixtures/sync_timeout.toml b/test/fixtures/sync_timeout.toml deleted file mode 100644 index c52943d..0000000 --- a/test/fixtures/sync_timeout.toml +++ /dev/null @@ -1,9 +0,0 @@ -fs = "default" - -db_name = "test" - -log_dir = "/tmp/log_yuki/" - -repo_config_dir = "/tmp/config_yuki" - -sync_timeout = "15s" \ No newline at end of file diff --git a/test/integration/sync_test.go b/test/integration/sync_test.go new file mode 100644 index 0000000..2275c1d --- /dev/null +++ b/test/integration/sync_test.go @@ -0,0 +1,77 @@ +package integration + +import ( + "context" + "os" + "path/filepath" + "testing" + "time" + + "github.com/go-resty/resty/v2" + "github.com/stretchr/testify/require" + + "github.com/ustclug/Yuki/pkg/api" + "github.com/ustclug/Yuki/pkg/server" + testutils "github.com/ustclug/Yuki/test/utils" +) + +func TestSyncRepo(t *testing.T) { + tmpdir, err := os.MkdirTemp("", t.Name()) + require.NoError(t, err) + t.Cleanup(func() { + _ = os.RemoveAll(tmpdir) + }) + logDir := filepath.Join(tmpdir, "log") + cfgDir := filepath.Join(tmpdir, "config") + os.MkdirAll(logDir, 0755) + os.MkdirAll(cfgDir, 0755) + + cfg := server.DefaultConfig + cfg.DbURL = filepath.Join(tmpdir, "yukid.db") + cfg.RepoConfigDir = []string{cfgDir} + cfg.RepoLogsDir = logDir + cfg.ListenAddr = "127.0.0.1:0" + srv, err := server.NewWithConfig(cfg) + require.NoError(t, err) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go func() { + err := srv.Start(ctx) + if err != nil { + t.Errorf("Fail to start server: %v", err) + } + cancel() + }() + + testutils.WriteFile(t, filepath.Join(cfgDir, "foo.yaml"), ` +name: "foo" +cron: "@every 1h" +image: "ustcmirror/test:latest" +storageDir: "/tmp" +`) + + time.Sleep(3 * time.Second) + if t.Failed() { + return + } + restCli := resty.New().SetBaseURL("http://" + srv.ListenAddr()) + resp, err := restCli.R().Post("/api/v1/repos/foo") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + resp, err = restCli.R().Post("/api/v1/repos/foo/sync") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + + var meta api.GetRepoMetaResponse + testutils.PollUntilTimeout(t, 5*time.Minute, func() bool { + resp, err = restCli.R().SetResult(&meta).Get("/api/v1/metas/foo") + require.NoError(t, err) + require.True(t, resp.IsSuccess(), "Unexpected response: %s", resp.Body()) + if !meta.Syncing { + return true + } + t.Log("Waiting for syncing to finish") + return false + }) +} diff --git a/test/utils/utils.go b/test/utils/utils.go new file mode 100644 index 0000000..0ac879f --- /dev/null +++ b/test/utils/utils.go @@ -0,0 +1,35 @@ +package utils + +import ( + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func PollUntilTimeout(t *testing.T, timeout time.Duration, f func() bool) { + timer := time.NewTimer(timeout) + ticker := time.NewTicker(time.Second) + t.Cleanup(func() { + if !timer.Stop() { + <-timer.C + } + ticker.Stop() + }) +loop: + for { + select { + case <-ticker.C: + if f() { + break loop + } + case <-timer.C: + t.Fatal("Timeout") + } + } +} + +func WriteFile(t *testing.T, path, content string) { + require.NoError(t, os.WriteFile(path, []byte(content), 0o644)) +}