From 6d9fe7527e2e91f6675c51c1bcba5be5154a158b Mon Sep 17 00:00:00 2001 From: Milos Gagovic Date: Thu, 5 Oct 2023 17:15:46 +0200 Subject: [PATCH] add init api methode for create redirects --- domain/redirectdefinition/api.go | 35 +++- .../createredirectsfromcontentserver.go | 53 +++++ domain/redirectdefinition/commands.go | 5 + .../repository/redirectdefinition.go | 2 +- domain/redirectdefinition/service.go | 19 +- .../redirectdefinition/service/gotsrpc_gen.go | 193 ++++++++++++++++++ .../service/gotsrpcclient_gen.go | 103 ++++++++++ go.mod | 12 +- go.sum | 19 +- 9 files changed, 428 insertions(+), 13 deletions(-) create mode 100644 domain/redirectdefinition/command/createredirectsfromcontentserver.go create mode 100644 domain/redirectdefinition/service/gotsrpc_gen.go create mode 100644 domain/redirectdefinition/service/gotsrpcclient_gen.go diff --git a/domain/redirectdefinition/api.go b/domain/redirectdefinition/api.go index 8fe17a1..d0e82a9 100644 --- a/domain/redirectdefinition/api.go +++ b/domain/redirectdefinition/api.go @@ -1,18 +1,21 @@ package redirectdefinition import ( + "context" "errors" + redirectcommand "github.com/foomo/redirects/domain/redirectdefinition/command" + redirectrepository "github.com/foomo/redirects/domain/redirectdefinition/repository" "go.uber.org/zap" ) // API for the domain type ( API struct { - Queries Queries - Commands Commands - //repo *cmrccheckoutrepo.CheckoutRepository - l *zap.Logger + //qry Queries + cmd Commands + repo *redirectrepository.RedirectsDefinitionRepository + l *zap.Logger //meter *cmrccommonmetric.Meter } Option func(api *API) @@ -20,17 +23,26 @@ type ( func NewAPI( l *zap.Logger, + repo *redirectrepository.RedirectsDefinitionRepository, opts ...Option, ) (*API, error) { inst := &API{ - l: l, - //repo: checkoutRepo, + l: l, + repo: repo, //meter: cmrccommonmetric.NewMeter(l, "checkout", telemetry.Meter()), } if inst.l == nil { return nil, errors.New("missing logger") } + if inst.repo == nil { + return nil, errors.New("missing cart repository") + } + inst.cmd = Commands{ + CreateRedirects: redirectcommand.CreateRedirectsHandlerComposed( + redirectcommand.CreateRedirectsHandler(inst.repo), + ), + } for _, opt := range opts { opt(inst) @@ -38,3 +50,14 @@ func NewAPI( return inst, nil } + +// ------------------------------------------------------------------------------------------------ +// ~ Public methods +// ------------------------------------------------------------------------------------------------ + +func (a *API) CreateRedirects(ctx context.Context, cmd redirectcommand.CreateRedirects) (err error) { + if err := a.cmd.CreateRedirects(ctx, a.l, cmd); err != nil { + return err + } + return nil +} diff --git a/domain/redirectdefinition/command/createredirectsfromcontentserver.go b/domain/redirectdefinition/command/createredirectsfromcontentserver.go new file mode 100644 index 0000000..3ca7cef --- /dev/null +++ b/domain/redirectdefinition/command/createredirectsfromcontentserver.go @@ -0,0 +1,53 @@ +package redirectcommand + +import ( + "context" + "reflect" + "runtime" + "strings" + + "github.com/foomo/contentserver/content" + redirectrepository "github.com/foomo/redirects/domain/redirectdefinition/repository" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" +) + +type ( + // CreateRedirects command + CreateRedirects struct { + OldState map[string]*content.RepoNode `json:"oldState"` + NewState map[string]*content.RepoNode `json:"newState"` + } + // CreateRedirectsHandlerFn handler + CreateRedirectsHandlerFn func(ctx context.Context, l *zap.Logger, cmd CreateRedirects) error + // CreateRedirectsMiddlewareFn middleware + CreateRedirectsMiddlewareFn func(next CreateRedirectsHandlerFn) CreateRedirectsHandlerFn +) + +// CreateRedirectsHandler ... +func CreateRedirectsHandler(repo *redirectrepository.RedirectsDefinitionRepository) CreateRedirectsHandlerFn { + return func(ctx context.Context, l *zap.Logger, cmd CreateRedirects) error { + + return nil //repo.Upsert(ctx, entity) + } +} + +// CreateRedirectsHandlerComposed returns the handler with middleware applied to it +func CreateRedirectsHandlerComposed(handler CreateRedirectsHandlerFn, middlewares ...CreateRedirectsMiddlewareFn) CreateRedirectsHandlerFn { + composed := func(next CreateRedirectsHandlerFn) CreateRedirectsHandlerFn { + for _, middleware := range middlewares { + localNext := next + middlewareName := strings.Split(runtime.FuncForPC(reflect.ValueOf(middleware).Pointer()).Name(), ".")[2] + next = middleware(func(ctx context.Context, l *zap.Logger, cmd CreateRedirects) error { + trace.SpanFromContext(ctx).AddEvent(middlewareName) + return localNext(ctx, l, cmd) + }) + } + return next + } + handlerName := strings.Split(runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name(), ".")[2] + return composed(func(ctx context.Context, l *zap.Logger, cmd CreateRedirects) error { + trace.SpanFromContext(ctx).AddEvent(handlerName) + return handler(ctx, l, cmd) + }) +} diff --git a/domain/redirectdefinition/commands.go b/domain/redirectdefinition/commands.go index 7756df4..eab5315 100644 --- a/domain/redirectdefinition/commands.go +++ b/domain/redirectdefinition/commands.go @@ -1,4 +1,9 @@ package redirectdefinition +import ( + redirectcommand "github.com/foomo/redirects/domain/redirectdefinition/command" +) + type Commands struct { + CreateRedirects redirectcommand.CreateRedirectsHandlerFn } diff --git a/domain/redirectdefinition/repository/redirectdefinition.go b/domain/redirectdefinition/repository/redirectdefinition.go index 0e4124f..dd6da5d 100644 --- a/domain/redirectdefinition/repository/redirectdefinition.go +++ b/domain/redirectdefinition/repository/redirectdefinition.go @@ -22,7 +22,7 @@ type ( } ) -func NewRedirectsStore(l *zap.Logger, persistor *keelmongo.Persistor) (rs *RedirectsDefinitionRepository, err error) { +func NewRedirectsDefinitionRepository(l *zap.Logger, persistor *keelmongo.Persistor) (rs *RedirectsDefinitionRepository, err error) { collection, cErr := persistor.Collection( "redirects", keelmongo.CollectionWithIndexes( diff --git a/domain/redirectdefinition/service.go b/domain/redirectdefinition/service.go index a1b736b..56c5bba 100644 --- a/domain/redirectdefinition/service.go +++ b/domain/redirectdefinition/service.go @@ -1,25 +1,38 @@ package redirectdefinition import ( + "context" + "github.com/foomo/contentserver/content" keelmongo "github.com/foomo/keel/persistence/mongo" + redirectcommand "github.com/foomo/redirects/domain/redirectdefinition/command" redirectstore "github.com/foomo/redirects/domain/redirectdefinition/store" "go.uber.org/zap" ) // Potentially add Nats to service (still not sure) type Service struct { - l *zap.Logger + l *zap.Logger + api *API } -func NewService(l *zap.Logger, p *keelmongo.Persistor) (*Service, error) { +func NewService(l *zap.Logger, p *keelmongo.Persistor, api *API) (*Service, error) { return &Service{ - l: l, + l: l, + api: api, }, nil } func (rs *Service) CreateRedirectsFromContentserverexport(old, new map[string]*content.RepoNode) error { // TODO: Implement + err := rs.api.CreateRedirects(context.Background(), + redirectcommand.CreateRedirects{ + OldState: old, + NewState: new, + }) + if err != nil { + return err + } return nil } diff --git a/domain/redirectdefinition/service/gotsrpc_gen.go b/domain/redirectdefinition/service/gotsrpc_gen.go new file mode 100644 index 0000000..9de3e57 --- /dev/null +++ b/domain/redirectdefinition/service/gotsrpc_gen.go @@ -0,0 +1,193 @@ +// Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. + +package service + +import ( + io "io" + http "net/http" + time "time" + + github_com_foomo_contentserver_content "github.com/foomo/contentserver/content" + gotsrpc "github.com/foomo/gotsrpc/v2" + github_com_foomo_redirects_domain_redirectdefinition_store "github.com/foomo/redirects/domain/redirectdefinition/store" +) + +const ( + RedirectDefinitionServiceGoTSRPCProxyCreate = "Create" + RedirectDefinitionServiceGoTSRPCProxyCreateRedirectsFromContentserverexport = "CreateRedirectsFromContentserverexport" + RedirectDefinitionServiceGoTSRPCProxyDelete = "Delete" + RedirectDefinitionServiceGoTSRPCProxyGetRedirects = "GetRedirects" + RedirectDefinitionServiceGoTSRPCProxySearch = "Search" + RedirectDefinitionServiceGoTSRPCProxyUpdate = "Update" +) + +type RedirectDefinitionServiceGoTSRPCProxy struct { + EndPoint string + service RedirectDefinitionService +} + +func NewDefaultRedirectDefinitionServiceGoTSRPCProxy(service RedirectDefinitionService) *RedirectDefinitionServiceGoTSRPCProxy { + return NewRedirectDefinitionServiceGoTSRPCProxy(service, "/services/redirects/redirectdefinition") +} + +func NewRedirectDefinitionServiceGoTSRPCProxy(service RedirectDefinitionService, endpoint string) *RedirectDefinitionServiceGoTSRPCProxy { + return &RedirectDefinitionServiceGoTSRPCProxy{ + EndPoint: endpoint, + service: service, + } +} + +// ServeHTTP exposes your service +func (p *RedirectDefinitionServiceGoTSRPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodOptions { + return + } else if r.Method != http.MethodPost { + gotsrpc.ErrorMethodNotAllowed(w) + return + } + defer io.Copy(io.Discard, r.Body) // Drain Request Body + + funcName := gotsrpc.GetCalledFunc(r, p.EndPoint) + callStats, _ := gotsrpc.GetStatsForRequest(r) + callStats.Func = funcName + callStats.Package = "github.com/foomo/redirects/domain/redirectdefinition/service" + callStats.Service = "RedirectDefinitionService" + switch funcName { + case RedirectDefinitionServiceGoTSRPCProxyCreate: + var ( + args []interface{} + rets []interface{} + ) + var ( + arg_def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition + ) + args = []interface{}{&arg_def} + if err := gotsrpc.LoadArgs(&args, callStats, r); err != nil { + gotsrpc.ErrorCouldNotLoadArgs(w) + return + } + executionStart := time.Now() + createRet := p.service.Create(arg_def) + callStats.Execution = time.Since(executionStart) + rets = []interface{}{createRet} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + case RedirectDefinitionServiceGoTSRPCProxyCreateRedirectsFromContentserverexport: + var ( + args []interface{} + rets []interface{} + ) + var ( + arg_old map[string]*github_com_foomo_contentserver_content.RepoNode + arg_new map[string]*github_com_foomo_contentserver_content.RepoNode + ) + args = []interface{}{&arg_old, &arg_new} + if err := gotsrpc.LoadArgs(&args, callStats, r); err != nil { + gotsrpc.ErrorCouldNotLoadArgs(w) + return + } + executionStart := time.Now() + createRedirectsFromContentserverexportRet := p.service.CreateRedirectsFromContentserverexport(arg_old, arg_new) + callStats.Execution = time.Since(executionStart) + rets = []interface{}{createRedirectsFromContentserverexportRet} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + case RedirectDefinitionServiceGoTSRPCProxyDelete: + var ( + args []interface{} + rets []interface{} + ) + var ( + arg_id string + ) + args = []interface{}{&arg_id} + if err := gotsrpc.LoadArgs(&args, callStats, r); err != nil { + gotsrpc.ErrorCouldNotLoadArgs(w) + return + } + executionStart := time.Now() + deleteRet := p.service.Delete(arg_id) + callStats.Execution = time.Since(executionStart) + rets = []interface{}{deleteRet} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + case RedirectDefinitionServiceGoTSRPCProxyGetRedirects: + var ( + args []interface{} + rets []interface{} + ) + executionStart := time.Now() + getRedirectsRet, getRedirectsRet_1 := p.service.GetRedirects() + callStats.Execution = time.Since(executionStart) + rets = []interface{}{getRedirectsRet, getRedirectsRet_1} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + case RedirectDefinitionServiceGoTSRPCProxySearch: + var ( + args []interface{} + rets []interface{} + ) + var ( + arg_dimension string + arg_id string + arg_path string + ) + args = []interface{}{&arg_dimension, &arg_id, &arg_path} + if err := gotsrpc.LoadArgs(&args, callStats, r); err != nil { + gotsrpc.ErrorCouldNotLoadArgs(w) + return + } + executionStart := time.Now() + searchRet, searchRet_1 := p.service.Search(arg_dimension, arg_id, arg_path) + callStats.Execution = time.Since(executionStart) + rets = []interface{}{searchRet, searchRet_1} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + case RedirectDefinitionServiceGoTSRPCProxyUpdate: + var ( + args []interface{} + rets []interface{} + ) + var ( + arg_def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition + ) + args = []interface{}{&arg_def} + if err := gotsrpc.LoadArgs(&args, callStats, r); err != nil { + gotsrpc.ErrorCouldNotLoadArgs(w) + return + } + executionStart := time.Now() + updateRet := p.service.Update(arg_def) + callStats.Execution = time.Since(executionStart) + rets = []interface{}{updateRet} + if err := gotsrpc.Reply(rets, callStats, r, w); err != nil { + gotsrpc.ErrorCouldNotReply(w) + return + } + gotsrpc.Monitor(w, r, args, rets, callStats) + return + default: + gotsrpc.ClearStats(r) + gotsrpc.ErrorFuncNotFound(w) + } +} diff --git a/domain/redirectdefinition/service/gotsrpcclient_gen.go b/domain/redirectdefinition/service/gotsrpcclient_gen.go new file mode 100644 index 0000000..1709bdf --- /dev/null +++ b/domain/redirectdefinition/service/gotsrpcclient_gen.go @@ -0,0 +1,103 @@ +// Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. + +package service + +import ( + go_context "context" + go_net_http "net/http" + + github_com_foomo_contentserver_content "github.com/foomo/contentserver/content" + gotsrpc "github.com/foomo/gotsrpc/v2" + github_com_foomo_redirects_domain_redirectdefinition_store "github.com/foomo/redirects/domain/redirectdefinition/store" + pkg_errors "github.com/pkg/errors" +) + +type RedirectDefinitionServiceGoTSRPCClient interface { + Create(ctx go_context.Context, def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition) (retCreate_0 error, clientErr error) + CreateRedirectsFromContentserverexport(ctx go_context.Context, old map[string]*github_com_foomo_contentserver_content.RepoNode, new map[string]*github_com_foomo_contentserver_content.RepoNode) (retCreateRedirectsFromContentserverexport_0 error, clientErr error) + Delete(ctx go_context.Context, id string) (retDelete_0 error, clientErr error) + GetRedirects(ctx go_context.Context) (retGetRedirects_0 []*github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition, retGetRedirects_1 error, clientErr error) + Search(ctx go_context.Context, dimension string, id string, path string) (retSearch_0 []*github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition, retSearch_1 error, clientErr error) + Update(ctx go_context.Context, def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition) (retUpdate_0 error, clientErr error) +} + +type HTTPRedirectDefinitionServiceGoTSRPCClient struct { + URL string + EndPoint string + Client gotsrpc.Client +} + +func NewDefaultRedirectDefinitionServiceGoTSRPCClient(url string) *HTTPRedirectDefinitionServiceGoTSRPCClient { + return NewRedirectDefinitionServiceGoTSRPCClient(url, "/services/redirects/redirectdefinition") +} + +func NewRedirectDefinitionServiceGoTSRPCClient(url string, endpoint string) *HTTPRedirectDefinitionServiceGoTSRPCClient { + return NewRedirectDefinitionServiceGoTSRPCClientWithClient(url, endpoint, nil) +} + +func NewRedirectDefinitionServiceGoTSRPCClientWithClient(url string, endpoint string, client *go_net_http.Client) *HTTPRedirectDefinitionServiceGoTSRPCClient { + return &HTTPRedirectDefinitionServiceGoTSRPCClient{ + URL: url, + EndPoint: endpoint, + Client: gotsrpc.NewClientWithHttpClient(client), + } +} +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) Create(ctx go_context.Context, def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition) (retCreate_0 error, clientErr error) { + args := []interface{}{def} + reply := []interface{}{&retCreate_0} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "Create", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy Create") + } + return +} + +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) CreateRedirectsFromContentserverexport(ctx go_context.Context, old map[string]*github_com_foomo_contentserver_content.RepoNode, new map[string]*github_com_foomo_contentserver_content.RepoNode) (retCreateRedirectsFromContentserverexport_0 error, clientErr error) { + args := []interface{}{old, new} + reply := []interface{}{&retCreateRedirectsFromContentserverexport_0} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "CreateRedirectsFromContentserverexport", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy CreateRedirectsFromContentserverexport") + } + return +} + +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) Delete(ctx go_context.Context, id string) (retDelete_0 error, clientErr error) { + args := []interface{}{id} + reply := []interface{}{&retDelete_0} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "Delete", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy Delete") + } + return +} + +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) GetRedirects(ctx go_context.Context) (retGetRedirects_0 []*github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition, retGetRedirects_1 error, clientErr error) { + args := []interface{}{} + reply := []interface{}{&retGetRedirects_0, &retGetRedirects_1} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "GetRedirects", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy GetRedirects") + } + return +} + +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) Search(ctx go_context.Context, dimension string, id string, path string) (retSearch_0 []*github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition, retSearch_1 error, clientErr error) { + args := []interface{}{dimension, id, path} + reply := []interface{}{&retSearch_0, &retSearch_1} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "Search", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy Search") + } + return +} + +func (tsc *HTTPRedirectDefinitionServiceGoTSRPCClient) Update(ctx go_context.Context, def *github_com_foomo_redirects_domain_redirectdefinition_store.RedirectDefinition) (retUpdate_0 error, clientErr error) { + args := []interface{}{def} + reply := []interface{}{&retUpdate_0} + clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "Update", args, reply) + if clientErr != nil { + clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.RedirectDefinitionServiceGoTSRPCProxy Update") + } + return +} diff --git a/go.mod b/go.mod index e61d8d2..59e2b89 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,22 @@ go 1.20 require ( github.com/foomo/contentserver v1.10.2 + github.com/foomo/gotsrpc/v2 v2.7.2 + github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.25.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/iancoleman/strcase v0.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + golang.org/x/mod v0.9.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/tools v0.7.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -28,7 +36,7 @@ require ( go.mongodb.org/mongo-driver v1.11.9 go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.32.0 // indirect go.opentelemetry.io/otel v1.7.0 // indirect - go.opentelemetry.io/otel/trace v1.7.0 // indirect + go.opentelemetry.io/otel/trace v1.7.0 golang.org/x/crypto v0.12.0 // indirect golang.org/x/sync v0.3.0 // indirect golang.org/x/text v0.12.0 // indirect diff --git a/go.sum b/go.sum index b1bab20..3b0c4e9 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ 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/foomo/contentserver v1.10.2 h1:a0bWTAI/aVQjXM8otuDHY8mML+7rXTU4L6j7ratfycw= github.com/foomo/contentserver v1.10.2/go.mod h1:ycAEPcUR+v6rL5rPinOanLeHLfcRuab28n/2JYMwSYg= +github.com/foomo/gotsrpc/v2 v2.7.2 h1:a94V/a8LSssq+aRN3Fv1lJPjWoyMilOvRq+yEaDTHVM= +github.com/foomo/gotsrpc/v2 v2.7.2/go.mod h1:n5SiKVNCZ7Tob6wcROWT5Sx1i/W42+ErpTbNqT3etM8= github.com/foomo/keel v0.16.1 h1:nGPjprqqj96Nuu0LpiNjLSs+a2Cs/ad/px3hGKgE8iA= github.com/foomo/keel v0.16.1/go.mod h1:ExaBRf52e3Z7vzuC+DTbs4i2NYVj49LIvaXFiV6+R84= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -19,6 +21,8 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/go-cmp v0.5.2/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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -27,8 +31,11 @@ github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -40,6 +47,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +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/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= @@ -69,6 +78,8 @@ golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -82,6 +93,8 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -92,10 +105,14 @@ golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=