diff --git a/.gitignore b/.gitignore index 9a318ce..3b735ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,21 @@ -docker-registry-watcher -registrywatcher -*.toml -!test.toml -!sample.toml +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib -# dependencies -node_modules +# Test binary, built with `go test -c` +*.test -# logs -npm-debug.log +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9e11e06..0000000 --- a/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM golang:1.17-alpine as builder -ARG UPX_VERSION=3.95 - -WORKDIR /app - -# Cache the fetched Go packages -RUN apk add --no-cache gcc git musl-dev -COPY ./go.mod ./go.sum ./ -RUN go mod download - -# Then build the binary -COPY ./ ./ - -RUN set -euo pipefail && \ - go build -v -ldflags "-linkmode external -extldflags -static -s -w"; \ - wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz; \ - tar xvf upx-${UPX_VERSION}-amd64_linux.tar.xz; \ - mv upx-${UPX_VERSION}-amd64_linux/upx /usr/local/bin/; \ - rm -r upx-${UPX_VERSION}-amd64_linux upx-${UPX_VERSION}-amd64_linux.tar.xz; \ - upx --best --lzma registrywatcher; \ - : - -FROM alpine:3.9 as release -WORKDIR /app -RUN apk add --no-cache ca-certificates -COPY --from=builder /app/registrywatcher ./ -# in practice this Dockerfile should never be run without interpolating a config file inside ./config - -CMD ["/app/registrywatcher"] diff --git a/Dockerfile-golang b/Dockerfile-golang deleted file mode 100644 index 5889093..0000000 --- a/Dockerfile-golang +++ /dev/null @@ -1,4 +0,0 @@ -FROM golang:1.17-alpine - -# Only install hard dependencies -RUN apk add --no-cache gcc git musl-dev make diff --git a/Makefile b/Makefile index 8db9974..453c060 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,41 @@ -all: fmt test +all: fmt lint test test: - @echo "-- running tests --" - go test ./... - @echo "-- tests done --\n\n" + @echo "====================================" + @echo "########## Running tests ##########" + @echo "====================================" + @ENV=test go test ./... + @echo "================= OK =================" + @echo "" fmt: - @echo "-- running formatter --" - go fmt ./... - @echo "-- formatter done --\n\n" \ No newline at end of file + @echo "====================================" + @echo "######### Formatting code ##########" + @echo "====================================" + @goimports-reviser -rm-unused -imports-order "std,company,project,general" ./... + @gofmt -l -w . + @echo "================= OK =================" + @echo "" + +fmt-check: + @echo "====================================" + @echo "####### Checking Formatting ########" + @echo "====================================" + @goimports-reviser -list-diff -imports-order "std,company,project,general" ./... + @files=$(gofmt -l .) && [ -z "$files" ] + @echo "================= OK =================" + @echo "" + +lint: + @echo "====================================" + @echo "########## Linting code ###########" + @echo "====================================" + @golangci-lint run + @echo "================= OK =================" + @echo "" + +test-env: + ./env/test/script.sh + +dev: + docker compose -f env/dev/docker-compose.yml up --build \ No newline at end of file diff --git a/README.md b/README.md index 30dadb0..2c378e3 100644 --- a/README.md +++ b/README.md @@ -1,148 +1,13 @@ -# Registrywatcher +# registrywatcher -![Frontend](public/gifs/search.gif) +This is my idealised template for a golang service. -Watches docker registries for new tags on selected repositories. +## Features -The service maintains an internal state stored in Postgres for each watched repository for `pinned_tag` and `auto_deploy` +- [x] Developer Tooling +- [x] Makefile +- [x] Docker-compose +- [x] Linting +- [x] Testing -`pinned_tag"` is set to an empty string by default. `pinned_tag=""` has a special meaning within this service. It enables the auto-deployment feature for versioned tags, (i.e. a new tag `v1.0.0` will be autodeployed if the current deployed tag is `v0.9.0`) - -`pinned_tag` can also be set to a custom tag through the `/tags/$REPO_NAME` endpoint. Auto deployment for custom tags happen if the docker content digest of of the tag changes (i.e. the tagged docker image was overwritten). - -`auto_deploy` determines whether auto deployment is enabled for both custom tags and versiomed tags. - -Currently only Nomad is supported as the deployment client. - -## Configuration - -Before running the service locally or in production, the config file `config/staging.toml` must be present. A template is provided in config/sample.toml with sensible defaults. Most should be left alone unless you're developing `registrywatcher` itself. However, there are a few you may want to change in a production environment. -A sample config file template has been provided in `config/sample.toml` - -## Endpoints - -```yml -- url: /ping/ - method: GET - - Response: - - message: string - - description: Returns "pong", for health check. -``` - -```yml -- url: /tags/$REPO_NAME/reset - method: POST - - JSON Body Request: - - N/A - - Response: - - message: string - - description: To reset the pinned_tag to latest, which is the default value. See top of the README for more info. -``` - -```yml -- url: /tags/$REPO_NAME - method: POST - - JSON Body Request: (at least 1 argument provided) - - pinned_tag: string (no default) - - auto_deploy: bool (no default) - - Response: - - message: string - - description: To update the pinned_tag for the given repo_name and deploy it regardless of current deployed tag. -``` - -```yml -- url: /tags/$REPO_NAME - method: GET - - 200 Response: - - repo_tag: string - - 400 Response: - - message: string - - description: To get the pinned_tag value for the given $REPO_NAME. -``` - -```yml -- url: /repos - method: GET - - 200 Response: - - $REPO1_NAME(string): - - "auto_deploy": bool - - "pinned_tag": string - - "pinned_tag_value": string - - "tags": [string, ...] - ... - - description: To get the pinned_tag value for all watched repositories. -``` - -## Local development - -`docker-compose up -d` - -## Deployment - -Config files are located in `$PROJ_ROOT/config`. It's best for the config file to be interpolated with the necessary values during deployment, i.e. repositories to be watched, nomad token. A sample config file is provided anyway for running locally (with sensitive information left to be filled in by the user) - -The following environment variables must be present for deployment: -- `DATABASE_URL` to connect to the postgres db (if not present `database_url` in config file will be used) -- `NOMAD_TOKEN` to access the nomad API - -The following environment variables are optional: -- `VAULT_TOKEN` to run the nomad job associated with a watched repo, if the nomad job has Vault secrets. - -The configuration file must be interpolated by Nomad to fill the following information: -- `registry_auth ` for each of the supported registries -- `watched_repositories` lists all the repositories to watch for -- key value pairs in `repo_map`, which maps the docker registry and nomad job name of each watched repositories - -## Test setup - -Ports 5000 and 5432 need to be free as they are currently hardcoded for the registry and postgres container respectively. -https://stackoverflow.com/questions/48593016/postgresql-docker-role-does-not-exist - -You need to make one modification to your docker daemon config (usually at ~/.docker/daemon.json) - -Add the flag `--insecure-registry localhost:5000` to your docker daemon, documented [here](https://docs.docker.com/registry/insecure/) for testing against an insecure registry. - -You may need to update the certificates from time to time. To do so, run - -```bash -make snakeoil -``` - -## Tests - -Run locally: - -```bash -// run both integration and unit tests -gotestsum -- -tags="integration unit" ./... - -// clean testcache -go clean -testcache -``` - -The tests don't test the nomad deployment capability of the service. - -## TODO - -An interface to swap in the deployment agent (only Nomad supported for now). - -Tests take too long to run, this is mainly due each integration test case spinning up and down its own docker containers. - -Nomad mock server cannot run jobs, which blocks writing of integration tests involving Nomad API calls - -Buttons should implement debouncing - -Bug where only new tags/SHA changes AFTER you toggle back auto deployment will trigger an update, meaning any updates during the window where auto deployment was turned off are moot. +## Usage diff --git a/app/health/handlers.go b/app/health/handlers.go new file mode 100644 index 0000000..e2b626c --- /dev/null +++ b/app/health/handlers.go @@ -0,0 +1,13 @@ +package health + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func PingHandler(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{ + "message": "pong", + }) +} diff --git a/app/models/repository.go b/app/models/repository.go new file mode 100644 index 0000000..29dd1ca --- /dev/null +++ b/app/models/repository.go @@ -0,0 +1,19 @@ +package models + +type Repository struct { + RepositoryName string `gorm:"not null;unique;primaryKey" binding:"required"` + PinnedTag string `gorm:"not null;unique" binding:"required,email"` + AutoDeploy bool `gorm:"not null" binding:"required"` + Tags []Tag `gorm:"foreignKey:RepositoryID"` +} + +func (r Repository) TableName() string { + return "deployed_repository_version" +} + +type Tag struct { + ID uint `gorm:"primaryKey"` + TagName string `gorm:"not null" binding:"required"` + Digest string `gorm:"not null" binding:"required"` + RepositoryID string +} diff --git a/app/repository/schema.go b/app/repository/schema.go new file mode 100644 index 0000000..f3c4f0a --- /dev/null +++ b/app/repository/schema.go @@ -0,0 +1,16 @@ +package repository + +type GetReposiroriesRequest struct { + RecipientID uint `form:"recipient_id" binding:"required"` +} + +type GetRepositoriesResponse struct { + RepositoryMap map[string]RepositoryData +} + +type RepositoryData struct { + AutoDeploy bool `json:"auto_deploy"` + PinnedTag string `json:"pinned_tag"` + PinnedTagValue string `json:"pinned_tag_value"` + Tags []string `json:"tags"` +} \ No newline at end of file diff --git a/app/repository/service.go b/app/repository/service.go new file mode 100644 index 0000000..3702a32 --- /dev/null +++ b/app/repository/service.go @@ -0,0 +1,43 @@ +package repository + +import ( + "net/http" + "registrywatcher/app/models" + "registrywatcher/utilities/config" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +type RepositoryService struct { + DB *gorm.DB + Config *config.Config + // Sender external.Sender +} + +// GetRepositories is a handler that returns a list of repositories +func (m RepositoryService) GetRepositories(c *gin.Context) { + + var repositories []models.Repository + if err := m.DB.Preload("Tags").Find(&repositories).Error; err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return + } + + response := map[string]RepositoryData{} + + for _, repo := range repositories { + tags := []string{} + for _, tag := range repo.Tags { + tags = append(tags, tag.TagName) + } + + response[repo.RepositoryName] = RepositoryData{ + AutoDeploy: repo.AutoDeploy, + PinnedTag: repo.PinnedTag, + PinnedTagValue: repo.PinnedTag, + Tags: tags, + } + } + c.JSON(http.StatusOK, response) +} diff --git a/client/client.go b/client/client.go deleted file mode 100644 index f393130..0000000 --- a/client/client.go +++ /dev/null @@ -1,295 +0,0 @@ -package client - -import ( - "fmt" - "reflect" - "sort" - "sync" - - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/dsaidgovsg/registrywatcher/utils" - "github.com/spf13/viper" -) - -type Clients struct { - NomadClient *NomadClient - DockerRegistryClient *DockerRegistryClient - PostgresClient *PostgresClient - DockerhubApi *DockerhubApi - DockerTags sync.Map - DigestMap sync.Map -} - -func SetUpClients(conf *viper.Viper) *Clients { - postgresClient, err := InitializePostgresClient(conf) - if err != nil { - panic(fmt.Errorf("starting postgres client failed: %v", err)) - } - dockerClient := InitializeDockerRegistryClient(conf) - dockerhubApi, err := InitializeDockerhubApi(conf) - if err != nil { - log.LogAppErr("error initializing dockerhub API client", err) - } - - // caching fields - dockerTags := sync.Map{} - digestMap := sync.Map{} - for _, repoName := range conf.GetStringSlice("watched_repositories") { - dockerTags.Store(repoName, []string{}) - digestMap.Store(repoName, "") - } - clients := Clients{ - NomadClient: InitializeNomadClient(conf), - PostgresClient: postgresClient, - DockerRegistryClient: dockerClient, - DockerhubApi: dockerhubApi, - DockerTags: dockerTags, - DigestMap: digestMap, - } - return &clients -} - -func (client *Clients) GetCachedTags(repoName string) ([]string, error) { - rtn, ok := client.DockerTags.Load(repoName) - if !ok { - return []string{}, fmt.Errorf("Couldn't read tags from cache error") - } - rtnSlice, ok := rtn.([]string) - - if !ok { - return []string{}, fmt.Errorf( - "Unsupported type %v, type stored in tags cache should be string slice", rtn) - } else { - return rtnSlice, nil - } -} - -func (client *Clients) GetCachedTagDigest(repoName string) (string, error) { - rtn, ok := client.DigestMap.Load(repoName) - if !ok { - return "", fmt.Errorf("Couldn't read tag digest from cache error") - } - rtnString, ok := rtn.(string) - - if !ok { - return "", fmt.Errorf( - "Unsupported type %v, type stored in digest cache should be string", rtn) - } else { - return rtnString, nil - } -} - -// fetches the CACHED pinned tag -func (client *Clients) GetFormattedPinnedTag(repoName string) (string, error) { - pinnedTag, err := client.PostgresClient.GetPinnedTag(repoName) - if err != nil { - return "", err - } - if pinnedTag == "" { - tags, err := client.GetCachedTags(repoName) - if err != nil { - return "", err - } - pinnedTag, err = utils.GetLatestReleaseTag(tags) - } - return pinnedTag, err -} - -func (client *Clients) DeployPinnedTag(conf *viper.Viper, repoName string) { - pinnedTag, err := client.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while deploying pinned tag for %s", repoName), err) - return - } - jobID := utils.GetRepoNomadJob(conf, repoName) - taskName := utils.GetRepoNomadTaskName(conf, repoName) - client.NomadClient.UpdateNomadJobTag(jobID, repoName, taskName, pinnedTag) - // update after deploying new sha, so it will not trigger autodeployment - client.updateCaches(repoName) -} - -func (client *Clients) PopulateCaches(repoName string) { - // populate tags - tags, err := client.getSHATags(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch docker tags from registry while populating cache for %s", repoName), err) - return - } - validTags := utils.FilterSHATags(tags) - client.updateTagsCache(repoName, validTags) - - // populate digest - pinnedTag, err := client.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while populating cache for %s", repoName), err) - } - tagDigest, err := client.DockerhubApi.GetTagDigestFromApi(repoName, pinnedTag) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tag digest from Dockerhub while populating cache for %s", repoName), err) - return - } - client.updateDigestCache(repoName, *tagDigest) -} - -func (client *Clients) isNewReleaseTagAvailable(repoName string) bool { - registryTags, err := client.getSHATags(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch docker tags from registry checking if new release available for for %s", repoName), err) - return false - } - if len(registryTags) == 0 { - return false - } - - cachedTags, err := client.GetCachedTags(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tags from cache while checking if new release available for for %s", repoName), err) - return false - } - - if reflect.DeepEqual(registryTags, cachedTags) { - return false - } - - // a new versioned tag doesn't necessarily mean it's the latest - latestTagOld, err1 := utils.GetLatestReleaseTag(cachedTags) - if err1 != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch latest tag from registry while checking if new release available for %s", repoName), err) - return false - } - - latestTagNew, err2 := utils.GetLatestReleaseTag(registryTags) - if err2 != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch latest tag from cache while checking if new release available for for %s", repoName), err) - return false - } - - if utils.TagToNumber(latestTagNew) > utils.TagToNumber(latestTagOld) { - return true - } - - return false -} - -// fetches from docker registry -func (client *Clients) getSHATags(repoName string) ([]string, error) { - tags, err := client.DockerRegistryClient.GetAllTags(repoName) - if len(tags) == 0 { - return []string{}, err - } - validTags := utils.FilterSHATags(tags) - sort.Strings(validTags) - return validTags, nil -} - -func (client *Clients) updateTagsCache(repoName string, tags []string) { - client.DockerTags.Store(repoName, tags) -} - -func (client *Clients) updateDigestCache(repoName string, digest string) { - client.DigestMap.Store(repoName, digest) -} - -func (client *Clients) isPinnedTagDeployed(conf *viper.Viper, repoName string) (bool, error) { - jobID := utils.GetRepoNomadJob(conf, repoName) - deployedTag, err := client.NomadClient.GetNomadJobTag(jobID, repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch nomad job tag while checking deployed tag for %s", repoName), err) - return false, err - } - pinnedTag, err := client.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while checking deployed tag for %s", repoName), err) - return false, err - } - return deployedTag == pinnedTag, nil -} - -func (client *Clients) isTagDigestChanged(repoName string) (bool, error) { - pinnedTag, err := client.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while checking if it was changed for %s", repoName), err) - return false, err - } - cachedTagDigest, err := client.GetCachedTagDigest(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tag digest from cache while checking if it was changed for %s", repoName), err) - return false, err - } - digestIsCurrent, err := client.DockerhubApi.CheckImageIsCurrent(repoName, cachedTagDigest, pinnedTag) - if err != nil { - log.LogAppErr("Couldn't check if tag currently points to cached image digest", err) - return false, err - } - - return !*digestIsCurrent, nil -} - -func (client *Clients) updateCaches(repoName string) { - validTags, err := client.getSHATags(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tags from registry while updating cache for %s", repoName), err) - return - } - client.updateTagsCache(repoName, validTags) - - isDigestChanged, err := client.isTagDigestChanged(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't check tag digest changed while updating cache for %s", repoName), err) - return - } - if isDigestChanged { - pinnedTag, err := client.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while updating cache for %s", repoName), err) - return - } - tagDigest, err := client.DockerhubApi.GetTagDigestFromApi(repoName, pinnedTag) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tag digest from registry while updating cache for %s", repoName), err) - return - } - - // log update - cachedTagDigest, err := client.GetCachedTagDigest(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tag digest from cache while updating cache for %s", repoName), err) - return - } - log.LogAppInfo(fmt.Sprintf("cached digest: %s, new digest: %s", cachedTagDigest, *tagDigest)) - - client.updateDigestCache(repoName, *tagDigest) - } -} - -// this function compares cached values with the actual values, -// so only update the cache before returning non-error cases -func (client *Clients) ShouldDeploy(repoName string) (bool, error) { - autoDeploy, err := client.PostgresClient.GetAutoDeployFlag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch whether to deploy flag while checking whether to deploy for %s", repoName), err) - return false, err - } - if !autoDeploy { - client.updateCaches(repoName) - return false, nil - } - - pinnedTag, err := client.PostgresClient.GetPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag while checking whether to deploy for %s", repoName), err) - return false, err - } - isDigestChanged, err := client.isTagDigestChanged(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't check tag digest changed while checking whether to deploy for %s", repoName), err) - return false, err - } - - if (pinnedTag == "" && client.isNewReleaseTagAvailable(repoName)) || isDigestChanged { - client.updateCaches(repoName) - return true, nil - } - client.updateCaches(repoName) - return false, nil -} diff --git a/client/docker_registry_client.go b/client/docker_registry_client.go deleted file mode 100644 index d8d0e76..0000000 --- a/client/docker_registry_client.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/dsaidgovsg/registrywatcher/registry" - "github.com/dsaidgovsg/registrywatcher/utils" - "github.com/spf13/viper" -) - -type DockerRegistryClient struct { - Hubs map[string]registry.Registry - conf *viper.Viper -} - -func InitializeDockerRegistryClient(conf *viper.Viper) *DockerRegistryClient { - watchedRepositories := conf.GetStringSlice("watched_repositories") - drc := DockerRegistryClient{ - Hubs: make(map[string]registry.Registry, len(watchedRepositories)), - } - for _, repoName := range watchedRepositories { - registryScheme, registryDomain, registryPrefix, registryAuth := utils.ExtractRegistryInfo(conf, repoName) - registryUrl := fmt.Sprintf("%s://%s", registryScheme, registryDomain) - username, password, err := utils.DecodeAuthString(registryAuth) - if err != nil { - panic(fmt.Errorf("docker auth string not valid: %v", err)) - } - scope := fmt.Sprintf("repository:%s/%s:pull,push", registryPrefix, repoName) - var hub *registry.Registry - hub, err = registry.New(registryUrl, scope, username, password) - if err != nil { - panic(fmt.Errorf("starting docker registry client failed: %v", err)) - } - drc.Hubs[repoName] = *hub - } - - drc.conf = conf - return &drc -} - -func (e *DockerRegistryClient) GetAllTags(repoName string) ([]string, error) { - _, _, registryPrefix, _ := utils.ExtractRegistryInfo(e.conf, repoName) - repoRegistry := e.Hubs[repoName] - tags, err := repoRegistry.Tags(fmt.Sprintf("%s/%s", registryPrefix, repoName)) - return tags, err -} diff --git a/client/dockerhub_api_client.go b/client/dockerhub_api_client.go deleted file mode 100644 index e40cd91..0000000 --- a/client/dockerhub_api_client.go +++ /dev/null @@ -1,209 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/pkg/errors" - "github.com/spf13/viper" -) - -type DockerhubApi struct { - url string - namespace string - token string - username string - secret string -} - -type AuthenticateResp struct { - Token string `json:"token"` -} - -type GetRepoTagsResp struct { - Results []RepoTag `json:"results"` -} - -type RepoTag struct { - // Tag string `json:"tag"` - // IsCurrent bool `json:"is_current"` - Name string `json:"name"` - Images []RepoImage `json:"images"` -} - -type RepoImage struct { - Digest string `json:"digest"` -} - -type GetTagDigestResp struct { - Results []GetTagDigestResult `json:"results"` -} - -type GetTagDigestResult struct { - Digest string `json:"digest"` - Tags []RepoTag `json:"tags"` -} - -func InitializeDockerhubApi(conf *viper.Viper) (*DockerhubApi, error) { - client := DockerhubApi{ - url: conf.GetString("dockerhub_url"), - namespace: conf.GetString("dockerhub_namespace"), - username: conf.GetString("dockerhub_username"), - secret: conf.GetString("dockerhub_secret"), - token: "", - } - - jwt, err := client.Authenticate() - if err != nil { - return &client, err - } - - client.token = *jwt - return &client, nil -} - -func (api *DockerhubApi) Authenticate() (*string, error) { - addr := fmt.Sprintf("%s%s", api.url, "/v2/users/login") - log.LogAppInfo(fmt.Sprintf("dockerhub.users.login url=%s", addr)) - - data := map[string]string{"username": api.username, "password": api.secret} - jsonData, err := json.Marshal(data) - - req, err := http.NewRequest("POST", addr, bytes.NewBuffer(jsonData)) - req.Header.Set("Content-Type", "application/json") - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - - if resp.StatusCode != http.StatusOK { - log.LogAppInfo("Error obtaining JWT") - errMsg := fmt.Sprintf("Response status %d message %s", resp.StatusCode, string(body)) - return nil, errors.New(errMsg) - } - - var deserialized AuthenticateResp - json.Unmarshal(body, &deserialized) - - return &deserialized.Token, nil -} - -func (api *DockerhubApi) CheckImageIsCurrent(repository, digest string, tagName string) ( - *bool, error) { - endpoint := fmt.Sprintf("/v2/namespaces/%s/repositories/%s/tags", api.namespace, repository) - addr := fmt.Sprintf("%s%s", api.url, endpoint) - log.LogAppInfo(fmt.Sprintf("dockerhub check if image is current, url=%s", addr)) - - req, err := http.NewRequest("GET", addr, nil) - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", api.token)) - req.Header.Set("Accept", "application/json") - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - // Obtain JWT if it has expired - if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { - log.LogAppInfo("Obtaining new JWT") - jwt, err := api.Authenticate() - if err != nil { - return nil, err - } - - api.token = *jwt - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", api.token)) - resp, err = http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - } - - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - - if resp.StatusCode != http.StatusOK { - errMsg := fmt.Sprintf("Response status %d message %s", resp.StatusCode, string(body)) - return nil, errors.New(errMsg) - } - - var deserialized GetRepoTagsResp - json.Unmarshal(body, &deserialized) - - for _, item := range deserialized.Results { - if item.Name == tagName { - isCurrent := item.Images[0].Digest == digest - return &isCurrent, nil - } - } - // image tag does not match the tag to be checked - // this means the cached digest belongs to a previous tag - // return false (not current) because we want the cache to be updated - log.LogAppInfo(fmt.Sprintf(fmt.Sprintf("Digest %s does not have tag %s", digest, tagName))) - isCurrent := false - return &isCurrent, nil -} - -// Note that the digest returned from the Dockerhub API does not match -// the digest from docker registry manifest V2 API -func (api *DockerhubApi) GetTagDigestFromApi(repository string, tagName string) ( - *string, error) { - endpoint := fmt.Sprintf("/v2/namespaces/%s/repositories/%s/tags", api.namespace, repository) - queryParams := fmt.Sprintf("currently_tagged=%s&page_size=%s&ordering=%s", "true", - "100", "-last_activity") - - addr := fmt.Sprintf("%s%s%s", api.url, endpoint, queryParams) - log.LogAppInfo(fmt.Sprintf("dockerhub get tag digest url=%s", addr)) - - req, err := http.NewRequest("GET", addr, nil) - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", api.token)) - req.Header.Set("Accept", "application/json") - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - // Obtain JWT if it has expired - if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { - log.LogAppInfo("Obtaining new JWT") - jwt, err := api.Authenticate() - if err != nil { - return nil, err - } - - api.token = *jwt - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", api.token)) - resp, err = http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - } - - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - - if resp.StatusCode != http.StatusOK { - errMsg := fmt.Sprintf("Response status %d message %s", resp.StatusCode, string(body)) - return nil, errors.New(errMsg) - } - - var deserialized GetRepoTagsResp - json.Unmarshal(body, &deserialized) - - for _, item := range deserialized.Results { - if item.Name == tagName { - return &item.Images[0].Digest, nil - } - } - - // image tag not found in repository's 100 last active tags - return nil, errors.New(fmt.Sprintf("Tag %s not found in repository %s", tagName, repository)) -} diff --git a/client/nomad_client.go b/client/nomad_client.go deleted file mode 100644 index f975375..0000000 --- a/client/nomad_client.go +++ /dev/null @@ -1,202 +0,0 @@ -package client - -import ( - "fmt" - "os" - "strings" - "time" - - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/dsaidgovsg/registrywatcher/utils" - nomad "github.com/hashicorp/nomad/api" - "github.com/spf13/viper" -) - -type NomadClient struct { - nc *nomad.Client - conf *viper.Viper -} - -func InitializeNomadClient(conf *viper.Viper) *NomadClient { - rtn := NomadClient{} - config := nomad.DefaultConfig() - client, err := nomad.NewClient(config) - - if err != nil { - panic(fmt.Errorf("starting nomad client failed: %v", err)) - } - - rtn.nc = client - rtn.conf = conf - return &rtn -} - -func getNomadJobTagFromTask(task *nomad.Task) string { - rtnArray := strings.Split(task.Config["image"].(string), ":") - return rtnArray[1] -} - -func getNomadJobImageFromTask(task *nomad.Task) string { - rtnArray := strings.Split(task.Config["image"].(string), ":") - return rtnArray[0] -} - -func (client *NomadClient) getNomadJob(jobID string) (nomad.Job, error) { - job, _, err := client.nc.Jobs().Info(jobID, nil) - if err != nil { - return nomad.Job{}, err - } - return *job, nil -} - -func (client *NomadClient) GetNomadJobTag(jobID, imageName string) (string, error) { - job, err := client.getNomadJob(jobID) - if err != nil { - return "", err - } - var tag string - for i, taskGroup := range job.TaskGroups { - for j, task := range taskGroup.Tasks { - fullImageName := getNomadJobImageFromTask(task) - arr := strings.Split(fullImageName, "/") - taskImageName := arr[len(arr)-1] - if taskImageName == imageName { - tag = getNomadJobTagFromTask(job.TaskGroups[i].Tasks[j]) - } - } - } - return tag, nil -} - -// Updates one image in a Nomad job, unless the Nomad jobspec is registrywatcher itself. -// Since the registrywatcher Nomad jobspec contains 2 images (UI and backend), it will update -// both images before it restarts itself. -func (client *NomadClient) UpdateNomadJobTag(jobID, imageName, taskName, desiredTag string) { - _, registryDomain, registryPrefix, _ := utils.ExtractRegistryInfo(client.conf, imageName) - desiredFullImageName := utils.ConstructImageName(registryDomain, registryPrefix, imageName, desiredTag) - matchFound := false - log.LogAppInfo(fmt.Sprintf("Full image name to deploy %s", desiredFullImageName)) - job, err := client.getNomadJob(jobID) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't find jobID %s", jobID), err) - return - } - for i, taskGroup := range job.TaskGroups { - for j, task := range taskGroup.Tasks { - if task.Name == taskName { - matchFound = true - // to avoid unexpected issues we use the prefix from config - // its possible that what is deployed may be from a different registry - job.TaskGroups[i].Tasks[j].Config["image"] = desiredFullImageName - // nomad jobs with this config set to false may end up - // with this config as true in the process of calling this endpoint - job.TaskGroups[i].Tasks[j].Config["force_pull"] = true - } - // bootstrapping. the nomad job "registrywatcher" also contains - // a task/container of the ui image. - if taskName == "registrywatcher-ui" { - matchFound = true - uiFullImageName := utils.ConstructImageName( - registryDomain, registryPrefix, "registrywatcher-ui", desiredTag) - job.TaskGroups[i].Tasks[j].Config["image"] = uiFullImageName - job.TaskGroups[i].Tasks[j].Config["force_pull"] = true - } - } - } - - if value, ok := os.LookupEnv("VAULT_TOKEN"); ok { - vaultToken := value - job.VaultToken = &vaultToken - } - - if matchFound { - go client.RestartNomadJob(&job, desiredTag) - } else { - utils.PostSlackError(client.conf, fmt.Sprintf("Mapped task name %s not found in Nomad job %s. Please check deployment configuration.", taskName, *job.ID)) - } -} - -// Modify a flag that should not affect the operation of a Nomad jobspec -func (client *NomadClient) flipJobMeta(job *nomad.Job) { - if _, ok := job.Meta["restart"]; ok { - if job.Meta["restart"] == "foo" { - job.Meta["restart"] = "bar" - } else { - job.Meta["restart"] = "foo" - } - } else { - job.Meta = map[string]string{ - "restart": "bar", - } - } -} - -// There is no way to restart a job through the API currently -// https://github.com/hashicorp/nomad/issues/698 -func (client *NomadClient) RestartNomadJob(job *nomad.Job, desiredTag string) { - jobID := *job.ID - - // stupid hack to force a restart when registering a job - client.flipJobMeta(job) - - utils.PostSlackUpdate(client.conf, fmt.Sprintf("Update: deploying job `%s` to tag `%s`", jobID, desiredTag)) - resp, _, err := client.nc.Jobs().RegisterOpts(job, nil, nil) - if err != nil { - log.LogAppErr(fmt.Sprintf("Failed to restart job %s", jobID), err) - utils.PostSlackError(client.conf, fmt.Sprintf("Error: failed to force redeploy job `%s` for tag `%s`", jobID, desiredTag)) - } else { - client.MonitorNomadJob(resp.EvalID, jobID, desiredTag) - } -} - -// Monitor the progress of a Nomad job deployment -// and posts a slack update on the outcome -func (client *NomadClient) MonitorNomadJob(evalID, jobID, desiredTag string) { - evalStatusDesc := "" - deploymentStatus := "running" - evalDeploymentID := "" - - ticker := time.NewTicker(500 * time.Millisecond) - defer ticker.Stop() - done := make(chan bool) - go func() { - // monitor for max 20 mins - time.Sleep(1200 * time.Second) - done <- true - }() - for { - select { - case <-done: - return - case _ = <-ticker.C: - for evalStatusDesc != "complete" { - eval, _, err := client.nc.Evaluations().Info(evalID, nil) - if err != nil { - continue - } - evalDeploymentID = eval.DeploymentID - evalStatusDesc = eval.StatusDescription - if evalStatusDesc == "" { - evalStatusDesc = eval.Status - } - } - - for deploymentStatus == "running" { - d, _, err := client.nc.Deployments().Info(evalDeploymentID, nil) - if err != nil { - continue - } - deploymentStatus = d.Status - } - - if deploymentStatus == "successful" { - utils.PostSlackSuccess(client.conf, fmt.Sprintf("Success: Nomad deployment for job `%s` succeeded for tag `%s`", jobID, desiredTag)) - } else if deploymentStatus == "failed" { - utils.PostSlackError(client.conf, fmt.Sprintf("Error: Nomad deployment job `%s` failed for tag `%s`, nomad server will roll back to last working version if possible", jobID, desiredTag)) - } else { - utils.PostSlackUpdate(client.conf, fmt.Sprintf("Update: Nomad deployment status is `%s` for job `%s` for tag `%s`. Monitoring timeout", deploymentStatus, jobID, desiredTag)) - } - done <- true - } - } -} diff --git a/client/postgres_client.go b/client/postgres_client.go deleted file mode 100644 index be340fa..0000000 --- a/client/postgres_client.go +++ /dev/null @@ -1,190 +0,0 @@ -package client - -import ( - "database/sql" - "math" - "os" - "time" - - "github.com/jmoiron/sqlx" - _ "github.com/lib/pq" - "github.com/pkg/errors" - "github.com/spf13/viper" -) - -type PostgresClient struct { - db *sqlx.DB - conf *viper.Viper -} - -// Initialize creates tables if they do not exist -// cloud agnostic function -func InitializePostgresClient(conf *viper.Viper) (*PostgresClient, error) { - client := PostgresClient{ - conf: conf, - } - var dburl string - if len(os.Getenv("DATABASE_URL")) > 0 { - dburl = os.Getenv("DATABASE_URL") - } else { - dburl = conf.GetString("database_url") - } - createSchema := conf.GetBool("create_database_schema") - - var err error - if client.db, err = sqlx.Open("postgres", dburl); err != nil { - return &client, errors.Wrap(err, "unable to open postgres db") - } - - if createSchema { - // Since this happens at initialization we - // could encounter racy conditions waiting for pg - // to become available. Wait for it a bit - if err = client.db.Ping(); err != nil { - // Try 3 more times - // 5, 10, 20 - for i := 0; i < 3 && err != nil; i++ { - time.Sleep(time.Duration(5*math.Pow(2, float64(i))) * time.Second) - err = client.db.Ping() - } - if err != nil { - return &client, errors.Wrap(err, "error trying to connect to postgres db, retries exhausted") - } - } - - if err = client.createTables(); err != nil { - return &client, errors.Wrap(err, "problem executing create tables sql") - } - if err = client.initRows(); err != nil { - return &client, errors.Wrap(err, "problem executing init row sql") - } - } - return &client, nil -} - -func (client *PostgresClient) createTables() error { - _, err := client.db.Exec(CreateTablesSQL) - return err -} - -func (client *PostgresClient) initRows() error { - for _, repoName := range client.conf.GetStringSlice("watched_repositories") { - tx, err := client.db.Begin() - if err != nil { - return errors.WithStack(err) - } - - if _, err = tx.Exec(InsertRowSql, - repoName, "", true); err != nil { - tx.Rollback() - return errors.Wrapf(err, "issue populating new watched repo with default tag empty string [%s]", repoName) - } - - if err = tx.Commit(); err != nil { - return errors.WithStack(err) - } - } - return nil -} - -func (client *PostgresClient) UpdateAutoDeployFlag(repoName string, autoDeploy bool) error { - tx, err := client.db.Begin() - if err != nil { - return errors.WithStack(err) - } - - update := ` - UPDATE deployed_repository_version SET auto_deploy = $2 WHERE repository_name = $1;` - - if _, err = tx.Exec( - update, repoName, autoDeploy); err != nil { - tx.Rollback() - return errors.WithStack(err) - } - - if err = tx.Commit(); err != nil { - return errors.WithStack(err) - } - - return nil -} - -func (client *PostgresClient) UpdatePinnedTag(repoName, pinnedTag string) error { - tx, err := client.db.Begin() - if err != nil { - return errors.WithStack(err) - } - - update := ` - UPDATE deployed_repository_version SET pinned_tag = $2 WHERE repository_name = $1;` - - if _, err = tx.Exec( - update, repoName, pinnedTag); err != nil { - tx.Rollback() - return errors.WithStack(err) - } - - if err = tx.Commit(); err != nil { - return errors.WithStack(err) - } - - return nil -} - -type DeployedRepositoryVersionRow struct { - PinnedTag string `json:"pinned_tag" db:"pinned_tag"` - RepositoryName string `json:"repository_name" db:"repository_name"` - AutoDeploy bool `json:"auto_deploy" db:"auto_deploy"` -} - -func (client *PostgresClient) GetAutoDeployFlag(repoName string) (bool, error) { - var rtn DeployedRepositoryVersionRow - sqlStatement := "select * from deployed_repository_version where repository_name = $1" - err := client.db.Get(&rtn, sqlStatement, repoName) - if err != nil { - if err == sql.ErrNoRows { - return false, errors.Wrapf(err, "auto_deploy with repoName %s not found", repoName) - } else { - return false, errors.Wrapf(err, "issue getting auto_deploy with repoName [%s]", repoName) - } - } - return rtn.AutoDeploy, err -} - -func (client *PostgresClient) GetPinnedTag(repoName string) (string, error) { - var rtn DeployedRepositoryVersionRow - sqlStatement := "select * from deployed_repository_version where repository_name = $1" - err := client.db.Get(&rtn, sqlStatement, repoName) - if err != nil { - if err == sql.ErrNoRows { - return "", errors.Wrapf(err, "pinned_tag with repoName %s not found", repoName) - } else { - return "", errors.Wrapf(err, "issue getting pinned_tag with repoName [%s]", repoName) - } - } - return rtn.PinnedTag, err -} - -func (client *PostgresClient) GetAllTags() (map[string]string, error) { - var rows []DeployedRepositoryVersionRow - sqlStatement := "select * from deployed_repository_version" - - err := client.db.Select(&rows, sqlStatement) - rtn := make(map[string]string) - for _, row := range rows { - rtn[row.RepositoryName] = row.PinnedTag - } - return rtn, err -} - -const InsertRowSql = ` -INSERT INTO deployed_repository_version - (repository_name, pinned_tag, auto_deploy) VALUES ($1, $2, $3) - ON CONFLICT (repository_name) DO NOTHING;` - -const CreateTablesSQL = ` -CREATE TABLE IF NOT EXISTS deployed_repository_version ( - repository_name character varying NOT NULL PRIMARY KEY UNIQUE, - pinned_tag character varying NOT NULL, - auto_deploy boolean NOT NULL default true -);` diff --git a/codefresh.yml b/codefresh.yml deleted file mode 100644 index c26d915..0000000 --- a/codefresh.yml +++ /dev/null @@ -1,71 +0,0 @@ -version: '1.0' -build_version: 'v2' -mode: parallel -stages: -- setup -- test -- docker-release - -steps: - main_clone: - title: Cloning main repository... - type: git-clone - repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}' - revision: '${{CF_REVISION}}' - - build_builder: - type: build - stage: setup - title: Build builder image - dockerfile: Dockerfile-golang - image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}-builder - disable_push: true - tag: latest - when: - steps: - - name: main_clone - on: - - success - - test: - title: Run tests - stage: test - image: ${{build_builder}} - working_directory: ${{main_clone}} - environment: - - GOPATH=/codefresh/volume/.go - commands: - - make test - when: - steps: - - name: build_builder - on: - - success - - build_docker_frontend_release: - type: build - stage: docker-release - title: Build Docker image for frontend - image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}-ui - registry: dockerhub - working_directory: ./ui - tag: ${{CF_BRANCH}} - when: - steps: - - name: test - on: - - success - - build_docker_backend_release: - type: build - stage: docker-release - title: Build Docker image for backend containing binary - image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} - registry: dockerhub - tag: ${{CF_BRANCH}} - target: release - when: - steps: - - name: build_docker_frontend_release - on: - - success diff --git a/config/config.go b/config/config.go deleted file mode 100644 index 302ddfd..0000000 --- a/config/config.go +++ /dev/null @@ -1,21 +0,0 @@ -package config - -import ( - "fmt" - "github.com/spf13/viper" -) - -func SetUpConfig(configFileName string) *viper.Viper { - conf := viper.New() - conf.SetConfigName(configFileName) - conf.SetConfigType("toml") - conf.AddConfigPath("./config") - conf.AddConfigPath("../config") - conf.AutomaticEnv() - err := conf.ReadInConfig() - if err != nil { - panic(fmt.Errorf("reading config file failed: %v", err)) - } - - return conf -} diff --git a/config/sample.toml b/config/sample.toml deleted file mode 100644 index 092c00f..0000000 --- a/config/sample.toml +++ /dev/null @@ -1,40 +0,0 @@ -# Webserver -server_listening_address = "0.0.0.0:8080" - -# Worker -poll_interval = "59s" - -# Docker Client -watched_repositories = [ - "registrywatcher" -] - -# Slack Client -webhook_url = "$YOUR_SLACK_URL_HERE" - -# Postgres Client -database_url = "postgresql://registry-watcher:registry-watcher@localhost:5432/registry-watcher?sslmode=disable" -create_database_schema = true - -# Dockerhub API Client -dockerhub_url = "https://hub.docker.com" -dockerhub_namespace = "namespace" -dockerhub_username = "user" -dockerhub_secret = "secret" - -# Tests -is_test = false - -# Docker Registry information (to be interpolated by Nomad) -[registry_map.dockerhub] -registry_scheme = "https" -registry_domain = "registry-1.docker.io" -registry_prefix = "some_prefix" -registry_auth = "$YOUR_AUTH_STRING_HERE" - -# Repository information - -[repo_map.registrywatcher] -registry_name = "codefresh" -nomad_job_name = "registrywatcher" -nomad_task_name = "registrywatcher" diff --git a/config/test.toml b/config/test.toml deleted file mode 100644 index 8eb50da..0000000 --- a/config/test.toml +++ /dev/null @@ -1,37 +0,0 @@ -# Webserver -server_listening_address = "0.0.0.0:8080" - -# Worker -poll_interval = "5s" - -# Docker Client -watched_repositories = ["testrepo"] - -# Postgres Client -database_url = "postgresql://registry-watcher:registry-watcher@localhost:5432/registry-watcher?sslmode=disable" -create_database_schema = true - -# Tests -is_test = true -base_public_image = "library/redis" -registry_container_image = "registry:2" -registry_container_port = "5000" -postgres_container_image = "postgres:9.6.2" -postgres_container_port = "5432" - -# Docker Registry information (to be interpolated by Nomad) -[registry_map.localregistry] -registry_scheme = "https" -registry_domain = "localhost:5000" -registry_prefix = "prefix" -registry_auth = "YmxhaDpibGFoCg==" - -# Nomad Client -[repo_map.testrepo] -registry_name = "localregistry" -nomad_job_name = "testrepo" -nomad_task_name = "testrepo" - -# config: "basicauth.yml", -# username: "admin", -# password: "testing" diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 7c84ed9..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: '2.2' -services: - frontend: - build: ui/. - depends_on: - - backend - ports: - - 5000:5000 - backend: - build: . - environment: - DATABASE_URL: postgresql://registry-watcher:registry-watcher@db/registry-watcher?sslmode=disable - VAULT_TOKEN: ${VAULT_TOKEN} - NOMAD_TOKEN: ${NOMAD_TOKEN} - volumes: - - ${PWD}/config:/app/config - ports: - - 8080:8080 - db: - image: postgres:9.6.2 - environment: - POSTGRES_USER: registry-watcher - POSTGRES_DB: registry-watcher - POSTGRES_PASSWORD: registry-watcher - ports: - - 5432:5432 diff --git a/env/ci/ci.yaml b/env/ci/ci.yaml new file mode 100644 index 0000000..5fc4f0b --- /dev/null +++ b/env/ci/ci.yaml @@ -0,0 +1 @@ +Dsn: host=localhost user=tester password=abcdefg dbname=playground port=5432 sslmode=disable \ No newline at end of file diff --git a/env/dev/Dockerfile b/env/dev/Dockerfile new file mode 100644 index 0000000..feceaff --- /dev/null +++ b/env/dev/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.20-alpine + +COPY ./ /app +WORKDIR /app + +RUN go build -o /app/service + +CMD ["/app/service"] diff --git a/env/dev/dev.yaml b/env/dev/dev.yaml new file mode 100644 index 0000000..dd0dc55 --- /dev/null +++ b/env/dev/dev.yaml @@ -0,0 +1 @@ +Dsn: host=dev-db user=dev password=abcdefg dbname=playground port=5432 sslmode=disable \ No newline at end of file diff --git a/env/dev/docker-compose.yml b/env/dev/docker-compose.yml new file mode 100644 index 0000000..2190841 --- /dev/null +++ b/env/dev/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' +services: + ui: + build: ../../ui/. + depends_on: + - app + ports: + - 5000:5000 + + app: + container_name: dev + build: + context: ../../ + dockerfile: env/dev/Dockerfile + ports: + - 8080:8080 + environment: + - ENV=dev + depends_on: + - db + + db: + container_name: dev-db + image: postgres:16.2-alpine + ports: + - 5432:5432 + tmpfs: + - /var/lib/postgresql/data + environment: + - POSTGRES_USER=dev + - POSTGRES_PASSWORD=abcdefg + - POSTGRES_DB=playground \ No newline at end of file diff --git a/env/test/Dockerfile b/env/test/Dockerfile new file mode 100644 index 0000000..fecdd71 --- /dev/null +++ b/env/test/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.20-alpine + +COPY ./ /app +WORKDIR /app + +RUN go mod download +RUN apk add --no-cache make +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2 +RUN go install -v github.com/incu6us/goimports-reviser/v3@latest + +ENTRYPOINT ["tail", "-F", "/dev/null"] diff --git a/env/test/docker-compose.yml b/env/test/docker-compose.yml new file mode 100644 index 0000000..8a71ab4 --- /dev/null +++ b/env/test/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3' +services: + testenv: + container_name: test-env + build: + context: ../../ + dockerfile: env/test/Dockerfile + ports: + - 8080:8080 + volumes: + - ../../:/app + environment: + - ENV=test + depends_on: + - db + + db: + container_name: test-db + image: postgres:16.2-alpine + ports: + - 5432:5432 + tmpfs: + - /var/lib/postgresql/data + environment: + - POSTGRES_USER=tester + - POSTGRES_PASSWORD=abcdefg + - POSTGRES_DB=playground \ No newline at end of file diff --git a/env/test/script.sh b/env/test/script.sh new file mode 100755 index 0000000..93def85 --- /dev/null +++ b/env/test/script.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +docker compose -f env/test/docker-compose.yml up -d +docker compose -f env/test/docker-compose.yml exec testenv sh +docker compose -f env/test/docker-compose.yml down \ No newline at end of file diff --git a/env/test/test.yaml b/env/test/test.yaml new file mode 100644 index 0000000..0555fcf --- /dev/null +++ b/env/test/test.yaml @@ -0,0 +1 @@ +Dsn: host=test-db user=tester password=abcdefg dbname=playground port=5432 sslmode=disable \ No newline at end of file diff --git a/external/messaging.go b/external/messaging.go new file mode 100644 index 0000000..68370ed --- /dev/null +++ b/external/messaging.go @@ -0,0 +1,14 @@ +package external + +//go:generate mockgen -source=messaging.go -destination=../mocks/external/messaging.go +// type Sender interface { +// Send(message models.Message) error +// } + +// type EmailSender struct { +// } + +// func (e EmailSender) Send(message models.Message) error { +// // *** Send email logic *** +// return nil +// } diff --git a/go.mod b/go.mod index 2d6cfcb..d55ed76 100644 --- a/go.mod +++ b/go.mod @@ -1,63 +1,62 @@ -module github.com/dsaidgovsg/registrywatcher +module registrywatcher + +go 1.20 require ( - github.com/gin-contrib/cors v1.4.0 - github.com/gin-gonic/gin v1.8.1 - github.com/hashicorp/nomad/api v0.0.0-20200529203653-c4416b26d3eb - github.com/jmoiron/sqlx v1.3.5 - github.com/lib/pq v1.10.7 - github.com/nlopes/slack v0.6.0 - github.com/pkg/errors v0.9.1 - github.com/spf13/viper v1.12.0 - github.com/stretchr/testify v1.8.0 - go.uber.org/zap v1.21.0 + github.com/gin-gonic/gin v1.9.1 + github.com/golang/mock v1.6.0 + github.com/spf13/viper v1.18.2 + github.com/stretchr/testify v1.8.4 + gorm.io/driver/postgres v1.5.6 + gorm.io/gorm v1.25.7 ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/go-units v0.4.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.10.0 // indirect - github.com/goccy/go-json v0.9.7 // indirect - github.com/gorilla/websocket v1.4.2 // indirect - github.com/hashicorp/cronexpr v1.1.1 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/hcl v1.0.1-0.20201016140508-a07e7d50bbee // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.4.3 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/magiconair/properties v1.8.6 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/afero v1.8.2 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // 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/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.3.0 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/goleak v1.1.12 // indirect - go.uber.org/multierr v1.6.0 // indirect - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/ini.v1 v1.66.4 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // 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 + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/ugorji/go v1.1.4 => github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43 - -go 1.17 diff --git a/go.sum b/go.sum index 56bbffa..7a6f41f 100644 --- a/go.sum +++ b/go.sum @@ -1,940 +1,162 @@ -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.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -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/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/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/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= -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/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= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -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/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/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -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/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/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= 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/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.0/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 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= -github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= +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/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +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.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -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/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -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.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +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/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/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 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -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/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/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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/cronexpr v1.1.0/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= -github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= -github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= -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 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -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 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl v1.0.1-0.20201016140508-a07e7d50bbee h1:8B4HqvMUtYSjsGkYjiQGStc9pXffY2J+Z2SPQAj+wMY= -github.com/hashicorp/hcl v1.0.1-0.20201016140508-a07e7d50bbee/go.mod h1:gwlu9+/P9MmKtYrMsHeFRZPXj2CTPm11TDnMeaRHS7g= -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.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/nomad/api v0.0.0-20200529203653-c4416b26d3eb h1:gFssj9eV5on4ZYpwTQl+LTrkebu+qCxuKpISPcMCH88= -github.com/hashicorp/nomad/api v0.0.0-20200529203653-c4416b26d3eb/go.mod h1:DCi2k47yuUDzf2qWAK8E1RVmWgz/lc0jZQeEnICTxmY= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -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/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= -github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -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/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY= +github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= +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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= 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.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 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -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.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -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 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -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.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= -github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -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.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +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.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +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/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 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 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -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/nlopes/slack v0.6.0 h1:jt0jxVQGhssx1Ib7naAOZEZcGdtIhTzkP0nopK0AsRA= -github.com/nlopes/slack v0.6.0/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= -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.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.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -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/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/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= 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 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.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.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/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +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/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/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.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +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/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 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.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -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/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.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/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -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.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= 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-20210711020723-a769d52b0f97/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-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/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/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/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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-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/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-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-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-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -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-20211005180243-6b3c2da341f1/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/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.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-20220513210516-0976fa681c29/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-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/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-20211007075335-d3039528d8ac/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-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.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/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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-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/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= -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.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -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.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= -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-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-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/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-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -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.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.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/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 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= +gorm.io/driver/postgres v1.5.6 h1:ydr9xEd5YAM0vxVDY0X139dyzNz10spDiDlC7+ibLeU= +gorm.io/driver/postgres v1.5.6/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= +gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A= +gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/log/log.go b/log/log.go deleted file mode 100644 index 7c45283..0000000 --- a/log/log.go +++ /dev/null @@ -1,41 +0,0 @@ -package log - -import ( - "fmt" - "os" - - "go.uber.org/zap" -) - -func SetUpLogger() { - logger, err := zap.NewProduction() - - if err != nil { - fmt.Fprintln(os.Stderr, "Error initializing logger.") - return - } - - defer func() { - if err := logger.Sync(); err != nil { - fmt.Fprintln(os.Stderr, "Error flushing buffered log entries.") - } - }() - - zap.ReplaceGlobals(logger) -} - -func LogAppInfo(msg string) { - zap.S().Infow(msg) -} - -func LogAppWarn(msg string, err error) { - zap.S().Warnw(msg, - "cause", err, - ) -} - -func LogAppErr(msg string, err error) { - zap.S().Errorw(msg, - "cause", err, - ) -} diff --git a/main.go b/main.go index fe0d71e..a348795 100644 --- a/main.go +++ b/main.go @@ -2,355 +2,23 @@ package main import ( "fmt" - "strconv" - "strings" - "time" - "github.com/dsaidgovsg/registrywatcher/client" - "github.com/dsaidgovsg/registrywatcher/config" - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/dsaidgovsg/registrywatcher/utils" - "github.com/dsaidgovsg/registrywatcher/worker" - "github.com/gin-contrib/cors" - "github.com/gin-gonic/gin" - "github.com/spf13/viper" + "registrywatcher/app/repository" + "registrywatcher/server" + "registrywatcher/utilities/config" + "registrywatcher/utilities/db" ) func main() { - conf := config.SetUpConfig("staging") + c := config.InitConfig(config.GetEnv()) - clients := client.SetUpClients(conf) + db := db.InitDB(c.DSN) - SetUpWorkers(conf, clients) - - log.SetUpLogger() - - r := SetUpRouter(conf, clients) - - r.Run(conf.GetString("server_listening_address")) -} - -func SetUpWorkers(conf *viper.Viper, clients *client.Clients) { - for _, repoName := range conf.GetStringSlice("watched_repositories") { - pollInterval, err := time.ParseDuration(conf.GetString("poll_interval")) - if err != nil { - panic(fmt.Errorf("starting worker for %s failed: %v", repoName, err)) - } - ww := worker.InitializeWatcherWorker(conf, pollInterval, repoName, clients) - go ww.Run() - } -} - -type Config struct { - CORSAllowOrigin string `mapstructure:"cors_allow_origin"` - CORSAllowCredentials string `mapstructure:"cors_allow_credentials"` - CORSAllowHeaders string `mapstructure:"cors_allow_headers"` - CORSAllowMethods string `mapstructure:"cors_allow_methods"` -} - -func SetUpRouter(conf *viper.Viper, clients *client.Clients) *gin.Engine { - r := gin.Default() - handler := Handler{ - clients: clients, - conf: conf, - } - - routerConf := Config{ - CORSAllowOrigin: "*", - CORSAllowCredentials: "true", - CORSAllowHeaders: "pragma,content-type,content-length,accept-encoding,x-csrf-token,authorization,accept,origin,x-requested-with", - CORSAllowMethods: "GET,POST,PUT,DELETE", - } - - r.Use(corsMiddleware(&routerConf)) - - r.GET("/ping", HealthCheckHandler) - r.POST("/tags/:repo_name/reset", handler.ResetTagHandler) - r.POST("/tags/:repo_name", handler.DeployTagHandler) - r.GET("/tags/:repo_name", handler.GetTagHandler) - r.GET("/repos", handler.RepoSummaryHandler) - r.GET("/debug/caches", handler.CacheSummaryHandler) - - return r -} - -func corsMiddleware(conf *Config) gin.HandlerFunc { - allowCreds, err := strconv.ParseBool(conf.CORSAllowCredentials) - - if err != nil { - // Default to false if cannot parse Allow-Credentials - allowCreds = false - } - - return cors.New(cors.Config{ - AllowOrigins: strings.Split(conf.CORSAllowOrigin, ","), - AllowMethods: strings.Split(conf.CORSAllowMethods, ","), - AllowHeaders: strings.Split(conf.CORSAllowHeaders, ","), - AllowCredentials: allowCreds, - ExposeHeaders: []string{"Content-Length"}, - MaxAge: 12 * time.Hour, - }) -} - -func HealthCheckHandler(c *gin.Context) { - c.JSON(200, gin.H{ - "message": "pong", - }) -} - -type Handler struct { - clients *client.Clients - conf *viper.Viper -} - -type deployBody struct { - PinnedTag *string `json:"pinned_tag",omitempty` - AutoDeploy *bool `json:"auto_deploy",omitempty` -} - -func (h *Handler) ResetTagHandler(c *gin.Context) { - - pinnedTag := "" - - // check if repoName is valid - repoName := c.Param("repo_name") - validName := false - for _, repo := range h.conf.GetStringSlice("watched_repositories") { - if repoName == repo { - validName = true - break - } - } - if !validName { - _, registryDomain, _, _ := utils.ExtractRegistryInfo(h.conf, repoName) - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: The specified repo name %s is not inside the docker repository registry %s", repoName, registryDomain), - }) - return - } - - // if originalTag == pinnedTag, just terminate early - originalTag, err := h.clients.PostgresClient.GetPinnedTag(repoName) - if originalTag == pinnedTag { - c.JSON(200, gin.H{ - "message": fmt.Sprintf("pinned_tag is already %s", pinnedTag), - }) - return - } - - // update auto deployment - _ = h.clients.PostgresClient.UpdateAutoDeployFlag(repoName, true) - - // update tag - err = h.clients.PostgresClient.UpdatePinnedTag(repoName, pinnedTag) - - if err != nil { - _ = h.clients.PostgresClient.UpdatePinnedTag(repoName, originalTag) - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: Failed to update pinned tag, %s", err), - }) - } else { - log.LogAppInfo(fmt.Sprintf("Updated pinned_tag for repo %s from %s to %s succesfully, deployment of pinned_tag will happen shortly", repoName, originalTag, pinnedTag)) - h.clients.DeployPinnedTag(h.conf, repoName) - c.JSON(200, gin.H{ - "message": fmt.Sprintf("Deploying to %s", pinnedTag), - }) + repoService := repository.RepositoryService{ + DB: db, } -} - -func (h *Handler) DeployTagHandler(c *gin.Context) { - - // check if repoName is valid - repoName := c.Param("repo_name") - validName := false - for _, repo := range h.conf.GetStringSlice("watched_repositories") { - if repoName == repo { - validName = true - break - } - } - if !validName { - _, registryDomain, _, _ := utils.ExtractRegistryInfo(h.conf, repoName) - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: The specified repo name %s is not inside the docker repository registry %s", repoName, registryDomain), - }) - return - } - - // check that either pinnedTag or autoDeploy is given - var deployBody deployBody - err := c.BindJSON(&deployBody) - if err != nil { - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: %s", err), - }) - return - } else if deployBody.PinnedTag == nil && deployBody.AutoDeploy == nil { - c.JSON(400, gin.H{ - "message": "Either pinned_tag or auto_deploy must be specified.", - }) - return - } - - var newAutoDeployFlag bool - // set autoDeploy if its present - if deployBody.AutoDeploy != nil { - newAutoDeployFlag = *deployBody.AutoDeploy - currentAutoDeployFlag, _ := h.clients.PostgresClient.GetAutoDeployFlag(repoName) - if newAutoDeployFlag != currentAutoDeployFlag { - _ = h.clients.PostgresClient.UpdateAutoDeployFlag(repoName, newAutoDeployFlag) - var msg string - if newAutoDeployFlag { - msg = fmt.Sprintf("Turned on auto deployment for repo `%s`", repoName) - } else { - msg = fmt.Sprintf("Turned off auto deployment for repo `%s`", repoName) - } - utils.PostSlackUpdate(h.conf, msg) - log.LogAppInfo(msg) - } else { - log.LogAppInfo(fmt.Sprintf("Auto deployment is already set to %s", strconv.FormatBool(newAutoDeployFlag))) - } - } - - // exit if only autoDeploy in body - if deployBody.PinnedTag == nil { - c.JSON(200, gin.H{ - "message": fmt.Sprintf("Auto deployment set to %s", strconv.FormatBool(newAutoDeployFlag)), - }) - return - } - - // check if tag is valid - pinnedTag := *deployBody.PinnedTag - tags, err := h.clients.DockerRegistryClient.GetAllTags(repoName) - if err != nil || !utils.IsTagDeployable(pinnedTag, tags) { - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: The specified pinned_tag %s is not inside the docker repository registry %s", pinnedTag, repoName), - }) - return - } - - // can terminate early if originalTag == pinnedTag - originalTag, err := h.clients.PostgresClient.GetPinnedTag(repoName) - if originalTag == pinnedTag { - h.clients.DeployPinnedTag(h.conf, repoName) - c.JSON(200, gin.H{ - "message": fmt.Sprintf("Deploying to %s", pinnedTag), - }) - return - } - - // update tag - err = h.clients.PostgresClient.UpdatePinnedTag(repoName, pinnedTag) - - if err != nil { - _ = h.clients.PostgresClient.UpdatePinnedTag(repoName, originalTag) - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: Failed to update pinned tag, %s", err), - }) - } else { - log.LogAppInfo(fmt.Sprintf("Updated pinned_tag for repo %s from %s to %s succesfully, deployment of pinned_tag will happen shortly", repoName, originalTag, pinnedTag)) - h.clients.DeployPinnedTag(h.conf, repoName) - c.JSON(200, gin.H{ - "message": fmt.Sprintf("Deploying to %s", pinnedTag), - }) - } -} -func (h *Handler) GetTagHandler(c *gin.Context) { - - repoName := c.Param("repo_name") - - invalidRepoName := true - for _, repo := range h.conf.GetStringSlice("watched_repositories") { - if repo == repoName { - invalidRepoName = false - break - } - } - if invalidRepoName { - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Error: Repo %s is not being watched", repoName), - }) - return - } - - tag, err := h.clients.PostgresClient.GetPinnedTag(repoName) - var rtn string - if tag == "" { - tags, err := h.clients.DockerRegistryClient.GetAllTags(repoName) - rtn, err = utils.GetLatestReleaseTag(tags) - if err != nil { - c.JSON(400, gin.H{ - "message": fmt.Sprintf("No valid tags %s for repo %s, err: %s", tags, repoName, err), - }) - } - } else { - rtn = tag + if err := server.InitRoutes(repoService).Run(); err != nil { + panic(fmt.Sprintf("Failed to start server: %v\n", err)) } - - if err != nil { - c.JSON(400, gin.H{ - "message": fmt.Sprintf("Unable to fetch repo %s tag, err: %s", repoName, err), - }) - } else { - c.JSON(200, gin.H{ - "repo_tag": rtn, - }) - } -} - -func (h *Handler) RepoSummaryHandler(c *gin.Context) { - - rtn := map[string]map[string]interface{}{} - - tagMap, err := h.clients.PostgresClient.GetAllTags() - for _, repoName := range h.conf.GetStringSlice("watched_repositories") { - var tag string - if _, ok := tagMap[repoName]; ok { - tag = tagMap[repoName] - } else { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tag from database for endpoint summary handler for repo %s", repoName), err) - continue - } - tags, err := h.clients.GetCachedTags(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch tags from cache for endpoint summary handler for repo %s", repoName), err) - continue - } - tagValue, err := h.clients.GetFormattedPinnedTag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch pinned tag for endpoint summary handler for repo %s", repoName), err) - continue - } - autoDeployFlag, err := h.clients.PostgresClient.GetAutoDeployFlag(repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch auto deploy flag for endpoint summary handler for repo %s", repoName), err) - continue - } - rtn[repoName] = map[string]interface{}{ - "pinned_tag": tag, - "pinned_tag_value": tagValue, - "tags": tags, - "auto_deploy": autoDeployFlag, - } - } - - c.JSON(200, rtn) -} - -func (h *Handler) CacheSummaryHandler(c *gin.Context) { - - rtn := map[string]map[string]interface{}{} - - for _, repoName := range h.conf.GetStringSlice("watched_repositories") { - cachedTagDigest, _ := h.clients.GetCachedTagDigest(repoName) - tags, _ := h.clients.GetCachedTags(repoName) - rtn[repoName] = map[string]interface{}{ - "cached_tags": tags, - "cached_digest": cachedTagDigest, - } - } - - c.JSON(200, rtn) } diff --git a/registry/README.md b/registry/README.md deleted file mode 100644 index 0f9c3d2..0000000 --- a/registry/README.md +++ /dev/null @@ -1 +0,0 @@ -Taken and adapted from https://github.com/heroku/docker-registry-client diff --git a/registry/authchallenge.go b/registry/authchallenge.go deleted file mode 100644 index e300d82..0000000 --- a/registry/authchallenge.go +++ /dev/null @@ -1,150 +0,0 @@ -package registry - -import ( - "net/http" - "strings" -) - -// Octet types from RFC 2616. -type octetType byte - -// AuthorizationChallenge carries information -// from a WWW-Authenticate response header. -type AuthorizationChallenge struct { - Scheme string - Parameters map[string]string -} - -var octetTypes [256]octetType - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 - if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} - -func parseAuthHeader(header http.Header) []*AuthorizationChallenge { - var challenges []*AuthorizationChallenge - for _, h := range header[http.CanonicalHeaderKey("WWW-Authenticate")] { - v, p := parseValueAndParams(h) - if v != "" { - challenges = append(challenges, &AuthorizationChallenge{Scheme: v, Parameters: p}) - } - } - return challenges -} - -func parseValueAndParams(header string) (value string, params map[string]string) { - params = make(map[string]string) - value, s := expectToken(header) - if value == "" { - return - } - value = strings.ToLower(value) - s = "," + skipSpace(s) - for strings.HasPrefix(s, ",") { - var pkey string - pkey, s = expectToken(skipSpace(s[1:])) - if pkey == "" { - return - } - if !strings.HasPrefix(s, "=") { - return - } - var pvalue string - pvalue, s = expectTokenOrQuoted(s[1:]) - if pvalue == "" { - return - } - pkey = strings.ToLower(pkey) - params[pkey] = pvalue - s = skipSpace(s) - } - return -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isToken == 0 { - break - } - } - return s[:i], s[i:] -} - -func expectTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return expectToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + i; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} diff --git a/registry/basictransport.go b/registry/basictransport.go deleted file mode 100644 index 7e3be30..0000000 --- a/registry/basictransport.go +++ /dev/null @@ -1,23 +0,0 @@ -package registry - -import ( - "net/http" - "strings" -) - -type BasicTransport struct { - Transport http.RoundTripper - URL string - Username string - Password string -} - -func (t *BasicTransport) RoundTrip(req *http.Request) (*http.Response, error) { - if strings.HasPrefix(req.URL.String(), t.URL) { - if t.Username != "" || t.Password != "" { - req.SetBasicAuth(t.Username, t.Password) - } - } - resp, err := t.Transport.RoundTrip(req) - return resp, err -} diff --git a/registry/errortransport.go b/registry/errortransport.go deleted file mode 100644 index 18657d5..0000000 --- a/registry/errortransport.go +++ /dev/null @@ -1,44 +0,0 @@ -package registry - -import ( - "fmt" - "io/ioutil" - "net/http" -) - -type HttpStatusError struct { - Response *http.Response - Body []byte // Copied from `Response.Body` to avoid problems with unclosed bodies later. Nobody calls `err.Response.Body.Close()`, ever. -} - -func (err *HttpStatusError) Error() string { - return fmt.Sprintf("http: non-successful response (status=%v body=%q)", err.Response.StatusCode, err.Body) -} - -var _ error = &HttpStatusError{} - -type ErrorTransport struct { - Transport http.RoundTripper -} - -func (t *ErrorTransport) RoundTrip(request *http.Request) (*http.Response, error) { - resp, err := t.Transport.RoundTrip(request) - if err != nil { - return resp, err - } - - if resp.StatusCode >= 400 { - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("http: failed to read response body (status=%v, err=%q)", resp.StatusCode, err) - } - - return nil, &HttpStatusError{ - Response: resp, - Body: body, - } - } - - return resp, err -} diff --git a/registry/json.go b/registry/json.go deleted file mode 100644 index f1e2a6d..0000000 --- a/registry/json.go +++ /dev/null @@ -1,50 +0,0 @@ -package registry - -import ( - "encoding/json" - "errors" - "net/http" - "regexp" -) - -var ( - ErrNoMorePages = errors.New("No more pages") -) - -// getPaginatedJson accepts a string and a pointer, and returns the -// next page URL while updating pointed-to variable with a parsed JSON -// value. When there are no more pages it returns `ErrNoMorePages`. -func (registry *Registry) getPaginatedJson(url string, response interface{}) (string, error) { - resp, err := registry.Client.Get(url) - if err != nil { - return "", err - } - defer resp.Body.Close() - - decoder := json.NewDecoder(resp.Body) - err = decoder.Decode(response) - if err != nil { - return "", err - } - return getNextLink(resp) -} - -// Matches an RFC 5988 (https://tools.ietf.org/html/rfc5988#section-5) -// Link header. For example, -// -// ; type="application/json"; rel="next" -// -// The URL is _supposed_ to be wrapped by angle brackets `< ... >`, -// but e.g., quay.io does not include them. Similarly, params like -// `rel="next"` may not have quoted values in the wild. -var nextLinkRE = regexp.MustCompile(`^ *]+)>? *(?:;[^;]*)*; *rel="?next"?(?:;.*)?`) - -func getNextLink(resp *http.Response) (string, error) { - for _, link := range resp.Header[http.CanonicalHeaderKey("Link")] { - parts := nextLinkRE.FindStringSubmatch(link) - if parts != nil { - return parts[1], nil - } - } - return "", ErrNoMorePages -} diff --git a/registry/registry.go b/registry/registry.go deleted file mode 100644 index e122633..0000000 --- a/registry/registry.go +++ /dev/null @@ -1,174 +0,0 @@ -package registry - -import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" - "net" - "net/http" - "os" - "strings" - "time" - - "github.com/dsaidgovsg/registrywatcher/log" -) - -type LogfCallback func(format string, args ...interface{}) - -/* - * Discard log messages silently. - */ -func Quiet(format string, args ...interface{}) { - /* discard logs */ -} - -/* - * Pass log messages along to Go's "log" module. - */ -func Log(format string, args ...interface{}) { - if _, ok := os.LookupEnv("DEBUG"); ok { - log.LogAppInfo(fmt.Sprintf(format, args...)) - } -} - -type Registry struct { - URL string - Client *http.Client - Logf LogfCallback -} - -/* - * Create a new Registry with the given URL and credentials, then Ping()s it - * before returning it to verify that the registry is available. - * - * You can, alternately, construct a Registry manually by populating the fields. - * This passes http.DefaultTransport to WrapTransport when creating the - * http.Client. - */ -func New(registryUrl, scope, username, password string) (*Registry, error) { - transport := http.DefaultTransport - - return newFromTransport(registryUrl, scope, username, password, transport, Log) -} - -func NewSecure(registryUrl, scope, username, password, cert, key string) (*Registry, error) { - tlsCert, err := tls.LoadX509KeyPair(cert, key) - if err != nil { - return &Registry{}, fmt.Errorf("could not load X509 key pair: %v. Make sure the key is not encrypted", err) - } - - certPool, err := x509.SystemCertPool() - if err != nil { - return &Registry{}, fmt.Errorf("failed to read system certificates: %v", err) - } - pem, err := ioutil.ReadFile(cert) - if err != nil { - return &Registry{}, fmt.Errorf("could not read CA certificate %s: %v", cert, err) - } - if !certPool.AppendCertsFromPEM(pem) { - return &Registry{}, fmt.Errorf("failed to append certificates from PEM file: %s", cert) - } - - transport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - TLSClientConfig: &tls.Config{ - Certificates: []tls.Certificate{tlsCert}, - MinVersion: tls.VersionTLS12, - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - }, - RootCAs: certPool, - }, - } - - return newFromTransport(registryUrl, scope, username, password, transport, Log) -} - -/* - * Create a new Registry, as with New, using an http.Transport that disables - * SSL certificate verification. - */ -func NewInsecure(registryUrl, scope, username, password string) (*Registry, error) { - transport := &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - }, - } - - return newFromTransport(registryUrl, scope, username, password, transport, Log) -} - -/* - * Given an existing http.RoundTripper such as http.DefaultTransport, build the - * transport stack necessary to authenticate to the Docker registry API. This - * adds in support for OAuth bearer tokens and HTTP Basic auth, and sets up - * error handling this library relies on. - */ -func WrapTransport(transport http.RoundTripper, scope, url, username, password string) http.RoundTripper { - tokenTransport := &TokenTransport{ - Transport: transport, - Username: username, - Password: password, - Scope: scope, - } - basicAuthTransport := &BasicTransport{ - Transport: tokenTransport, - URL: url, - Username: username, - Password: password, - } - errorTransport := &ErrorTransport{ - Transport: basicAuthTransport, - } - return errorTransport -} - -func newFromTransport(registryUrl, scope, username, password string, transport http.RoundTripper, logf LogfCallback) (*Registry, error) { - url := strings.TrimSuffix(registryUrl, "/") - transport = WrapTransport(transport, scope, url, username, password) - registry := &Registry{ - URL: url, - Client: &http.Client{ - Transport: transport, - }, - Logf: logf, - } - - if err := registry.Ping(); err != nil { - return nil, err - } - - return registry, nil -} - -func (r *Registry) url(pathTemplate string, args ...interface{}) string { - pathSuffix := fmt.Sprintf(pathTemplate, args...) - url := fmt.Sprintf("%s%s", r.URL, pathSuffix) - return url -} - -func (r *Registry) Ping() error { - url := r.url("/v2/") - r.Logf("registry.ping url=%s", url) - resp, err := r.Client.Get(url) - if resp != nil { - defer resp.Body.Close() - } - if err != nil { - - } - return err -} diff --git a/registry/tags.go b/registry/tags.go deleted file mode 100644 index de22bb5..0000000 --- a/registry/tags.go +++ /dev/null @@ -1,25 +0,0 @@ -package registry - -type tagsResponse struct { - Tags []string `json:"tags"` -} - -func (registry *Registry) Tags(repository string) (tags []string, err error) { - url := registry.url("/v2/%s/tags/list", repository) - - var response tagsResponse - for { - // registry.Logf("registry.tags url=%s repository=%s", url, repository) - url, err = registry.getPaginatedJson(url, &response) - switch err { - case ErrNoMorePages: - tags = append(tags, response.Tags...) - return tags, nil - case nil: - tags = append(tags, response.Tags...) - continue - default: - return nil, err - } - } -} diff --git a/registry/tokentransport.go b/registry/tokentransport.go deleted file mode 100644 index 629f02a..0000000 --- a/registry/tokentransport.go +++ /dev/null @@ -1,130 +0,0 @@ -package registry - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" -) - -type TokenTransport struct { - Transport http.RoundTripper - Username string - Password string - Scope string -} - -func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error) { - resp, err := t.Transport.RoundTrip(req) - if err != nil { - return resp, err - } - if authService := isTokenDemand(resp); authService != nil { - // inject scope here - authService.Scope = t.Scope - resp, err = t.authAndRetry(authService, req) - } - return resp, err -} - -type authToken struct { - Token string `json:"token"` -} - -func (t *TokenTransport) authAndRetry(authService *authService, req *http.Request) (*http.Response, error) { - token, authResp, err := t.auth(authService) - if err != nil { - return authResp, err - } - - retryResp, err := t.retry(req, token) - return retryResp, err -} - -func (t *TokenTransport) auth(authService *authService) (string, *http.Response, error) { - authReq, err := authService.Request(t.Username, t.Password) - if err != nil { - return "", nil, err - } - - client := http.Client{ - Transport: t.Transport, - } - - response, err := client.Do(authReq) - if err != nil { - return "", nil, err - } - - if response.StatusCode != http.StatusOK { - return "", response, err - } - defer response.Body.Close() - - var authToken authToken - decoder := json.NewDecoder(response.Body) - err = decoder.Decode(&authToken) - if err != nil { - return "", nil, err - } - - return authToken.Token, nil, nil -} - -func (t *TokenTransport) retry(req *http.Request, token string) (*http.Response, error) { - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) - resp, err := t.Transport.RoundTrip(req) - return resp, err -} - -type authService struct { - Realm string - Service string - Scope string -} - -func (authService *authService) Request(username, password string) (*http.Request, error) { - url, err := url.Parse(authService.Realm) - if err != nil { - return nil, err - } - - q := url.Query() - q.Set("service", authService.Service) - if authService.Scope != "" { - q.Set("scope", authService.Scope) - } - url.RawQuery = q.Encode() - - request, err := http.NewRequest("GET", url.String(), nil) - - if username != "" || password != "" { - request.SetBasicAuth(username, password) - } - - return request, err -} - -func isTokenDemand(resp *http.Response) *authService { - if resp == nil { - return nil - } - if resp.StatusCode != http.StatusUnauthorized { - return nil - } - return parseOauthHeader(resp) -} - -func parseOauthHeader(resp *http.Response) *authService { - challenges := parseAuthHeader(resp.Header) - for _, challenge := range challenges { - if challenge.Scheme == "bearer" { - return &authService{ - Realm: challenge.Parameters["realm"], - Service: challenge.Parameters["service"], - Scope: challenge.Parameters["scope"], - } - } - } - return nil -} diff --git a/server/routes.go b/server/routes.go new file mode 100644 index 0000000..b531311 --- /dev/null +++ b/server/routes.go @@ -0,0 +1,43 @@ +package server + +import ( + "fmt" + + "registrywatcher/app/health" + "registrywatcher/app/repository" + "registrywatcher/utilities/config" + + "github.com/gin-gonic/gin" +) + +func setupGin(env config.Environment) (r *gin.Engine) { + switch env { + case config.Production, config.Staging: + gin.SetMode(gin.ReleaseMode) + r = gin.Default() + err := r.SetTrustedProxies(nil) + if err != nil { + panic(fmt.Sprintf("Failed to set trusted proxies: %v\n", err)) + } + case config.Testing, config.CI: + gin.SetMode(gin.ReleaseMode) + r = gin.New() + case config.Development: + r = gin.Default() + default: + panic(fmt.Sprintf("Invalid environment: %s", env)) + } + return +} + +func InitRoutes(repoService repository.RepositoryService) *gin.Engine { + r := setupGin(config.GetEnv()) + + // Add your routes here + r.GET("/ping", health.PingHandler) + + // Repositories routes + r.GET("/repos", repoService.GetRepositories) + + return r +} diff --git a/tests/app/repository_test.go b/tests/app/repository_test.go new file mode 100644 index 0000000..9e765b5 --- /dev/null +++ b/tests/app/repository_test.go @@ -0,0 +1,110 @@ +package app_tests + +import ( + "encoding/json" + "fmt" + "net/http" + "testing" + + "registrywatcher/app/models" + testutils "registrywatcher/tests" + + "github.com/stretchr/testify/suite" +) + +type RepositoriesTestSuite struct { + testutils.TestSuite +} + +func TestRunMessagesTestSuite(t *testing.T) { + suite.Run(t, &RepositoriesTestSuite{ + TestSuite: testutils.TestSuite{ + Data: &testutils.DataSeed{ + Repos: []models.Repository{ + { + RepositoryName: "repo_1", + PinnedTag: "repo_1_tag_1", + AutoDeploy: true, + }, + { + RepositoryName: "repo_2", + PinnedTag: "repo_2_tag_1", + AutoDeploy: true, + }, + }, + Tags: []models.Tag{ + { + TagName: "repo_1_tag_1", + Digest: "sha256:1234", + RepositoryID: "repo_1", + }, + { + TagName: "repo_2_tag_1", + Digest: "sha256:5678", + RepositoryID: "repo_2", + }, + { + TagName: "repo_1_tag_2", + Digest: "sha256:2345", + RepositoryID: "repo_1", + }, + { + TagName: "repo_2_tag_2", + Digest: "sha256:6789", + RepositoryID: "repo_2", + }, + }, + }, + }, + }) +} + +func (suite *RepositoriesTestSuite) TestRepositoryService_GetRepositories() { + // Define response structure + type repo struct { + AutoDeploy bool `json:"auto_deploy"` + PinnedTag string `json:"pinned_tag"` + PinnedTagValue string `json:"pinned_tag_value"` + Tags []string `json:"tags"` + } + + tests := []struct { + name string + response map[string]repo + }{ + { + name: "GetRepositories", + response: map[string]repo{ + "repo_1": { + AutoDeploy: true, + PinnedTag: "repo_1_tag_1", + PinnedTagValue: "repo_1_tag_1", + Tags: []string{"repo_1_tag_1", "repo_1_tag_2"}, + }, + "repo_2": { + AutoDeploy: true, + PinnedTag: "repo_2_tag_1", + PinnedTagValue: "repo_2_tag_1", + Tags: []string{"repo_2_tag_1", "repo_2_tag_2"}, + }, + }, + }, + } + + for _, tt := range tests { + suite.Run(tt.name, func() { + // Send request + resp := suite.SendRequest(http.MethodGet, "/repos", nil, nil) + suite.Equal(http.StatusOK, resp.Code) + + // Deserialize response + deserializedResp := map[string]repo{} + fmt.Println(resp.Body.String()) + err := json.Unmarshal(resp.Body.Bytes(), &deserializedResp) + suite.NoError(err) + + // Compare actual and expected response + suite.Equal(deserializedResp, tt.response) + }) + } +} diff --git a/tests/seed.go b/tests/seed.go new file mode 100644 index 0000000..018fb61 --- /dev/null +++ b/tests/seed.go @@ -0,0 +1,21 @@ +package testutils + +import ( + "registrywatcher/app/models" + + "gorm.io/gorm" +) + +type DataSeed struct { + Repos []models.Repository + Tags []models.Tag +} + +func (seed *DataSeed) Seed(db *gorm.DB) { + for _, repo := range seed.Repos { + db.Create(&repo) + } + for _, tag := range seed.Tags { + db.Create(&tag) + } +} diff --git a/tests/testsuite.go b/tests/testsuite.go new file mode 100644 index 0000000..616f923 --- /dev/null +++ b/tests/testsuite.go @@ -0,0 +1,83 @@ +package testutils + +import ( + "bytes" + "encoding/json" + "net/http" + "net/http/httptest" + + "registrywatcher/app/models" + "registrywatcher/app/repository" + "registrywatcher/server" + "registrywatcher/utilities/config" + "registrywatcher/utilities/db" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/suite" + "gorm.io/gorm" +) + +type TestSuite struct { + suite.Suite + r *gin.Engine + db *gorm.DB + Txn *gorm.DB + + // User configurable test parameters, must be reset after each subtest + Data *DataSeed + Config *config.Config + RepositoryService *repository.RepositoryService +} + +func (suite *TestSuite) SetupSuite() { + c := config.InitConfig(config.GetEnv()) + suite.db = db.InitDB(c.DSN) +} + +func (suite *TestSuite) SetupSubTest() { + if suite.Config == nil { + suite.Config = config.InitConfig(config.Testing) + } + + suite.Txn = suite.db.Begin() + suite.Data.Seed(suite.Txn) + + if suite.RepositoryService == nil { + suite.RepositoryService = &repository.RepositoryService{ + DB: suite.Txn, + Config: suite.Config, + } + } + + suite.r = server.InitRoutes(*suite.RepositoryService) +} + +func (suite *TestSuite) TearDownSubTest() { + suite.Config = nil + suite.Txn.Rollback() + suite.RepositoryService = nil +} + +func (suite *TestSuite) TearDownSuite() { + if err := suite.db.Migrator().DropTable(&models.Repository{}); err != nil { + suite.T().Fatal(err) + } +} + +func (suite *TestSuite) SendRequest(method string, path string, body interface{}, + headers map[string]string) *httptest.ResponseRecorder { + + var buf bytes.Buffer + err := json.NewEncoder(&buf).Encode(body) + if err != nil { + suite.T().Fatal(err) + } + req, _ := http.NewRequest(method, path, &buf) + for k, v := range headers { + req.Header.Set(k, v) + } + w := httptest.NewRecorder() + suite.r.ServeHTTP(w, req) + + return w +} diff --git a/ui/README.md b/ui/README.md deleted file mode 100644 index 0c90fe1..0000000 --- a/ui/README.md +++ /dev/null @@ -1,30 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Local development - -### Running - -Add .env.local and the other variants as per this [guide](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables) - -The following environment variables are used and shown below with examples: - -```bash -REACT_APP_SERVER_URL=http://localhost:8080 -REACT_APP_UPDATE_FREQUENCY_MILLISECONDS=1000 -``` - -## Deployment - -A dockerfile is provided. - -## TODO - -lack of feedback when interacting with buttons (if you click deploy, the frontend will silently update and change the button text from Redeploy tag_value to Deploy tag_value) - -tag values in a card's dropdown menu should reflect which one is deployed with a highlight ideally - -show nomad deployment status as a color on each card - -autocomplete options do not push the cards out of the way but covers them instead. - -add repo name next to tag (multiple repos may be associated with 1 tag) when showing autocomplete options diff --git a/utilities/config/config.go b/utilities/config/config.go new file mode 100644 index 0000000..46c1b0e --- /dev/null +++ b/utilities/config/config.go @@ -0,0 +1,67 @@ +package config + +import ( + "fmt" + "os" + + "github.com/spf13/viper" +) + +type Environment string + +const ( + CI Environment = "ci" + Testing Environment = "test" + Development Environment = "dev" + Staging Environment = "staging" + Production Environment = "production" +) + +func GetEnv() Environment { + env := os.Getenv("ENV") + switch env { + case "ci": + return CI + case "test": + return Testing + case "dev": + return Development + case "staging": + return Staging + case "production": + return Production + case "": + panic("Environment not set") + default: + panic(fmt.Sprintf("Invalid environment: %s", env)) + } +} + +type Config struct { + DSN string +} + +func InitConfig(env Environment) *Config { + var c Config + + viper.SetConfigName(string(env)) + viper.SetConfigType("yaml") + viper.AddConfigPath(fmt.Sprintf("./env/%s", env)) + viper.AddConfigPath(fmt.Sprintf("../../env/%s", env)) + + err := viper.ReadInConfig() + if err != nil { + panic(fmt.Sprintf("Failed to read config file: %v\n", err)) + } + + // Set default values or handle missing keys here + + // Bind configuration values to struct fields here + err = viper.Unmarshal(&c) + if err != nil { + panic(fmt.Sprintf("unable to decode into struct, %v", err)) + } + + // Example: viper.Get("key") to retrieve configuration value + return &c +} diff --git a/utilities/db/db.go b/utilities/db/db.go new file mode 100644 index 0000000..0966f71 --- /dev/null +++ b/utilities/db/db.go @@ -0,0 +1,20 @@ +package db + +import ( + "registrywatcher/app/models" + + "gorm.io/driver/postgres" + "gorm.io/gorm" +) + +func InitDB(dsn string) (db *gorm.DB) { + // Add your database initialization code here + var err error + if db, err = gorm.Open(postgres.Open(dsn), &gorm.Config{}); err != nil { + panic("failed to connect database") + } + if err = db.AutoMigrate(&models.Repository{}, &models.Tag{}); err != nil { + panic("failed to migrate database") + } + return db +} diff --git a/utils/helpers.go b/utils/helpers.go deleted file mode 100644 index 1f7eb00..0000000 --- a/utils/helpers.go +++ /dev/null @@ -1,218 +0,0 @@ -package utils - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "os" - "regexp" - "sort" - "strconv" - "strings" - "time" - - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/nlopes/slack" - "github.com/spf13/viper" -) - -// update README link if moving this definition -var re = regexp.MustCompile(`^v([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$`) -var findSHA = regexp.MustCompile(`[A-Fa-f0-9]{40}`) - -func IsTagSHAFormat(tag string) bool { - return findSHA.MatchString(tag) -} - -func IsTagReleaseFormat(tag string) bool { - return re.MatchString(tag) -} - -func FilterReleaseTags(tags []string) []string { - rtn := []string{} - for _, tag := range tags { - if IsTagReleaseFormat(tag) { - rtn = append(rtn, tag) - } - } - return rtn -} - -func FilterSHATags(tags []string) []string { - rtn := []string{} - for _, tag := range tags { - if !IsTagSHAFormat(tag) { - rtn = append(rtn, tag) - } - } - return rtn -} - -func TagToNumber(tag string) int { - arr := strings.Split(tag, ".") - major, _ := strconv.Atoi(string(arr[0][1:])) - major = major * 1000000 - minor, _ := strconv.Atoi(string(arr[1])) - minor = minor * 1000 - patch, _ := strconv.Atoi(string(arr[2])) - return major + minor + patch -} - -// latest with respect to versioned tags -func IsTagLatest(tag string, tags []string) bool { - if tag == "" { - return true - } - // tags to numbers - values := []int{} - for _, tag := range tags { - values = append(values, TagToNumber(tag)) - } - sort.Ints(values) - rtn := TagToNumber(tag) == values[len(values)-1] - return rtn -} - -func IsTagDeployable(checkedTag string, availableDockerTags []string) bool { - if checkedTag == "" { - return true - } - for _, tag := range availableDockerTags { - if tag == checkedTag { - return true - } - } - return false -} - -func GetLatestReleaseTag(tags []string) (string, error) { - tags = FilterReleaseTags(tags) - tagValueMap := map[int]string{} - values := []int{} - for _, tag := range tags { - tagValueMap[TagToNumber(tag)] = tag - values = append(values, TagToNumber(tag)) - } - sort.Ints(values) - if len(values) == 0 { - return "", fmt.Errorf("No valid tag") - } - biggestValue := values[len(values)-1] - return tagValueMap[biggestValue], nil -} - -func CastMapOfMaps(mapOfMap interface{}) map[string]map[string]string { - rtn := map[string]map[string]string{} - for k1, nestedMap := range mapOfMap.(map[string]interface{}) { - rtn[k1] = map[string]string{} - for k2, v2 := range nestedMap.(map[string]interface{}) { - rtn[k1][k2] = v2.(string) - } - } - return rtn -} - -func extractRegistryInfo(conf *viper.Viper, repoName, keyName string) string { - repoMap := CastMapOfMaps(conf.Get("repo_map")) - registryMap := CastMapOfMaps(conf.Get("registry_map")) - registryName := repoMap[repoName]["registry_name"] - repoRegistryMap := registryMap[registryName] - return repoRegistryMap[keyName] -} - -// return the scheme, domain and prefix in that order -func ExtractRegistryInfo(conf *viper.Viper, repoName string) (string, string, string, string) { - registryScheme := extractRegistryInfo(conf, repoName, "registry_scheme") - registryDomain := extractRegistryInfo(conf, repoName, "registry_domain") - registryPrefix := extractRegistryInfo(conf, repoName, "registry_prefix") - registryAuth := extractRegistryInfo(conf, repoName, "registry_auth") - return registryScheme, registryDomain, registryPrefix, registryAuth -} - -func DecodeAuthString(encoded string) (string, string, error) { - data, err := base64.StdEncoding.DecodeString(encoded) - if err != nil { - return "", "", fmt.Errorf("docker auth string not valid: %v", err) - } - decoded := string(data) - arr := strings.Split(decoded, ":") - if len(arr) != 2 { - return "", "", fmt.Errorf("docker auth string not valid: %v", err) - } - username := arr[0] - password := arr[1] - return username, password, nil -} - -func ConstructImageName(domain, prefix, repoName, tag string) string { - return fmt.Sprintf("%s/%s/%s:%s", - domain, - prefix, - repoName, - tag, - ) -} - -// Get the Nomad job name config mapping for repoName -func GetRepoNomadJob(conf *viper.Viper, repoName string) string { - repoMap := conf.Get("repo_map").(map[string]interface{}) - jobID := repoMap[repoName].(map[string]interface{})["nomad_job_name"].(string) - return jobID -} - -// Get the Nomad task name config mapping for repoName -func GetRepoNomadTaskName(conf *viper.Viper, repoName string) string { - repoMap := conf.Get("repo_map").(map[string]interface{}) - jobID := repoMap[repoName].(map[string]interface{})["nomad_task_name"].(string) - return jobID -} - -const ( - green = "#00FF00" - red = "#FF0000" - orange = "#FFA500" - yarly = "https://i.imgur.com/LWRp6ZT.png" - nowai = "https://i.imgur.com/MJ5Qx8f.jpg" -) - -func PostSlackUpdate(conf *viper.Viper, text string) { - attachment := slack.Attachment{ - Color: orange, - Text: text, - Ts: json.Number(strconv.FormatInt(time.Now().Unix(), 10)), - } - postSlackMessage(conf, attachment) -} - -func PostSlackError(conf *viper.Viper, text string) { - attachment := slack.Attachment{ - Color: red, - Text: text, - Ts: json.Number(strconv.FormatInt(time.Now().Unix(), 10)), - ThumbURL: nowai, - } - postSlackMessage(conf, attachment) -} - -func PostSlackSuccess(conf *viper.Viper, text string) { - attachment := slack.Attachment{ - Color: green, - Text: text, - Ts: json.Number(strconv.FormatInt(time.Now().Unix(), 10)), - ThumbURL: yarly, - } - postSlackMessage(conf, attachment) -} - -func postSlackMessage(conf *viper.Viper, attachment slack.Attachment) { - if _, ok := os.LookupEnv("DEBUG"); !ok { - msg := slack.WebhookMessage{ - Attachments: []slack.Attachment{attachment}, - } - - err := slack.PostWebhook(conf.GetString("webhook_url"), &msg) - if err != nil { - log.LogAppErr(fmt.Sprintf("Cannot post to slack webhook_url %s", conf.GetString("webhook_url")), err) - } - } -} diff --git a/utils/helpers_test.go b/utils/helpers_test.go deleted file mode 100644 index f4e5fb2..0000000 --- a/utils/helpers_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package utils - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestTagToNumber(t *testing.T) { - cases := []struct { - tag string - val int - Expected bool - }{ - {"v0.0.1", 1, true}, - {"v0.1.1", 1001, true}, - {"v1.1.1", 1001001, true}, - {"v0.0.10", 10, true}, - {"v0.10.10", 10010, true}, - {"v10.10.10", 10010010, true}, - {"v0.5.0", 5000, true}, - } - for _, tc := range cases { - t.Run(fmt.Sprintf("%s", tc.tag), func(t *testing.T) { - if tc.Expected { - assert.Equal(t, TagToNumber(tc.tag), tc.val) - } - }) - } -} - -func TestIsTagDeployable(t *testing.T) { - tags := []string{"v0.0.1", "v0.0.2", "v0.1.0", "v1.0.0", "random-branch-name"} - cases := []struct { - tag string - tags []string - Expected bool - }{ - {"v0.0.1", tags, true}, - {"v0.5.0", tags, false}, - {"random-branch-name", tags, true}, - {"", tags, true}, - } - for _, tc := range cases { - t.Run(fmt.Sprintf("%s in %s", tc.tag, tc.tags), func(t *testing.T) { - assert.Equal(t, IsTagDeployable(tc.tag, tc.tags), tc.Expected) - }) - } -} - -func TestIsTagReleaseFormat(t *testing.T) { - cases := []struct { - tag string - Expected bool - }{ - {"a0.0.1", false}, - {"v0.0.1", true}, - {"v0.0.11", true}, - {"v0.0.111", true}, - {"v0.0.11a", false}, - {"v0.0.1111", false}, - {"v999.999.999", true}, - } - for _, tc := range cases { - t.Run(fmt.Sprintf("%s, %t", tc.tag, tc.Expected), func(t *testing.T) { - assert.Equal(t, IsTagReleaseFormat(tc.tag), tc.Expected) - }) - } -} diff --git a/worker/watcher_worker.go b/worker/watcher_worker.go deleted file mode 100644 index db95142..0000000 --- a/worker/watcher_worker.go +++ /dev/null @@ -1,68 +0,0 @@ -package worker - -import ( - "fmt" - "os" - "time" - - "github.com/dsaidgovsg/registrywatcher/client" - "github.com/dsaidgovsg/registrywatcher/log" - "github.com/dsaidgovsg/registrywatcher/utils" - "github.com/spf13/viper" -) - -type WatcherWorker struct { - conf *viper.Viper - pollInterval time.Duration - repoName string - clients *client.Clients -} - -func InitializeWatcherWorker(conf *viper.Viper, pollInterval time.Duration, - repoName string, clients *client.Clients) *WatcherWorker { - ww := WatcherWorker{ - pollInterval: pollInterval, - conf: conf, - repoName: repoName, - clients: clients, - } - return &ww -} - -func (ww *WatcherWorker) Run() { - ww.initialize() - for { - ww.runOnce() - time.Sleep(ww.pollInterval) - } -} - -func (ww *WatcherWorker) initialize() { - ww.clients.PopulateCaches(ww.repoName) -} - -func (ww *WatcherWorker) runOnce() { - shouldDeploy, err := ww.clients.ShouldDeploy(ww.repoName) - if err != nil { - return - } - originalTag, err := ww.clients.GetFormattedPinnedTag(ww.repoName) - if err != nil || !shouldDeploy { - return - } - - // quick way to determine if SHA changes prompted the auto deployment - // proper way is to compare the docker content digest inside ./clients/nomad_client.go - tagToDeploy, err := ww.clients.GetFormattedPinnedTag(ww.repoName) - if err != nil { - log.LogAppErr(fmt.Sprintf("Couldn't fetch formatted pinned tag to post slack update for %s", ww.repoName), err) - return - } else if tagToDeploy == originalTag { - utils.PostSlackUpdate(ww.conf, fmt.Sprintf("Update: the SHA of tag `%s` in `%s` changed. Auto deployment will happen shortly.", tagToDeploy, ww.repoName)) - } - - log.LogAppInfo(fmt.Sprintf("Auto deploying tag %s for repo %s", tagToDeploy, ww.repoName)) - if _, ok := os.LookupEnv("DEBUG"); !ok { - ww.clients.DeployPinnedTag(ww.conf, ww.repoName) - } -}