diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 00000000..a3f379d3 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,9 @@ +linters-settings: + staticcheck: + checks: ["all", "-SA1029"] + whitespace: + multi-if: true + multi-func: true + govet: + disable: + - composites diff --git a/builder/store/database/prompt.go b/builder/store/database/prompt.go index 80891a90..a8a0d4fb 100644 --- a/builder/store/database/prompt.go +++ b/builder/store/database/prompt.go @@ -33,6 +33,10 @@ func NewPromptStore() PromptStore { return &promptStoreImpl{db: defaultDB} } +func NewPromptStoreWithDB(db *DB) PromptStore { + return &promptStoreImpl{db: db} +} + func (s *promptStoreImpl) Create(ctx context.Context, input Prompt) (*Prompt, error) { res, err := s.db.Core.NewInsert().Model(&input).Exec(ctx, &input) if err := assertAffectedOneRow(res, err); err != nil { diff --git a/builder/store/database/prompt_test.go b/builder/store/database/prompt_test.go index aa451315..beacaa55 100644 --- a/builder/store/database/prompt_test.go +++ b/builder/store/database/prompt_test.go @@ -1,128 +1,290 @@ -package database +package database_test import ( "context" + "fmt" "testing" "time" - "opencsg.com/csghub-server/common/config" + "github.com/stretchr/testify/require" + "opencsg.com/csghub-server/builder/store/database" + "opencsg.com/csghub-server/common/tests" ) -var ( - TestRepoId int64 = 40 - TestRepoIds []int64 = []int64{40} - TestDSN string = "postgresql://postgres:postgres@localhost:5433/starhub_server?sslmode=disable" - TestNamespace string = "wanghh2003" - TestName string = "gitalyds2" -) - -func InitTestDB(t *testing.T) { - cfg, err := config.LoadConfig() - if err != nil { - t.Fatalf("failed to load config: %v", err) - } - cfg.Database.DSN = TestDSN - dbConfig := DBConfig{ - Dialect: DatabaseDialect(cfg.Database.Driver), - DSN: cfg.Database.DSN, - } - InitDB(dbConfig) -} +func TestPromptStore_Create(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() -func TestCreate(t *testing.T) { - InitTestDB(t) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + ps := database.NewPromptStoreWithDB(db) - p := Prompt{ - RepositoryID: TestRepoId, + p := database.Prompt{ + RepositoryID: 1234, } - res, err := ps.Create(ctx, p) + _, err := ps.Create(ctx, p) + require.Nil(t, err) + + _, err = ps.ByRepoID(ctx, 1234) + require.Nil(t, err) - if err != nil { - t.Fatalf("failed to create prompt: %v", err) - } - t.Logf("created prompt: %d", res.ID) } -func TestUpdate(t *testing.T) { - InitTestDB(t) +func TestPromptStore_Update(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + ps := database.NewPromptStoreWithDB(db) - p, err := ps.ByRepoID(ctx, TestRepoId) + _, err := ps.Create(ctx, database.Prompt{ + RepositoryID: 1234, + }) + require.Nil(t, err) - ps.Update(ctx, *p) + p, err := ps.ByRepoID(ctx, 1234) + require.Nil(t, err) + p.RepositoryID = 3456 + err = ps.Update(ctx, *p) + require.Nil(t, err) + + _, err = ps.ByRepoID(ctx, 1234) + require.NotNil(t, err) + + _, err = ps.ByRepoID(ctx, 3456) + require.Nil(t, err) - if err != nil { - t.Fatalf("failed to update prompt: %v", err) - } } -func TestByRepoID(t *testing.T) { - InitTestDB(t) +func TestPromptStore_ByRepoID(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + ps := database.NewPromptStoreWithDB(db) - _, err := ps.ByRepoID(ctx, TestRepoId) - - if err != nil { - t.Fatalf("failed to get prompt by repo id: %v", err) + p := database.Prompt{ + RepositoryID: 1234, } + + _, err := ps.Create(ctx, p) + require.Nil(t, err) + + _, err = ps.ByRepoID(ctx, 1234) + require.Nil(t, err) } -func TestByRepoIDs(t *testing.T) { - InitTestDB(t) +func TestPromptStore_ByRepoIDs(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + ps := database.NewPromptStoreWithDB(db) + rs := database.NewRepoStoreWithDB(db) + us := database.NewUserStoreWithDB(db) + + err := us.Create(ctx, &database.User{ + Username: "foo", + }, &database.Namespace{}) + require.Nil(t, err) + user, err := us.FindByUsername(ctx, "foo") + require.Nil(t, err) + + repoIds := []int64{} + for _, r := range []string{"a", "b", "c"} { + + repo, err := rs.CreateRepo(ctx, database.Repository{ + UserID: user.ID, + Name: r, + Path: r, + GitPath: r, + }) + require.Nil(t, err) + repoIds = append(repoIds, repo.ID) + + _, err = ps.Create(ctx, database.Prompt{ + RepositoryID: repo.ID, + }) + + require.Nil(t, err) + } - _, err := ps.ByRepoIDs(ctx, TestRepoIds) + prompts, err := ps.ByRepoIDs(ctx, repoIds) + require.Nil(t, err) - if err != nil { - t.Fatalf("failed to get prompt by repo ids: %v", err) + require.Equal(t, 3, len(prompts)) + names := []string{} + for _, p := range prompts { + require.Equal(t, "foo", p.Repository.User.Username) + names = append(names, p.Repository.Name) } + require.ElementsMatch(t, []string{"a", "b", "c"}, names) } -func TestFindByPath(t *testing.T) { - InitTestDB(t) +func TestPromptStore_FindByPath(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() + // db.BunDB.AddQueryHook(bundebug.NewQueryHook(bundebug.WithVerbose(true))) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + rs := database.NewRepoStoreWithDB(db) + ts := database.NewTagStoreWithDB(db) + + repo, err := rs.CreateRepo(ctx, database.Repository{ + Path: "a/b/c", + GitPath: "abc", + }) + require.Nil(t, err) + + tags := []database.RepositoryTag{} + // tab a,c count -1, tag b count 1 + for _, n := range []string{"a", "b", "c"} { + var c int32 = -1 + if n == "b" { + c = 1 + } + tag, err := ts.CreateTag(ctx, "foo", n, n, database.DatasetTagScope) + require.Nil(t, err) + tags = append(tags, database.RepositoryTag{ + RepositoryID: repo.ID, + TagID: tag.ID, + Count: c, + }) + } - _, err := ps.FindByPath(ctx, TestNamespace, TestName) + err = rs.BatchCreateRepoTags(ctx, tags) + require.Nil(t, err) + + ps := database.NewPromptStoreWithDB(db) + _, err = ps.Create(ctx, database.Prompt{ + RepositoryID: repo.ID, + }) + require.Nil(t, err) + + prompt, err := ps.FindByPath(ctx, "a", "b/c") + require.Nil(t, err) + require.Equal(t, "", prompt.Repository.Name, "abc") + // FindByPath only get tags with count > 0 (tag b) + require.Equal(t, 1, len(prompt.Repository.Tags)) + require.Equal(t, prompt.Repository.Tags[0].Name, "b") - if err != nil { - t.Fatalf("failed to find prompt by repo path: %v", err) - } } -func TestDelete(t *testing.T) { - InitTestDB(t) +func TestPromptStore_Delete(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - ps := NewPromptStore() + ps := database.NewPromptStoreWithDB(db) + + err := ps.Delete(ctx, database.Prompt{ID: 123}) + require.NotNil(t, err) + + p, err := ps.Create(ctx, database.Prompt{}) + require.Nil(t, err) + + err = ps.Delete(ctx, *p) + require.Nil(t, err) + + err = ps.Delete(ctx, *p) + require.NotNil(t, err) - p, err := ps.ByRepoID(ctx, TestRepoId) +} + +func TestPromptStore_ByUserName(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() + ctx := context.TODO() + + us := database.NewUserStoreWithDB(db) + err := us.Create(ctx, &database.User{ + Username: "foo", + }, &database.Namespace{}) + require.Nil(t, err) + user, err := us.FindByUsername(ctx, "foo") + require.Nil(t, err) + + rs := database.NewRepoStoreWithDB(db) + + // order: 4-6-2-1-3-5 + repos := []struct { + Name string + CreatedAt time.Time + Private bool + }{ + {"repo1", time.Unix(1731561102, 0), false}, + {"repo2", time.Unix(1731561302, 0), false}, + {"repo3", time.Unix(1731551102, 0), false}, + {"repo4", time.Unix(1731564132, 0), true}, + {"repo5", time.Unix(1721561102, 0), false}, + {"repo6", time.Unix(1731564102, 0), true}, + } - ps.Delete(ctx, *p) + ps := database.NewPromptStoreWithDB(db) + for _, repo := range repos { + r := database.Repository{ + UserID: user.ID, + Name: repo.Name, + Path: repo.Name, + GitPath: repo.Name, + Private: repo.Private, + } + + rp, err := rs.CreateRepo(ctx, r) + require.Nil(t, err) + + pm := database.Prompt{ + RepositoryID: rp.ID, + } + pm.CreatedAt = repo.CreatedAt + _, err = ps.Create(ctx, pm) + require.Nil(t, err) + } - if err != nil { - t.Fatalf("failed to delete prompt: %v", err) + cases := []struct { + per int + page int + total int + onlyPublic bool + expected []int + }{ + {10, 1, 6, false, []int{4, 6, 2, 1, 3, 5}}, + {10, 1, 4, true, []int{2, 1, 3, 5}}, + {2, 1, 6, false, []int{4, 6}}, + {2, 2, 6, false, []int{2, 1}}, + {2, 1, 4, true, []int{2, 1}}, + {2, 2, 4, true, []int{3, 5}}, } + + for _, c := range cases { + t.Run(fmt.Sprintf("page %d, per %d, public %t", c.page, c.per, c.onlyPublic), func(t *testing.T) { + prompts, total, err := ps.ByUsername(ctx, "foo", c.per, c.page, c.onlyPublic) + require.Nil(t, err) + names := []string{} + for _, pm := range prompts { + names = append(names, pm.Repository.Name) + } + expected := []string{} + for _, i := range c.expected { + expected = append(expected, fmt.Sprintf("repo%d", i)) + } + + require.Equal(t, c.total, total) + require.Equal(t, expected, names) + + }) + } + } diff --git a/builder/store/database/repository.go b/builder/store/database/repository.go index 1d49165c..ef41e916 100644 --- a/builder/store/database/repository.go +++ b/builder/store/database/repository.go @@ -69,6 +69,12 @@ func NewRepoStore() RepoStore { } } +func NewRepoStoreWithDB(db *DB) RepoStore { + return &repoStoreImpl{ + db: db, + } +} + type Repository struct { ID int64 `bun:",pk,autoincrement" json:"id"` UserID int64 `bun:",notnull" json:"user_id"` diff --git a/builder/store/database/tag.go b/builder/store/database/tag.go index 15886f2f..1c6ed6e2 100644 --- a/builder/store/database/tag.go +++ b/builder/store/database/tag.go @@ -49,6 +49,12 @@ func NewTagStore() TagStore { } } +func NewTagStoreWithDB(db *DB) TagStore { + return &tagStoreImpl{ + db: db, + } +} + type TagScope string const ( diff --git a/builder/store/database/user.go b/builder/store/database/user.go index cb459a06..da2315fa 100644 --- a/builder/store/database/user.go +++ b/builder/store/database/user.go @@ -36,6 +36,12 @@ func NewUserStore() UserStore { } } +func NewUserStoreWithDB(db *DB) UserStore { + return &userStoreImpl{ + db: db, + } +} + type User struct { ID int64 `bun:",pk,autoincrement" json:"id"` GitID int64 `bun:",notnull" json:"git_id"` diff --git a/builder/store/database/user_test.go b/builder/store/database/user_test.go index 932bb05b..b417bc50 100644 --- a/builder/store/database/user_test.go +++ b/builder/store/database/user_test.go @@ -1,11 +1,17 @@ -package database +package database_test import ( + "context" + "fmt" "reflect" "testing" + + "github.com/stretchr/testify/require" + "opencsg.com/csghub-server/builder/store/database" + "opencsg.com/csghub-server/common/tests" ) -func TestUser_Roles(t *testing.T) { +func TestUserStore_Roles(t *testing.T) { type fields struct { RoleMask string } @@ -39,7 +45,7 @@ func TestUser_Roles(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - u := &User{ + u := &database.User{ RoleMask: tt.fields.RoleMask, } if got := u.Roles(); !reflect.DeepEqual(got, tt.want) { @@ -49,7 +55,7 @@ func TestUser_Roles(t *testing.T) { } } -func TestUser_SetRoles(t *testing.T) { +func TestUserStore_SetRoles(t *testing.T) { type fields struct { RoleMask string } @@ -92,7 +98,7 @@ func TestUser_SetRoles(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - u := &User{} + u := &database.User{} u.SetRoles(tt.args.roles) if u.RoleMask != tt.fields.RoleMask { t.Errorf("User.SetRoles() = %v, want %v", u.RoleMask, tt.fields.RoleMask) @@ -100,3 +106,95 @@ func TestUser_SetRoles(t *testing.T) { }) } } + +func TestUserStore_IndexWithSearch(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() + ctx := context.TODO() + + userStore := database.NewUserStoreWithDB(db) + err := userStore.Create(ctx, &database.User{ + GitID: 3321, + Username: "u-foo", + }, &database.Namespace{Path: "1"}) + require.Nil(t, err) + + err = userStore.Create(ctx, &database.User{ + GitID: 3322, + Username: "u-bar", + Email: "efoo@z.com", + }, &database.Namespace{Path: "2"}) + require.Nil(t, err) + + err = userStore.Create(ctx, &database.User{ + GitID: 3323, + Username: "u-barz", + Email: "ebar@z.com", + }, &database.Namespace{Path: "3"}) + require.Nil(t, err) + + cases := []struct { + per int + page int + total int + expected []int64 + }{ + {10, 1, 2, []int64{3321, 3322}}, + {1, 1, 2, []int64{3321}}, + {1, 2, 2, []int64{3322}}, + } + + for _, c := range cases { + t.Run(fmt.Sprintf("page %d, per %d", c.page, c.per), func(t *testing.T) { + + users, count, err := userStore.IndexWithSearch(ctx, "foo", c.per, c.page) + require.Nil(t, err) + require.Equal(t, c.total, count) + + gids := []int64{} + for _, u := range users { + gids = append(gids, u.GitID) + } + require.Equal(t, c.expected, gids) + }) + } + +} + +func TestUserStore_CreateUser(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() + ctx := context.TODO() + + us := database.NewUserStoreWithDB(db) + err := us.Create(ctx, &database.User{ + GitID: 3321, + Username: "u-foo", + }, &database.Namespace{Path: "u-foo"}) + require.Nil(t, err) + + user, err := us.FindByUsername(ctx, "u-foo") + require.Nil(t, err) + require.Equal(t, 3321, int(user.GitID)) + require.Equal(t, "u-foo", user.Username) +} + +func TestUserStore_ChangeUserName(t *testing.T) { + db := tests.InitTestDB() + defer db.Close() + ctx := context.TODO() + + us := database.NewUserStoreWithDB(db) + err := us.Create(ctx, &database.User{ + GitID: 3321, + Username: "u-foo", + }, &database.Namespace{Path: "u-foo"}) + require.Nil(t, err) + + err = us.ChangeUserName(ctx, "u-foo", "u-bar") + require.Nil(t, err) + + user, err := us.FindByUsername(ctx, "u-bar") + require.Nil(t, err) + require.Equal(t, "u-bar", user.Username) +} diff --git a/common/tests/testutils.go b/common/tests/testutils.go new file mode 100644 index 00000000..d4a6308f --- /dev/null +++ b/common/tests/testutils.go @@ -0,0 +1,124 @@ +package tests + +import ( + "context" + "database/sql" + "fmt" + "os" + "time" + + "github.com/DATA-DOG/go-txdb" + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/postgres" + "github.com/testcontainers/testcontainers-go/wait" + "github.com/uptrace/bun" + "github.com/uptrace/bun/dialect/pgdialect" + "github.com/uptrace/bun/driver/pgdriver" + "github.com/uptrace/bun/extra/bundebug" + "github.com/uptrace/bun/migrate" + "opencsg.com/csghub-server/builder/store/database" + "opencsg.com/csghub-server/builder/store/database/migrations" +) + +// This is a modified version of db.go NewDB method, used in test only. +func newBun(ctx context.Context, config database.DBConfig, useTxdb bool) (bunDB *bun.DB, err error) { + switch config.Dialect { + case database.DialectPostgres: + var sqlDB *sql.DB + if useTxdb { + sqlDB = sql.OpenDB(txdb.New("pg", config.DSN)) + } else { + sqlDB = sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(config.DSN))) + } + bunDB = bun.NewDB(sqlDB, pgdialect.New(), bun.WithDiscardUnknownColumns()) + default: + err = fmt.Errorf("unknown database dialect %q", config.Dialect) + return + } + + err = bunDB.PingContext(ctx) + if err != nil { + err = fmt.Errorf("pinging %s database: %w", config.Dialect, err) + return + } + + bunDB.RegisterModel((*database.RepositoryTag)(nil)) + bunDB.RegisterModel((*database.CollectionRepository)(nil)) + return +} + +// Init a test db, must call `defer db.Close()` in the test +func InitTestDB() *database.DB { + ctx := context.TODO() + // reuse the container, so we don't need to recreate the db for each test + // https://github.com/testcontainers/testcontainers-go/issues/2726 + reuse := testcontainers.CustomizeRequestOption( + func(req *testcontainers.GenericContainerRequest) error { + req.Reuse = true + req.Name = "csghub_test" + return nil + }, + ) + + pc, err := postgres.Run(ctx, "docker.io/postgres:14-alpine", reuse, postgres.WithDatabase("csghub_test"), + testcontainers.WithWaitStrategy( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2). + WithStartupTimeout(5*time.Second))) + if err != nil { + panic(err) + } + + // testcontainers will create a random dsn eachtime + dsn, err := pc.ConnectionString(ctx) + if err != nil { + panic(err) + } + + // switch to project root, so migrations can work correctly + os.Chdir("../../../") + bdb, err := newBun(ctx, database.DBConfig{ + Dialect: database.DialectPostgres, + DSN: dsn + "sslmode=disable", + }, false) + if err != nil { + panic(err) + } + defer bdb.Close() + bdb.AddQueryHook(bundebug.NewQueryHook( + bundebug.WithEnabled(false), + + // BUNDEBUG=1 logs failed queries + // BUNDEBUG=2 logs all queries + bundebug.FromEnv("BUNDEBUG"), + )) + + migrator := migrate.NewMigrator(bdb, migrations.Migrations) + err = migrator.Init(ctx) + if err != nil { + panic(err) + } + _, err = migrator.Migrate(ctx) + if err != nil { + panic(err) + } + + // create a new bun connection with txdb(the `true` param), so all sqls run + // using this connection will be wrapped in a Tx automatically. + bdb, err = newBun(ctx, database.DBConfig{ + Dialect: database.DialectPostgres, + DSN: dsn + "sslmode=disable", + }, true) + if err != nil { + panic(err) + } + bdb.AddQueryHook(bundebug.NewQueryHook( + bundebug.WithEnabled(false), + bundebug.FromEnv("BUNDEBUG"), + )) + + return &database.DB{ + Operator: database.Operator{Core: bdb}, + BunDB: bdb, + } +} diff --git a/go.mod b/go.mod index 1c035042..9afd4d99 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.22.0 toolchain go1.22.6 require ( + github.com/DATA-DOG/go-txdb v0.2.0 github.com/OpenCSGs/gitea-go-sdk/gitea v0.0.0-20240618091626-54fa52f1cec6 github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.5 github.com/alibabacloud-go/green-20220302 v1.2.0 @@ -29,6 +30,8 @@ require ( github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/swag v1.16.2 + github.com/testcontainers/testcontainers-go v0.34.0 + github.com/testcontainers/testcontainers-go/modules/postgres v0.34.0 github.com/uptrace/bun v1.1.16 github.com/uptrace/bun/dialect/pgdialect v1.1.16 github.com/uptrace/bun/dialect/sqlitedialect v1.1.16 @@ -51,13 +54,24 @@ require ( cloud.google.com/go/monitoring v1.18.0 // indirect cloud.google.com/go/trace v1.10.5 // indirect contrib.go.opencensus.io/exporter/stackdriver v0.13.14 // indirect + dario.cat/mergo v1.0.0 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/DataDog/datadog-go v4.4.0+incompatible // indirect github.com/DataDog/sketches-go v1.0.0 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/aws/aws-sdk-go v1.50.36 // indirect github.com/beevik/ntp v1.3.1 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect + github.com/containerd/containerd v1.7.18 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/containerd/platforms v0.2.1 // indirect + github.com/cpuguy83/dockercfg v0.3.2 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/docker v27.1.1+incompatible // indirect + github.com/docker/go-connections v0.5.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect @@ -75,11 +89,19 @@ require ( github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7 // indirect github.com/lightstep/lightstep-tracer-go v0.25.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/patternmatcher v0.6.0 // indirect + github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/sys/user v0.1.0 // indirect + github.com/moby/term v0.5.0 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect github.com/nats-io/nkeys v0.4.7 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nexus-rpc/sdk-go v0.0.11 // indirect github.com/oklog/ulid/v2 v2.0.2 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pborman/uuid v1.2.1 // indirect github.com/philhofer/fwd v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -91,15 +113,16 @@ require ( github.com/prometheus/prometheus v0.50.1 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a // indirect - github.com/shirou/gopsutil/v3 v3.21.12 // indirect + github.com/shirou/gopsutil/v3 v3.23.12 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/tinylib/msgp v1.1.2 // indirect - github.com/tklauser/go-sysconf v0.3.9 // indirect - github.com/tklauser/numcpus v0.3.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect gitlab.com/gitlab-org/go/reopen v1.0.0 // indirect gitlab.com/gitlab-org/labkit v1.21.2 // indirect go.opencensus.io v0.24.0 // indirect diff --git a/go.sum b/go.sum index 8820611f..df3374c3 100644 --- a/go.sum +++ b/go.sum @@ -12,9 +12,19 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxa contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= contrib.go.opencensus.io/exporter/stackdriver v0.13.14 h1:zBakwHardp9Jcb8sQHcHpXy/0+JIb1M8KjigCJzx7+4= contrib.go.opencensus.io/exporter/stackdriver v0.13.14/go.mod h1:5pSSGY0Bhuk7waTHuDf4aQ8D2DrhgETRo9fy6k3Xlzc= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-txdb v0.2.0 h1:p1VAEZGN0U58Z5efRbI9mI6fDhcMn2+hV1sPBeOp/A8= +github.com/DATA-DOG/go-txdb v0.2.0/go.mod h1:Dqk6PhlGpMk1JZ3n8sjybgBLcW69nuijArOMubFCXM0= github.com/DataDog/datadog-go v4.4.0+incompatible h1:R7WqXWP4fIOAqWJtUKmSfuc7eDsBT58k9AY5WSHVosk= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= @@ -24,8 +34,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OpenCSGs/gitea-go-sdk/gitea v0.0.0-20240618091626-54fa52f1cec6 h1:akkXbOCa0CVnLNUrnu+qr3LoRmuVG4+eajsBogSh0Lk= github.com/OpenCSGs/gitea-go-sdk/gitea v0.0.0-20240618091626-54fa52f1cec6/go.mod h1:QDTH3lw9zQNfXxqapFE894/37UEE2KGVk5K0fzO0tXs= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -85,6 +95,8 @@ github.com/bytedance/sonic v1.11.2 h1:ywfwo0a/3j9HR8wsYGWsIWl2mvRsI950HyoxiBERw5 github.com/bytedance/sonic v1.11.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/casdoor/casdoor-go-sdk v0.41.0 h1:mqqoc1Jub34/OkAQqjeASRAaiy7x/5ZWtGObI08cfEk= github.com/casdoor/casdoor-go-sdk v0.41.0/go.mod h1:cMnkCQJgMYpgAlgEx8reSt1AVaDIQLcJ1zk5pzBaz+4= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -110,8 +122,18 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudflare/tableflip v1.2.3 h1:8I+B99QnnEWPHOY3fWipwVKxS70LGgUsslG7CSfmHMw= github.com/cloudflare/tableflip v1.2.3/go.mod h1:P4gRehmV6Z2bY5ao5ml9Pd8u6kuEnlB37pUFMmv7j2E= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= +github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= +github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/d5/tengo/v2 v2.17.0 h1:BWUN9NoJzw48jZKiYDXDIF3QrIVZRm1uV1gTzeZ2lqM= github.com/d5/tengo/v2 v2.17.0/go.mod h1:XRGjEs5I9jYIKTxly6HCF8oiiilk5E/RYXOZ5b0DZC8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -122,6 +144,14 @@ github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454Wv github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY= +github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= @@ -201,6 +231,8 @@ github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.6.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= @@ -308,6 +340,14 @@ github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+h github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +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.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jellydator/ttlcache/v2 v2.11.1 h1:AZGME43Eh2Vv3giG6GeqeLeFXxwxn1/qHItqWZl6U64= github.com/jellydator/ttlcache/v2 v2.11.1/go.mod h1:RtE5Snf0/57e+2cLWFYWCCsLas2Hy3c5Z4n14XmSvTI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= @@ -351,6 +391,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7 h1:YjW+hUb8Fh2S58z4av4t/0cBMK/Q0aP48RocCFsC8yI= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7/go.mod h1:Spd59icnvRxSKuyijbbwe5AemzvcyXAUBgApa7VybMw= github.com/lightstep/lightstep-tracer-go v0.25.0 h1:sGVnz8h3jTQuHKMbUe2949nXm3Sg09N1UcR3VoQNN5E= @@ -358,6 +400,8 @@ github.com/lightstep/lightstep-tracer-go v0.25.0/go.mod h1:G1ZAEaqTHFPWpWunnbUn1 github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/marcboeker/go-duckdb v1.5.6 h1:5+hLUXRuKlqARcnW4jSsyhCwBRlu4FGjM0UTf2Yq5fw= @@ -383,6 +427,16 @@ github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5 github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/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= @@ -390,6 +444,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN 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/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= @@ -428,6 +484,8 @@ github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= @@ -477,8 +535,12 @@ github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a/go.mod h1:wozgYq9WEBQBa github.com/sethvargo/go-envconfig v1.1.0 h1:cWZiJxeTm7AlCvzGXrEXaSTCNgip5oJepekh/BOQuog= github.com/sethvargo/go-envconfig v1.1.0/go.mod h1:JLd0KFWQYzyENqnEPWWZ49i4vzZo/6nRidxI8YvGiHw= github.com/shirou/gopsutil/v3 v3.21.2/go.mod h1:ghfMypLDrFSWN2c9cDYFLHyynQ+QUht0cv/18ZqVczw= -github.com/shirou/gopsutil/v3 v3.21.12 h1:VoGxEW2hpmz0Vt3wUvHIl9fquzYLNpVpgNNB7pGJimA= -github.com/shirou/gopsutil/v3 v3.21.12/go.mod h1:BToYZVTlSVlfazpDDYFnsVZLaoRG+g8ufT6fPQLdJzA= +github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= +github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -519,17 +581,23 @@ github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+z github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= +github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= +github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ= +github.com/testcontainers/testcontainers-go/modules/mysql v0.32.0 h1:6vjJOVJSWDTyNvQmB8EFTmv20ScquRWZa+pM1hZNodc= +github.com/testcontainers/testcontainers-go/modules/mysql v0.32.0/go.mod h1:Q91G1jl4fSl75OICi+Bb6BQeU7LpKZaSfKvHOXRwPyI= +github.com/testcontainers/testcontainers-go/modules/postgres v0.34.0 h1:c51aBXT3v2HEBVarmaBnsKzvgZjC5amn0qsj8Naqi50= +github.com/testcontainers/testcontainers-go/modules/postgres v0.34.0/go.mod h1:EWP75ogLQU4M4L8U+20mFipjV4WIR9WtlMXSB6/wiuc= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= github.com/tklauser/go-sysconf v0.3.4/go.mod h1:Cl2c8ZRWfHD5IrfHo9VN+FX9kCFjIOyVklgXycLB6ek= -github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= -github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.2.1/go.mod h1:9aU+wOc6WjUIZEwWMP62PL/41d65P+iks1gBkr4QyP8= -github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ= -github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -565,8 +633,8 @@ github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= gitlab.com/gitlab-org/gitaly/v16 v16.11.8 h1:bL9F90+rXTlQcsSuZJivn+CIwKGXXc787IJi4g3XQEU= gitlab.com/gitlab-org/gitaly/v16 v16.11.8/go.mod h1:lJizRUtXRd1SBHjNbbbL9OsGN4TiugvfRBd8bIsdWI0= gitlab.com/gitlab-org/go/reopen v1.0.0 h1:6BujZ0lkkjGIejTUJdNO1w56mN1SI10qcVQyQlOPM+8= @@ -582,10 +650,18 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.temporal.io/api v1.40.0 h1:rH3HvUUCFr0oecQTBW5tI6DdDQsX2Xb6OFVgt/bvLto= go.temporal.io/api v1.40.0/go.mod h1:1WwYUMo6lao8yl0371xWUm13paHExN5ATYT/B7QtFis= go.temporal.io/sdk v1.30.0 h1:7jzSFZYk+tQ2kIYEP+dvrM7AW9EsCEP52JHCjVGuwbI= @@ -716,8 +792,7 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/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-20211025201205-69cdffdb9359/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -728,7 +803,9 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -862,6 +939,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo=