From adea9a693c2a0ff9d4dd1a3910d02dd29e28c08f Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Fri, 7 Jun 2024 16:44:23 +0200 Subject: [PATCH 1/7] remove deprecated code --- pkg/cmdutil/context.go | 16 --- pkg/cmdutil/exit.go | 21 ---- pkg/instutil/instutil.go | 177 -------------------------------- pkg/instutil/transition.go | 91 ---------------- pkg/instutil/transition_test.go | 84 --------------- pkg/redisutil/broadcast.go | 78 -------------- pkg/redisutil/index.go | 47 --------- pkg/redisutil/index_test.go | 59 ----------- pkg/typeutil/set.go | 165 ----------------------------- pkg/typeutil/set_test.go | 101 ------------------ pkg/typeutil/slice.go | 23 ----- 11 files changed, 862 deletions(-) delete mode 100644 pkg/instutil/instutil.go delete mode 100644 pkg/instutil/transition.go delete mode 100644 pkg/instutil/transition_test.go delete mode 100644 pkg/redisutil/broadcast.go delete mode 100644 pkg/redisutil/index.go delete mode 100644 pkg/redisutil/index_test.go delete mode 100644 pkg/typeutil/set.go delete mode 100644 pkg/typeutil/set_test.go delete mode 100644 pkg/typeutil/slice.go diff --git a/pkg/cmdutil/context.go b/pkg/cmdutil/context.go index 67ec3b3..a793535 100644 --- a/pkg/cmdutil/context.go +++ b/pkg/cmdutil/context.go @@ -85,19 +85,3 @@ func (c compositeContext) Err() error { func (c compositeContext) Value(key any) any { return c.value.Value(key) } - -// ContextWithValuesFrom creates a new context, but still references the values -// from the given context. This is helpful if a background context is needed -// that needs to have the values of an exiting context. -// -// Deprecated: Use [context.WithoutCancel] instead. -func ContextWithValuesFrom(value context.Context) context.Context { - bg := context.Background() - - return &compositeContext{ - deadline: bg, - done: bg, - err: bg, - value: value, - } -} diff --git a/pkg/cmdutil/exit.go b/pkg/cmdutil/exit.go index 66af1a3..344c32e 100644 --- a/pkg/cmdutil/exit.go +++ b/pkg/cmdutil/exit.go @@ -2,8 +2,6 @@ package cmdutil import ( "os" - - log "github.com/sirupsen/logrus" ) const ( @@ -41,22 +39,3 @@ func HandleExit() { panic(e) // not an Exit, bubble up } } - -// Must exits the application via Exit(1) and logs the error, if err does not -// equal nil. Additionally it logs the error with `%+v` to the debug log, so it -// can used together with github.com/pkg/errors to retrive more details about -// the error. -// -// Deprecated: Bubble the error up to the Runner.Run function and return it -// there instead. It is still preferable to let the application die, when there -// is no obvious way of handling it, but in reality this is not often the case -// and Must is encouraging permature exits. -func Must(err error) { - if err == nil { - return - } - - log.Debugf("%+v", err) - log.Error(err) - Exit(ExitCodeGeneralError) -} diff --git a/pkg/instutil/instutil.go b/pkg/instutil/instutil.go deleted file mode 100644 index 706dfba..0000000 --- a/pkg/instutil/instutil.go +++ /dev/null @@ -1,177 +0,0 @@ -package instutil - -import ( - "context" - "regexp" - "strings" - - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/logutil" -) - -type contextKeyCounter string -type contextKeyCounterVec string -type contextKeyGauge string -type contextKeyGaugeVec string -type contextKeyHistogram string - -var namespace string - -func init() { - re := regexp.MustCompile("[^a-zA-Z0-9]+") - n := re.ReplaceAllString(cmdutil.Name, "") - namespace = strings.ToLower(n) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func NewCounter(ctx context.Context, name string) context.Context { - metric := prometheus.NewCounter(prometheus.CounterOpts{ - Namespace: namespace, - Name: name, - }) - err := prometheus.Register(metric) - if err != nil { - logutil.Get(ctx). - WithError(errors.WithStack(err)). - Errorf("failed to register counter with name '%s'", name) - } - return context.WithValue(ctx, contextKeyCounter(name), metric) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func Counter(ctx context.Context, name string) (prometheus.Counter, bool) { - metric, ok := ctx.Value(contextKeyCounter(name)).(prometheus.Counter) - if !ok { - logutil.Get(ctx).Warnf("counter with name '%s' not found", name) - } - return metric, ok -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func NewCounterVec(ctx context.Context, name string, labels ...string) context.Context { - metric := prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: namespace, - Name: name, - }, labels) - err := prometheus.Register(metric) - if err != nil { - logutil.Get(ctx). - WithError(errors.WithStack(err)). - Errorf("failed to register counter vector with name '%s'", name) - } - return context.WithValue(ctx, contextKeyCounterVec(name), metric) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func CounterVec(ctx context.Context, name string) (*prometheus.CounterVec, bool) { - metric, ok := ctx.Value(contextKeyCounterVec(name)).(*prometheus.CounterVec) - if !ok { - logutil.Get(ctx).Warnf("counter vec with name '%s' not found", name) - } - return metric, ok -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func BucketScale(factor float64, values ...float64) []float64 { - for i := range values { - values[i] = values[i] * factor - } - return values -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func NewHistogram(ctx context.Context, name string, buckets ...float64) context.Context { - metric := prometheus.NewHistogram(prometheus.HistogramOpts{ - Namespace: namespace, - Name: name, - Buckets: buckets, - }) - err := prometheus.Register(metric) - if err != nil { - logutil.Get(ctx). - WithError(errors.WithStack(err)). - Errorf("failed to register histogram with name '%s'", name) - } - return context.WithValue(ctx, contextKeyHistogram(name), metric) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func Histogram(ctx context.Context, name string) (prometheus.Histogram, bool) { - metric, ok := ctx.Value(contextKeyHistogram(name)).(prometheus.Histogram) - if !ok { - logutil.Get(ctx).Warnf("histogram with name '%s' not found", name) - } - return metric, ok -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func NewGauge(ctx context.Context, name string) context.Context { - metric := prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: namespace, - Name: name, - }) - err := prometheus.Register(metric) - if err != nil { - logutil.Get(ctx). - WithError(errors.WithStack(err)). - Errorf("failed to register gauge with name '%s'", name) - } - return context.WithValue(ctx, contextKeyGauge(name), metric) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func Gauge(ctx context.Context, name string) (prometheus.Gauge, bool) { - metric, ok := ctx.Value(contextKeyGauge(name)).(prometheus.Gauge) - if !ok { - logutil.Get(ctx).Warnf("gauge with name '%s' not found", name) - } - return metric, ok -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func NewGaugeVec(ctx context.Context, name string, labels ...string) context.Context { - metric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Namespace: namespace, - Name: name, - }, labels) - err := prometheus.Register(metric) - if err != nil { - logutil.Get(ctx). - WithError(errors.WithStack(err)). - Errorf("failed to register gauge vector with name '%s'", name) - } - return context.WithValue(ctx, contextKeyGaugeVec(name), metric) -} - -// Deprecated: Store the metric in an Instrumentation struct, a service struct -// or as a global variable instead. Storing it in the context is unintuitive -// and verbose. -func GaugeVec(ctx context.Context, name string) (*prometheus.GaugeVec, bool) { - metric, ok := ctx.Value(contextKeyGaugeVec(name)).(*prometheus.GaugeVec) - if !ok { - logutil.Get(ctx).Warnf("gauge vector with name '%s' not found", name) - } - return metric, ok -} diff --git a/pkg/instutil/transition.go b/pkg/instutil/transition.go deleted file mode 100644 index 00cf290..0000000 --- a/pkg/instutil/transition.go +++ /dev/null @@ -1,91 +0,0 @@ -package instutil - -import ( - "context" - - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/logutil" - "github.com/sirupsen/logrus" -) - -type contextKeyTransitionCollector string - -type Transition struct { - Name string - From, To string - Fields logrus.Fields -} - -func GetTransitionCollector(ctx context.Context, name string) *TransitionCollector { - cache, ok := ctx.Value(contextKeyTransitionCollector(name)).(*map[string]string) - if !ok { - logutil.Get(ctx).Warnf("transition collector with name '%s' not found", name) - return nil - } - - return &TransitionCollector{ - - cache: cache, - } -} - -type TransitionCollector struct { - cache *map[string]string - changes []Transition -} - -func NewTransitionCollector(ctx context.Context, name string) context.Context { - cache := map[string]string{} - return context.WithValue(ctx, contextKeyTransitionCollector(name), &cache) -} - -func (c *TransitionCollector) Observe(name string, state string, fields logrus.Fields) { - if c == nil { - return - } - - c.changes = append(c.changes, Transition{ - Name: name, - To: state, - Fields: fields, - }) -} - -func (c *TransitionCollector) Finish() []Transition { - result := []Transition{} - - if c == nil { - return result - } - - observed := map[string]struct{}{} - - for _, change := range c.changes { - from := (*c.cache)[change.Name] - (*c.cache)[change.Name] = change.To - observed[change.Name] = struct{}{} - - if from == change.To { - continue - } - - change.From = from - result = append(result, change) - } - - for name, value := range *c.cache { - _, found := observed[name] - if found { - continue - } - - result = append(result, Transition{ - Name: name, - From: value, - }) - - delete(*c.cache, name) - - } - - return result -} diff --git a/pkg/instutil/transition_test.go b/pkg/instutil/transition_test.go deleted file mode 100644 index 104d7e7..0000000 --- a/pkg/instutil/transition_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package instutil - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestTransitionCollector(t *testing.T) { - ctx := context.Background() - ctx = NewTransitionCollector(ctx, "test-a") - ctx = NewTransitionCollector(ctx, "test-b") - - // Note: The sub tests depend on each other. - - t.Run("AddInitial", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "test-a") - tc.Observe("i-001", "pending", nil) - tc.Observe("i-002", "running", nil) - tc.Observe("i-003", "terminated", nil) - result := tc.Finish() - - require.Len(t, result, 3) - - assert.Equal(t, Transition{Name: "i-001", From: "", To: "pending"}, result[0]) - assert.Equal(t, Transition{Name: "i-002", From: "", To: "running"}, result[1]) - assert.Equal(t, Transition{Name: "i-003", From: "", To: "terminated"}, result[2]) - }) - - t.Run("ChangeSingleState", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "test-a") - tc.Observe("i-001", "running", nil) - tc.Observe("i-002", "running", nil) - tc.Observe("i-003", "terminated", nil) - result := tc.Finish() - - require.Len(t, result, 1) - - assert.Equal(t, Transition{Name: "i-001", From: "pending", To: "running"}, result[0]) - }) - - t.Run("RemoveState", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "test-a") - tc.Observe("i-001", "running", nil) - tc.Observe("i-002", "running", nil) - result := tc.Finish() - - require.Len(t, result, 1) - - assert.Equal(t, Transition{Name: "i-003", From: "terminated", To: ""}, result[0]) - }) - - t.Run("EmptyStateRemovesToo", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "test-a") - tc.Observe("i-001", "running", nil) - tc.Observe("i-002", "", nil) - result := tc.Finish() - - require.Len(t, result, 1) - - assert.Equal(t, Transition{Name: "i-002", From: "running", To: ""}, result[0]) - }) - - t.Run("CachedToNotInterfere", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "test-b") - result := tc.Finish() - - // The `test-a` cache still have states in it. Therefore it would want - // to remove it, when they access the same cache. - require.Len(t, result, 0) - }) - - t.Run("MissingShouldNotCrash", func(t *testing.T) { - tc := GetTransitionCollector(ctx, "missing") - tc.Observe("i-001", "pending", nil) - tc.Observe("i-002", "running", nil) - tc.Observe("i-003", "terminated", nil) - result := tc.Finish() - - require.Len(t, result, 0) - }) -} diff --git a/pkg/redisutil/broadcast.go b/pkg/redisutil/broadcast.go deleted file mode 100644 index efbf911..0000000 --- a/pkg/redisutil/broadcast.go +++ /dev/null @@ -1,78 +0,0 @@ -package redisutil - -import ( - "context" - "time" - - "github.com/pkg/errors" - "github.com/redis/go-redis/v9" -) - -const ( - broadcastValueField = "data" -) - -type BroadcastRediser interface { - XAdd(ctx context.Context, a *redis.XAddArgs) *redis.StringCmd - XRead(ctx context.Context, a *redis.XReadArgs) *redis.XStreamSliceCmd -} - -type Broadcast[T any] struct { - client BroadcastRediser - key string -} - -func NewBroadcast[T any](client BroadcastRediser, key string) (*Broadcast[T], error) { - return &Broadcast[T]{ - client: client, - key: key, - }, nil -} - -func (b *Broadcast[T]) Add(ctx context.Context, value *T) error { - payload, err := MarshalGzipJSON(value) - if err != nil { - return errors.WithStack(err) - } - - args := &redis.XAddArgs{ - Stream: b.key, - MaxLen: 10, - Approx: true, - Values: map[string]interface{}{ - broadcastValueField: payload, - }, - } - - err = b.client.XAdd(ctx, args).Err() - return errors.WithStack(err) -} - -func (b *Broadcast[T]) Read(ctx context.Context, id string) (*T, string, error) { - args := &redis.XReadArgs{ - Streams: []string{b.key, id}, - Count: 1, - Block: time.Minute, - } - - streams, err := b.client.XRead(ctx, args).Result() - if err != nil { - return nil, id, errors.WithStack(err) - } - - for _, stream := range streams { - for _, sm := range stream.Messages { - payload := sm.Values[broadcastValueField].(string) - value, err := UnmarshalGzipJSON[T](payload) - if err != nil { - return nil, id, errors.WithStack(err) - } - - //lint:ignore SA4004 We just want to have the first message and - //returning withing two loops is easier than checking lengths. - return value, sm.ID, nil - } - } - - return nil, id, errors.Errorf("no data") -} diff --git a/pkg/redisutil/index.go b/pkg/redisutil/index.go deleted file mode 100644 index 4f2ead0..0000000 --- a/pkg/redisutil/index.go +++ /dev/null @@ -1,47 +0,0 @@ -package redisutil - -import ( - "context" - - "github.com/pkg/errors" - "github.com/redis/go-redis/v9" -) - -type RedisIndexer interface { - SMembers(ctx context.Context, key string) *redis.StringSliceCmd - MGet(ctx context.Context, keys ...string) *redis.SliceCmd - SRem(ctx context.Context, key string, members ...interface{}) *redis.IntCmd -} - -func IndexVacuum(ctx context.Context, c RedisIndexer, indexKey string, dataKeyPrefix Prefix) error { - ids, err := c.SMembers(ctx, indexKey).Result() - if err != nil { - return errors.Wrap(err, "failed to get ids") - } - - if len(ids) == 0 { - return nil - } - - keys := dataKeyPrefix.Keys(ids) - - values, err := c.MGet(ctx, keys...).Result() - if err != nil { - return errors.Wrap(err, "failed to retrieve values") - } - - expired := []interface{}{} - for k, value := range values { - id := ids[k] - if value == nil { - expired = append(expired, id) - } - } - - if len(expired) == 0 { - return nil - } - - err = c.SRem(ctx, indexKey, expired...).Err() - return errors.Wrap(err, "failed to delete expired keys") -} diff --git a/pkg/redisutil/index_test.go b/pkg/redisutil/index_test.go deleted file mode 100644 index c48a52d..0000000 --- a/pkg/redisutil/index_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package redisutil - -import ( - "context" - "testing" - - "github.com/alicebob/miniredis/v2" - "github.com/redis/go-redis/v9" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestIndexVacuum(t *testing.T) { - mr, err := miniredis.Run() - require.NoError(t, err) - defer mr.Close() - - redisClient := redis.NewClient(&redis.Options{ - Addr: mr.Addr(), - }) - - var ( - indexKey = "index" - dataPrefix = Prefix("data") - ) - - t.Run("NoIndex", func(t *testing.T) { - mr.FlushAll() - err := IndexVacuum(context.Background(), redisClient, indexKey, dataPrefix) - assert.NoError(t, err) - }) - - t.Run("EmptyIndex", func(t *testing.T) { - mr.FlushAll() - mr.SAdd(indexKey) - err := IndexVacuum(context.Background(), redisClient, indexKey, dataPrefix) - assert.NoError(t, err) - }) - - t.Run("NoExpiredIndex", func(t *testing.T) { - mr.FlushAll() - mr.SAdd(indexKey, "foobar") - mr.Set(dataPrefix.Key("foobar"), "something") - err := IndexVacuum(context.Background(), redisClient, indexKey, dataPrefix) - assert.NoError(t, err) - }) - - t.Run("SimpleExpire", func(t *testing.T) { - mr.FlushAll() - mr.SAdd(indexKey, "foo", "bar") - mr.Set(dataPrefix.Key("bar"), "blubber") - err := IndexVacuum(context.Background(), redisClient, indexKey, dataPrefix) - assert.NoError(t, err) - - ids, err := mr.Members(indexKey) - assert.NoError(t, err) - assert.Equal(t, []string{"bar"}, ids) - }) -} diff --git a/pkg/typeutil/set.go b/pkg/typeutil/set.go deleted file mode 100644 index bf116fd..0000000 --- a/pkg/typeutil/set.go +++ /dev/null @@ -1,165 +0,0 @@ -package typeutil - -import ( - "encoding/json" - "fmt" - "sort" - - "golang.org/x/exp/constraints" -) - -// Set implements a set data structure based on built-in maps. This is not -// optimized for large data, but to be convient. -type Set[T constraints.Ordered] struct { - data map[T]struct{} -} - -// NewSet initializes a new Set with the given values. If there are no values -// provides this is equivalent to new(Set[T]). -func NewSet[T constraints.Ordered](values ...T) *Set[T] { - s := new(Set[T]) - for i := range values { - s.Add(values[i]) - } - return s -} - -// Add puts a single value to the set. The set will be the same, if it already -// contains the value. -func (s *Set[T]) Add(value T) { - if s.data == nil { - s.data = map[T]struct{}{} - } - - s.data[value] = struct{}{} -} - -// Contains returns true, if the given value is part of the set. -func (s *Set[T]) Contains(value T) bool { - if s == nil || s.data == nil { - return false - } - - _, found := s.data[value] - return found -} - -// Remove removes the given value from the set. The set will be the same, if -// the value is not part of it. -func (s *Set[T]) Remove(value T) { - if s == nil || s.data == nil { - return - } - - delete(s.data, value) -} - -// Substract removes every element from the given set from the set. -func (s *Set[T]) Subtract(other *Set[T]) { - if s == nil || s.data == nil { - return - } - - for value := range other.data { - delete(s.data, value) - } -} - -// Len returns the number of all values in the set. -func (s *Set[T]) Len() int { - if s == nil || s.data == nil { - return 0 - } - return len(s.data) -} - -// ToList converts the set into a slice. Since the set uses a map as an -// underlying data structure, this will copy each value. So it might be memory -// intensive. Also it sorts the slice to ensure a cosistent result. -func (s *Set[T]) ToList() []T { - if s == nil || s.data == nil { - return nil - } - - list := make([]T, 0, len(s.data)) - - if len(s.data) > 0 { - for v := range s.data { - list = append(list, v) - } - } - - sort.Slice(list, func(i, j int) bool { return list[i] < list[j] }) - - return list -} - -// AddSet adds each value from the given set to the set. -func (s *Set[T]) AddSet(other *Set[T]) { - if other == nil { - return - } - - for o := range other.data { - s.Add(o) - } -} - -// MarshalJSON adds support for mashaling the set into a JSON list. -func (s Set[T]) MarshalJSON() ([]byte, error) { - list := s.ToList() - return json.Marshal(list) -} - -// MarshalJSON adds support for unmashaling the set from a JSON list. -func (s *Set[T]) UnmarshalJSON(data []byte) error { - list := []T{} - err := json.Unmarshal(data, &list) - if err != nil { - return fmt.Errorf("unmarshal set: %w", err) - } - - for _, v := range list { - s.Add(v) - } - - return nil -} - -func SetUnion[T constraints.Ordered](sets ...*Set[T]) *Set[T] { - result := new(Set[T]) - - for s := range sets { - result.AddSet(sets[s]) - } - - return result -} - -// SetIntersect returns a set that only contains elements which exist in all -// sets. -func SetIntersect[T constraints.Ordered](sets ...*Set[T]) *Set[T] { - result := new(Set[T]) - - for _, s := range sets { - if s == nil || s.data == nil { - return result - } - } - - if len(sets) == 0 { - return result - } - - result.AddSet(sets[0]) - - for _, s := range sets[1:] { - for e := range result.data { - if !s.Contains(e) { - delete(result.data, e) - } - } - } - - return result -} diff --git a/pkg/typeutil/set_test.go b/pkg/typeutil/set_test.go deleted file mode 100644 index 3deae70..0000000 --- a/pkg/typeutil/set_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package typeutil - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestSet(t *testing.T) { - toJSON := func(t *testing.T, set Set[string]) string { - data, err := json.Marshal(set) - assert.NoError(t, err) - return string(data) - } - - fromJSON := func(t *testing.T, data string) Set[string] { - var set Set[string] - err := json.Unmarshal([]byte(data), &set) - assert.NoError(t, err) - return set - } - - t.Run("Simple", func(t *testing.T) { - var set Set[string] - set.Add("foo") - set.Add("bar") - set.Add("bar") - assert.Equal(t, `["bar","foo"]`, toJSON(t, set)) - }) - - t.Run("JSON", func(t *testing.T) { - in := `["bar","foo"]` - set := fromJSON(t, `["bar","foo"]`) - out := toJSON(t, set) - - assert.Equal(t, in, out) - }) -} - -func TestSetUnion(t *testing.T) { - cases := []struct { - Name string - A, B *Set[string] - Want *Set[string] - }{ - { - Name: "Simple", - A: NewSet("a", "b", "c"), - B: NewSet("c", "d", "e"), - Want: NewSet("a", "b", "c", "d", "e"), - }, - { - Name: "NilB", - A: NewSet("a", "b", "c"), - B: nil, - Want: NewSet("a", "b", "c"), - }, - } - - for _, tc := range cases { - t.Run(tc.Name, func(t *testing.T) { - have := SetUnion(tc.A, tc.B) - require.Equal(t, tc.Want.ToList(), have.ToList()) - }) - } -} - -func TestSetIntersection(t *testing.T) { - cases := []struct { - Name string - A, B *Set[string] - Want *Set[string] - }{ - { - Name: "Simple", - A: NewSet("a", "b", "c", "d"), - B: NewSet("c", "d", "e"), - Want: NewSet("c", "d"), - }, - { - Name: "NilB", - A: NewSet("a", "b", "c"), - B: nil, - Want: NewSet[string](), - }, - } - - for _, tc := range cases { - t.Run(tc.Name, func(t *testing.T) { - have := SetIntersect(tc.A, tc.B) - require.Equal(t, tc.Want.ToList(), have.ToList()) - }) - } -} - -func TestSetNilLen(t *testing.T) { - var s *Set[string] - assert.Equal(t, 0, s.Len()) -} diff --git a/pkg/typeutil/slice.go b/pkg/typeutil/slice.go deleted file mode 100644 index 974b0fb..0000000 --- a/pkg/typeutil/slice.go +++ /dev/null @@ -1,23 +0,0 @@ -package typeutil - -func LimitSlice[T any](slice []T, limit int) ([]T, int) { - l := len(slice) - - if l <= limit { - return slice, 0 - } - - return slice[0:limit], l - limit -} - -func FilterSlice[T any](in []T, fn func(T) bool) []T { - result := []T{} - - for i := range in { - if fn(in[i]) { - result = append(result, in[i]) - } - } - - return result -} From a4678365a4b84dc84145398c6dc6d59b8186bf88 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 13:01:30 +0200 Subject: [PATCH 2/7] rm deprecated uses --- pkg/cmdutil/command.go | 17 ++--------------- pkg/cmdutil/context.go | 2 +- pkg/cmdutil/exit.go | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/pkg/cmdutil/command.go b/pkg/cmdutil/command.go index 0ed8b34..af553f6 100644 --- a/pkg/cmdutil/command.go +++ b/pkg/cmdutil/command.go @@ -24,7 +24,7 @@ func New(use, desc string, options ...Option) *cobra.Command { for _, o := range options { err := o(cmd) - Must(err) + must(err) if cmd.PreRun != nil { preRuns = append(preRuns, cmd.PreRun) @@ -62,19 +62,6 @@ func WithSubCommand(sub *cobra.Command) Option { } } -// deprecated: Use WithRun instead. It gets replaced, because different -// subcommands (eg dev and daemon) usually do not share flags. Therefore it is -// cumbersome to mangle their flags into the same struct. WithRunner allows -// using separate structs for subcommands. -// -// See examples in https://github.com/rebuy-de/rebuy-go-sdk/pull/147/files for migration demonstration. -func WithRun(run RunFuncWithContext) Option { - return func(cmd *cobra.Command) error { - cmd.Run = wrapRootConext(run) - return nil - } -} - // Binder defines the interface used by the generic [WithRun] function. type Runner interface { Bind(*cobra.Command) error @@ -91,7 +78,7 @@ func WithRunner(runner Runner) Option { cmd.Run = func(cmd *cobra.Command, args []string) { ctx := SignalRootContext() err := runner.Run(ctx) - Must(err) + must(err) } return nil } diff --git a/pkg/cmdutil/context.go b/pkg/cmdutil/context.go index a793535..5f0b588 100644 --- a/pkg/cmdutil/context.go +++ b/pkg/cmdutil/context.go @@ -53,7 +53,7 @@ func wrapRootConext(run RunFuncWithContext) RunFunc { // background it creates a new context with ContextWithValuesFrom and cancels // it after the original one got canceled. func ContextWithDelay(in context.Context, delay time.Duration) context.Context { - out := ContextWithValuesFrom(in) + out := context.WithoutCancel(in) out, cancel := context.WithCancel(out) go func() { diff --git a/pkg/cmdutil/exit.go b/pkg/cmdutil/exit.go index 344c32e..7cb1515 100644 --- a/pkg/cmdutil/exit.go +++ b/pkg/cmdutil/exit.go @@ -2,6 +2,8 @@ package cmdutil import ( "os" + + "github.com/sirupsen/logrus" ) const ( @@ -39,3 +41,21 @@ func HandleExit() { panic(e) // not an Exit, bubble up } } + +// Must exits the application via Exit(1) and logs the error, if err does not +// equal nil. Additionally it logs the error with `%+v` to the debug log, so it +// can used together with github.com/pkg/errors to retrive more details about +// the error. +// +// Deprecated: This should also not be used within the SDK, but removing this +// would require a refactoring, that would be unnecessarily visible in +// application code. +func must(err error) { + if err == nil { + return + } + + logrus.Debugf("%+v", err) + logrus.Error(err) + Exit(ExitCodeGeneralError) +} From 506d83d0d0093a544c0eff7f9511323221c336d9 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 14:26:56 +0200 Subject: [PATCH 3/7] simplify buildutil --- cmd/buildutil/logutil.go | 9 +- cmd/buildutil/main.go | 51 +------ cmd/buildutil/runner.go | 277 ++++++++++----------------------------- 3 files changed, 76 insertions(+), 261 deletions(-) diff --git a/cmd/buildutil/logutil.go b/cmd/buildutil/logutil.go index 3aed829..99526ca 100644 --- a/cmd/buildutil/logutil.go +++ b/cmd/buildutil/logutil.go @@ -5,14 +5,17 @@ import ( "fmt" "os" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" "github.com/tidwall/pretty" ) -func dumpJSON(data interface{}) { +func dumpJSON(data interface{}) error { b, err := json.MarshalIndent(data, "", " ") - cmdutil.Must(err) + if err != nil { + return err + } b = pretty.Color(b, pretty.TerminalStyle) fmt.Fprintln(os.Stderr, string(b)) + + return nil } diff --git a/cmd/buildutil/main.go b/cmd/buildutil/main.go index dbe251b..bfc7a4f 100644 --- a/cmd/buildutil/main.go +++ b/cmd/buildutil/main.go @@ -1,8 +1,6 @@ package main import ( - "context" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -17,59 +15,12 @@ func main() { } func NewRootCommand() *cobra.Command { - runner := new(Runner) - return cmdutil.New( "buildutil", "Build tool for Go projects as part of the rebuy-go-sdk", cmdutil.WithLogVerboseFlag(), cmdutil.WithVersionCommand(), cmdutil.WithVersionLog(logrus.DebugLevel), - runner.Bind, - cmdutil.WithRun(runner.RunAll), - - cmdutil.WithSubCommand(cmdutil.New( - "info", "Show project info", - // Info output is already done by the prerun, therefore we do not - // need to actually do anything. - cmdutil.WithRun(func(ctx context.Context, cmd *cobra.Command, args []string) {}), - )), - - cmdutil.WithSubCommand(cmdutil.New( - "vendor", "Update vendor directory", - cmdutil.WithRun(runner.RunVendor), - )), - cmdutil.WithSubCommand(cmdutil.New( - "test", "Run unit tests", - cmdutil.WithRun(runner.RunTest), - cmdutil.WithSubCommand(cmdutil.New( - "fmt", "Tests file formatting", - cmdutil.WithRun(runner.RunTestFormat), - )), - cmdutil.WithSubCommand(cmdutil.New( - "vet", "Tests for suspicious constructs", - cmdutil.WithRun(runner.RunTestVet), - )), - cmdutil.WithSubCommand(cmdutil.New( - "packages", "Tests Packages", - cmdutil.WithRun(runner.RunTestPackages), - )), - )), - cmdutil.WithSubCommand(cmdutil.New( - "build", "Build binaries", - cmdutil.WithRun(runner.RunBuild), - )), - cmdutil.WithSubCommand(cmdutil.New( - "artifacts", "Create artifacts", - cmdutil.WithRun(runner.RunArtifacts), - )), - cmdutil.WithSubCommand(cmdutil.New( - "upload", "Upload artifacts to S3", - cmdutil.WithRun(runner.RunUpload), - )), - cmdutil.WithSubCommand(cmdutil.New( - "clean", "Clean workspace", - cmdutil.WithRun(runner.RunClean), - )), + cmdutil.WithRunner(new(Runner)), ) } diff --git a/cmd/buildutil/runner.go b/cmd/buildutil/runner.go index 7c21c09..faa3edf 100644 --- a/cmd/buildutil/runner.go +++ b/cmd/buildutil/runner.go @@ -1,39 +1,28 @@ package main import ( - "archive/tar" - "compress/gzip" "context" + "errors" "fmt" - "io" - "net/url" "os" "os/exec" "path" - "path/filepath" "strings" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/feature/s3/manager" - "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/goreleaser/nfpm/v2" _ "github.com/goreleaser/nfpm/v2/deb" // blank import to register the format - "github.com/goreleaser/nfpm/v2/files" _ "github.com/goreleaser/nfpm/v2/rpm" // blank import to register the format "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/executil" ) -func call(ctx context.Context, command string, args ...string) { +func call(ctx context.Context, command string, args ...string) error { logrus.Debugf("$ %s %s", command, strings.Join(args, " ")) c := exec.Command(command, args...) c.Stderr = os.Stderr c.Stdout = os.Stdout - cmdutil.Must(executil.Run(ctx, c)) + return executil.Run(ctx, c) } type BuildParameters struct { @@ -90,16 +79,6 @@ func (r *Runner) Bind(cmd *cobra.Command) error { "Which Go command to use.") cmd.PersistentPreRun = func(cmd *cobra.Command, args []string) { - defer r.Inst.Durations.Steps.Stopwatch("info")() - info, err := CollectBuildInformation(context.Background(), r.Parameters) - cmdutil.Must(err) - - dumpJSON(info) - if len(info.Commit.DirtyFiles) > 0 { - logrus.Warn("The repository contains uncommitted files!") - } - - r.Info = info } cmd.PersistentPostRun = func(cmd *cobra.Command, args []string) { @@ -114,57 +93,76 @@ func (r *Runner) dist(parts ...string) string { return path.Join(parts...) } -func (r *Runner) RunAll(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) Run(ctx context.Context) error { defer r.Inst.Durations.Steps.Stopwatch("all")() - r.RunVendor(ctx, cmd, args) - r.RunTest(ctx, cmd, args) - r.RunBuild(ctx, cmd, args) - r.RunArtifacts(ctx, cmd, args) - r.RunUpload(ctx, cmd, args) + return runSeq(ctx, + r.collectInfo, + r.runVendor, + r.runTest, + r.runBuild, + ) } -func (r *Runner) RunClean(ctx context.Context, cmd *cobra.Command, args []string) { - defer r.Inst.Durations.Steps.Stopwatch("clean")() +func (r *Runner) collectInfo(ctx context.Context) error { + defer r.Inst.Durations.Steps.Stopwatch("info")() - files, err := filepath.Glob(r.dist("*")) - cmdutil.Must(err) + info, err := CollectBuildInformation(context.Background(), r.Parameters) + if err != nil { + return err + } - for _, file := range files { - logrus.Info("remove ", file) - os.Remove(file) + dumpJSON(info) + if len(info.Commit.DirtyFiles) > 0 { + logrus.Warn("The repository contains uncommitted files!") } + + r.Info = info + return nil } -func (r *Runner) RunVendor(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runVendor(ctx context.Context) error { defer r.Inst.Durations.Steps.Stopwatch("vendor")() if r.Info.Go.Work == "" { - call(ctx, r.Parameters.GoCommand, "mod", "vendor") - } else { - call(ctx, r.Parameters.GoCommand, "work", "vendor") + return call(ctx, r.Parameters.GoCommand, "mod", "vendor") + } + + return call(ctx, r.Parameters.GoCommand, "work", "vendor") +} + +func runSeq(ctx context.Context, fns ...func(ctx context.Context) error) error { + for _, fn := range fns { + err := fn(ctx) + if err != nil { + return err + } } + + return nil } -func (r *Runner) RunTest(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runTest(ctx context.Context) error { defer r.Inst.Durations.Steps.Stopwatch("test")() - r.RunTestFormat(ctx, cmd, args) - r.RunTestStaticcheck(ctx, cmd, args) - r.RunTestVet(ctx, cmd, args) - r.RunTestPackages(ctx, cmd, args) + return runSeq(ctx, + r.runTestFormat, + r.runTestStaticcheck, + r.runTestVet, + r.runTestPackages, + ) } -func (r *Runner) RunTestFormat(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runTestFormat(ctx context.Context) error { a := []string{"-s", "-l"} a = append(a, r.Info.Test.Files...) logrus.Info("Testing file formatting (gofmt)") defer r.Inst.Durations.Testing.Stopwatch("fmt")() - call(ctx, "gofmt", a...) + return call(ctx, "gofmt", a...) } -func (r *Runner) RunTestStaticcheck(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runTestStaticcheck(ctx context.Context) error { fail := []string{ "all", "-SA1019", // Using a deprecated function, variable, constant or field @@ -172,7 +170,7 @@ func (r *Runner) RunTestStaticcheck(ctx context.Context, cmd *cobra.Command, arg logrus.Info("Testing staticcheck") defer r.Inst.Durations.Testing.Stopwatch("staticcheck")() - call(ctx, r.Parameters.GoCommand, + return call(ctx, r.Parameters.GoCommand, "run", "honnef.co/go/tools/cmd/staticcheck", "-f", "stylish", "-fail", strings.Join(fail, ","), @@ -180,25 +178,25 @@ func (r *Runner) RunTestStaticcheck(ctx context.Context, cmd *cobra.Command, arg ) } -func (r *Runner) RunTestVet(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runTestVet(ctx context.Context) error { a := []string{"vet"} a = append(a, r.Info.Test.Packages...) logrus.Info("Testing suspicious constructs (go vet)") defer r.Inst.Durations.Testing.Stopwatch("vet")() - call(ctx, r.Parameters.GoCommand, a...) + return call(ctx, r.Parameters.GoCommand, a...) } -func (r *Runner) RunTestPackages(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runTestPackages(ctx context.Context) error { a := []string{"test"} a = append(a, r.Info.Test.Packages...) logrus.Info("Testing packages") defer r.Inst.Durations.Testing.Stopwatch("packages")() - call(ctx, r.Parameters.GoCommand, a...) + return call(ctx, r.Parameters.GoCommand, a...) } -func (r *Runner) RunBuild(ctx context.Context, cmd *cobra.Command, args []string) { +func (r *Runner) runBuild(ctx context.Context) error { defer r.Inst.Durations.Steps.Stopwatch("build")() for _, target := range r.Info.Targets { @@ -227,12 +225,18 @@ func (r *Runner) RunBuild(ctx context.Context, cmd *cobra.Command, args []string )) } - cmdutil.Must(os.Setenv("GOOS", target.System.OS)) - cmdutil.Must(os.Setenv("GOARCH", target.System.Arch)) + cgoEnabled := "0" if target.CGO { - cmdutil.Must(os.Setenv("CGO_ENABLED", "1")) - } else { - cmdutil.Must(os.Setenv("CGO_ENABLED", "0")) + cgoEnabled = "1" + } + + err := errors.Join( + os.Setenv("GOOS", target.System.OS), + os.Setenv("GOARCH", target.System.Arch), + os.Setenv("CGO_ENABLED", cgoEnabled), + ) + if err != nil { + return fmt.Errorf("set env vars: %w", err) } buildArgs := []string{ @@ -248,158 +252,15 @@ func (r *Runner) RunBuild(ctx context.Context, cmd *cobra.Command, args []string buildArgs = append(buildArgs, target.Package) sw := r.Inst.Durations.Building.Stopwatch(target.Outfile) - call(ctx, r.Parameters.GoCommand, buildArgs...) - - r.Inst.ReadSize(target.Outfile) - - sw() - } -} - -func (r *Runner) RunArtifacts(ctx context.Context, cmd *cobra.Command, args []string) { - defer r.Inst.Durations.Steps.Stopwatch("artifacts")() - - for _, artifact := range r.Info.Artifacts { - logrus.Infof("Creating artifact for %s", artifact.Filename) - sw := r.Inst.Durations.Artifacts.Stopwatch(artifact.Filename) - - binaries := map[string]string{} - for _, target := range r.Info.Targets { - if target.System != artifact.System { - continue - } - - binaries[target.Name] = r.dist(target.Outfile) + err = call(ctx, r.Parameters.GoCommand, buildArgs...) + if err != nil { + return fmt.Errorf("build %s %v: %w", r.Parameters.GoCommand, buildArgs, err) } - switch artifact.Kind { - default: - logrus.Warnf("Unknown artifact kind %s", artifact.Kind) - - case "binary": - // nothing to do here - - case "tgz": - dst, err := os.Create(r.dist(artifact.Filename)) - cmdutil.Must(err) - defer dst.Close() - - zw := gzip.NewWriter(dst) - defer zw.Close() - - tw := tar.NewWriter(zw) - defer tw.Close() - - for name, src := range binaries { - f, err := os.Open(src) - cmdutil.Must(err) - defer f.Close() - - fi, err := f.Stat() - cmdutil.Must(err) - - hdr := &tar.Header{ - Name: name, - Mode: 0755, - Size: fi.Size(), - } - err = tw.WriteHeader(hdr) - cmdutil.Must(err) - - _, err = io.Copy(tw, f) - cmdutil.Must(err) - } - - cmdutil.Must(tw.Close()) - - case "rpm": - fallthrough - - case "deb": - version, release := r.Info.Version.StringRelease() - - bindir := "/usr/bin" - contents := files.Contents{} - - for name, src := range binaries { - content := files.Content{ - Source: src, - Destination: path.Join(bindir, name), - } - contents = append(contents, &content) - } - - info := &nfpm.Info{ - Name: r.Info.Go.Name, - Arch: artifact.System.Arch, - Platform: artifact.System.OS, - Version: version, - Release: release, - Maintainer: "reBuy Platform Team ", - Overridables: nfpm.Overridables{ - Contents: contents, - }, - } - - cmdutil.Must(nfpm.Validate(info)) - - packager, err := nfpm.Get(artifact.Kind) - cmdutil.Must(err) - - w, err := os.Create(r.dist(artifact.Filename)) - cmdutil.Must(err) - defer w.Close() - - cmdutil.Must(packager.Package(nfpm.WithDefaults(info), w)) - cmdutil.Must(w.Close()) - } - - r.Inst.ReadSize(artifact.Filename) - - // create symlinks - for _, link := range artifact.Aliases { - fullLink := r.dist(link) - os.Remove(fullLink) - cmdutil.Must(os.Symlink(artifact.Filename, fullLink)) - } + r.Inst.ReadSize(target.Outfile) sw() } -} -func (r *Runner) RunUpload(ctx context.Context, cmd *cobra.Command, args []string) { - defer r.Inst.Durations.Steps.Stopwatch("upload")() - - cfg, err := config.LoadDefaultConfig(ctx, config.WithDefaultRegion("eu-west-1")) - cmdutil.Must(err) - - uploader := manager.NewUploader(s3.NewFromConfig(cfg)) - for _, artifact := range r.Info.Artifacts { - if artifact.S3Location == nil { - continue - } - - us := artifact.S3Location.String() - logrus.Infof("Uploading %s", us) - sw := r.Inst.Durations.Upload.Stopwatch(us) - - f, err := os.Open(r.dist(artifact.Filename)) - cmdutil.Must(err) - - tags := url.Values{} - tags.Set("GoModule", r.Info.Go.Module) - tags.Set("Branch", r.Info.Commit.Branch) - tags.Set("System", artifact.System.Name()) - tags.Set("ReleaseKind", r.Info.Version.Kind) - - _, err = uploader.Upload(ctx, &s3.PutObjectInput{ - Bucket: &artifact.S3Location.Bucket, - Key: &artifact.S3Location.Key, - Tagging: aws.String(tags.Encode()), - Body: f, - }) - cmdutil.Must(err) - - sw() - } + return nil } From 6295cc975d06947c8ad4fab0cc4720b200cd4bd9 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 14:27:56 +0200 Subject: [PATCH 4/7] apply go fmt --- pkg/cmdutil/doc.go | 76 +++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/pkg/cmdutil/doc.go b/pkg/cmdutil/doc.go index 55c1487..4cfe697 100644 --- a/pkg/cmdutil/doc.go +++ b/pkg/cmdutil/doc.go @@ -4,7 +4,7 @@ // An example application can be found at // https://github.com/rebuy-de/golang-template. // -// Graceful Application Exits +// # Graceful Application Exits // // In many command line applications it is desired to exit the process // immediately, if it is clear that the application cannot recover. Important @@ -25,19 +25,19 @@ // struct and catches it right before the application exit. This is an example // to illustrate the usage: // -// func main() { -// defer cmdutil.HandleExit() -// run() -// } +// func main() { +// defer cmdutil.HandleExit() +// run() +// } // -// func run() { -// defer fmt.Println("important cleanup") -// err := doSomething() -// if err != nil { -// log.Error(err) -// cmdutil.Exit(2) -// } -// } +// func run() { +// defer fmt.Println("important cleanup") +// err := doSomething() +// if err != nil { +// log.Error(err) +// cmdutil.Exit(2) +// } +// } // // The defer of HandleExit is the first statement in the main function. It // ensures a pretty output and that the application exits with the specified @@ -47,7 +47,7 @@ // error actually appears on external logging applications like Syslog or // Graylog. // -// Minimal Application Boilerplate +// # Minimal Application Boilerplate // // Golang is very helpful for creating glue code in the ops area and creating // micro services. But when you want features like proper logging, a version @@ -55,25 +55,25 @@ // needed. NewRootCommand creates a ready-to-use Cobra command to reduce the // necessary code. This is an example to illustrate the usage: // -// type App struct { -// Name string -// } +// type App struct { +// Name string +// } // -// func (app *App) Run(cmd *cobra.Command, args []string) { -// log.Infof("hello %s", app.Name) -// } +// func (app *App) Run(cmd *cobra.Command, args []string) { +// log.Infof("hello %s", app.Name) +// } // -// func (app *App) Bind(cmd *cobra.Command) { -// cmd.PersistentFlags().StringVarP( -// &app.Name, "name", "n", "world", -// `Your name.`) -// } +// func (app *App) Bind(cmd *cobra.Command) { +// cmd.PersistentFlags().StringVarP( +// &app.Name, "name", "n", "world", +// `Your name.`) +// } // -// func NewRootCommand() *cobra.Command { -// cmd := cmdutil.NewRootCommand(new(App)) -// cmd.Short = "an example app for golang which can be used as template" -// return cmd -// } +// func NewRootCommand() *cobra.Command { +// cmd := cmdutil.NewRootCommand(new(App)) +// cmd.Short = "an example app for golang which can be used as template" +// return cmd +// } // // The App struct contains fields for parameters which are defined in Bind or // for internal states which might get defined while running the application. @@ -82,12 +82,12 @@ // the compiled version of the application and other build parameters. These // values need to be set by the build system via ldflags. // -// BUILD_XDST=$(pwd)/vendor/github.com/rebuy-de/rebuy-go-sdk/cmdutil -// go build -ldflags "\ -// -X '${BUILD_XDST}.BuildName=${NAME}' \ -// -X '${BUILD_XDST}.BuildPackage=${PACKAGE}' \ -// -X '${BUILD_XDST}.BuildVersion=${BUILD_VERSION}' \ -// -X '${BUILD_XDST}.BuildDate=${BUILD_DATE}' \ -// -X '${BUILD_XDST}.BuildHash=${BUILD_HASH}' \ -// -X '${BUILD_XDST}.BuildEnvironment=${BUILD_ENVIRONMENT}' \ +// BUILD_XDST=$(pwd)/vendor/github.com/rebuy-de/rebuy-go-sdk/cmdutil +// go build -ldflags "\ +// -X '${BUILD_XDST}.BuildName=${NAME}' \ +// -X '${BUILD_XDST}.BuildPackage=${PACKAGE}' \ +// -X '${BUILD_XDST}.BuildVersion=${BUILD_VERSION}' \ +// -X '${BUILD_XDST}.BuildDate=${BUILD_DATE}' \ +// -X '${BUILD_XDST}.BuildHash=${BUILD_HASH}' \ +// -X '${BUILD_XDST}.BuildEnvironment=${BUILD_ENVIRONMENT}' \ package cmdutil From a7eb3d8c751935877677789ba8d4381f7474c943 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 14:28:24 +0200 Subject: [PATCH 5/7] remove cdnmirror --- cmd/cdnmirror/main.go | 132 ------------------------------------------ 1 file changed, 132 deletions(-) delete mode 100644 cmd/cdnmirror/main.go diff --git a/cmd/cdnmirror/main.go b/cmd/cdnmirror/main.go deleted file mode 100644 index b3ecefe..0000000 --- a/cmd/cdnmirror/main.go +++ /dev/null @@ -1,132 +0,0 @@ -package main - -import ( - "bytes" - "context" - "fmt" - "io" - "net/http" - "os" - "path" - "path/filepath" - - "github.com/evanw/esbuild/pkg/api" - "github.com/pkg/errors" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" - "github.com/sirupsen/logrus" - "github.com/spf13/cobra" -) - -const targetPathPrefix = `assets/cdnmirror` - -func main() { - defer cmdutil.HandleExit() - if err := NewRootCommand().Execute(); err != nil { - logrus.Fatal(err) - } -} - -func NewRootCommand() *cobra.Command { - return cmdutil.New( - "cdnmirror", "Downloads assets from CDNs so the server can serve them directly.", - cmdutil.WithLogVerboseFlag(), - cmdutil.WithRunner(new(Generate)), - ) -} - -type Generate struct { - Source string - Target string - Minify string -} - -func (g *Generate) Bind(cmd *cobra.Command) error { - cmd.PersistentFlags().StringVar( - &g.Source, "source", "", `URL to the original CDN.`) - cmd.PersistentFlags().StringVar( - &g.Target, "target", "", `Name of the target file in assets/cdnmirror`) - cmd.PersistentFlags().StringVar( - &g.Minify, "minify", "", `Minify file with given type; allowed values: js`) - return nil -} - -func (g *Generate) Run(ctx context.Context) error { - err := os.MkdirAll(targetPathPrefix, 0755) - if err != nil { - return err - } - - err = writeGitignore() - if err != nil { - return err - } - - return g.download() -} - -func writeGitignore() error { - filename := path.Join(targetPathPrefix, ".gitignore") - - buf := new(bytes.Buffer) - fmt.Fprintln(buf, "*") - fmt.Fprintln(buf, "!.gitignore") - - return os.WriteFile(filename, buf.Bytes(), 0644) -} - -func (g *Generate) download() error { - targetFile := filepath.FromSlash(path.Join(targetPathPrefix, g.Target)) - - resp, err := http.Get(g.Source) - if err != nil { - return fmt.Errorf("request source: %w", err) - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return fmt.Errorf(resp.Status) - } - - body, err := io.ReadAll(resp.Body) - if err != nil { - return fmt.Errorf("read source: %w", err) - } - - var code string - - switch g.Minify { - case "js": - result := api.Transform(string(body), api.TransformOptions{ - MinifyWhitespace: true, - MinifyIdentifiers: true, - MinifySyntax: true, - }) - if len(result.Errors) != 0 { - return errors.Errorf("%#v", result.Errors) - } - code = string(result.Code) - - case "": - code = string(body) - default: - return fmt.Errorf("invalid minify option %q", g.Minify) - } - - err = os.MkdirAll(path.Dir(targetFile), 0755) - if err != nil { - return fmt.Errorf("create target dir: %w", err) - } - - f, err := os.Create(targetFile) - if err != nil { - return fmt.Errorf("create target file: %w", err) - } - defer f.Close() - - _, err = io.WriteString(f, code) - if err != nil { - return fmt.Errorf("write file: %w", err) - } - - return nil -} From d51492b88005f86624729a87892cc7a57b4d7e09 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 14:34:23 +0200 Subject: [PATCH 6/7] remove more deprecated functions --- cmd/buildutil/info.go | 59 +++-------------------------------------- cmd/buildutil/runner.go | 14 ---------- pkg/cmdutil/context.go | 29 -------------------- pkg/podutil/dev.go | 5 ++-- 4 files changed, 7 insertions(+), 100 deletions(-) diff --git a/cmd/buildutil/info.go b/cmd/buildutil/info.go index 79020da..e6fdcea 100644 --- a/cmd/buildutil/info.go +++ b/cmd/buildutil/info.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "net/url" "os" "path" "regexp" @@ -12,7 +11,6 @@ import ( "strings" "time" - "github.com/pkg/errors" "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" "github.com/sirupsen/logrus" "golang.org/x/mod/modfile" @@ -173,11 +171,10 @@ type BuildInfo struct { } type ArtifactInfo struct { - Kind string - Filename string - S3Location *S3URL `json:",omitempty"` - Aliases []string `json:",omitempty"` - System SystemInfo + Kind string + Filename string + Aliases []string `json:",omitempty"` + System SystemInfo } func (i *BuildInfo) NewArtifactInfo(kind string, name string, system SystemInfo, ext string) ArtifactInfo { @@ -395,53 +392,5 @@ func CollectBuildInformation(ctx context.Context, p BuildParameters) (BuildInfo, } } - if p.S3URL != "" { - base, err := ParseS3URL(p.S3URL) - if err != nil { - return info, errors.WithStack(err) - } - - for i, a := range info.Artifacts { - u := base.Subpath(a.Filename) - info.Artifacts[i].S3Location = &u - } - } - return info, nil } - -type S3URL struct { - Bucket string - Key string -} - -func ParseS3URL(raw string) (*S3URL, error) { - u, err := url.Parse(raw) - if err != nil { - return nil, errors.Wrap(err, "failed to parse S3 URL") - } - - if u.Scheme != "s3" && u.Scheme != "" { - return nil, errors.Errorf("Unknown scheme %s for the S3 URL", u.Scheme) - } - - return &S3URL{ - Bucket: u.Host, - Key: strings.TrimPrefix(path.Clean(u.Path), "/"), - }, nil -} - -func (u S3URL) Subpath(p ...string) S3URL { - p = append([]string{u.Key}, p...) - u.Key = path.Join(p...) - return u // This is actually a copy, since we do not use pointers. -} - -func (u S3URL) String() string { - return fmt.Sprintf("s3://%s/%s", u.Bucket, u.Key) -} - -func (u S3URL) MarshalJSON() ([]byte, error) { - s := u.String() - return json.Marshal(s) -} diff --git a/cmd/buildutil/runner.go b/cmd/buildutil/runner.go index faa3edf..1e29b5c 100644 --- a/cmd/buildutil/runner.go +++ b/cmd/buildutil/runner.go @@ -9,8 +9,6 @@ import ( "path" "strings" - _ "github.com/goreleaser/nfpm/v2/deb" // blank import to register the format - _ "github.com/goreleaser/nfpm/v2/rpm" // blank import to register the format "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -55,19 +53,7 @@ func (r *Runner) Bind(cmd *cobra.Command) error { cmd.PersistentFlags().StringSliceVarP( &r.Parameters.TargetPackages, "package", "p", []string{}, "Packages to build.") - cmd.PersistentFlags().StringVar( - &r.Parameters.S3URL, "s3-url", "", - "S3 URL to upload compiled releases.") - cmd.PersistentFlags().BoolVar( - &r.Parameters.CreateCompressed, "compress", false, - "Creates .tgz artifacts for POSIX targets and .zip for windows.") - cmd.PersistentFlags().BoolVar( - &r.Parameters.CreateRPM, "rpm", false, - "Creates .rpm artifacts for linux targets.") - cmd.PersistentFlags().BoolVar( - &r.Parameters.CreateDEB, "deb", false, - "Creates .deb artifacts for linux targets.") cmd.PersistentFlags().BoolVar( &r.Parameters.CGO, "cgo", false, "Enable CGO.") diff --git a/pkg/cmdutil/context.go b/pkg/cmdutil/context.go index 5f0b588..b1e456c 100644 --- a/pkg/cmdutil/context.go +++ b/pkg/cmdutil/context.go @@ -42,13 +42,6 @@ func SignalContext(ctx context.Context, signals ...os.Signal) context.Context { type RunFunc func(cmd *cobra.Command, args []string) type RunFuncWithContext func(ctx context.Context, cmd *cobra.Command, args []string) -func wrapRootConext(run RunFuncWithContext) RunFunc { - return func(cmd *cobra.Command, args []string) { - run(SignalRootContext(), cmd, args) - } - -} - // ContextWithDelay delays the context cancel by the given delay. In the // background it creates a new context with ContextWithValuesFrom and cancels // it after the original one got canceled. @@ -63,25 +56,3 @@ func ContextWithDelay(in context.Context, delay time.Duration) context.Context { }() return out } - -type compositeContext struct { - deadline context.Context - done context.Context - err context.Context - value context.Context -} - -func (c compositeContext) Deadline() (deadline time.Time, ok bool) { - return c.deadline.Deadline() -} -func (c compositeContext) Done() <-chan struct{} { - return c.done.Done() -} - -func (c compositeContext) Err() error { - return c.err.Err() -} - -func (c compositeContext) Value(key any) any { - return c.value.Value(key) -} diff --git a/pkg/podutil/dev.go b/pkg/podutil/dev.go index d817697..735fb1d 100644 --- a/pkg/podutil/dev.go +++ b/pkg/podutil/dev.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/cmdutil" "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/logutil" ) @@ -48,7 +47,9 @@ func StartDevcontainer(ctx context.Context, conn *Connection, name string, image // API. TimeoutSeconds: 3600 * 8, }, opts...) - cmdutil.Must(err) + if err != nil { + return nil, err + } container, err = conn.InspectContainer(name) if err != nil { From 77a7af61e2eaa6ca2081d94f4b4838fb59d8b1fc Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Tue, 11 Jun 2024 15:05:32 +0200 Subject: [PATCH 7/7] fix full example --- examples/full/cmd/inst.go | 47 ++++---- examples/full/cmd/server.go | 2 - examples/full/go.mod | 64 +---------- examples/full/go.sum | 216 ------------------------------------ 4 files changed, 21 insertions(+), 308 deletions(-) diff --git a/examples/full/cmd/inst.go b/examples/full/cmd/inst.go index 6f90851..dde0893 100644 --- a/examples/full/cmd/inst.go +++ b/examples/full/cmd/inst.go @@ -5,41 +5,35 @@ import ( "net/http" "strings" - "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/instutil" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" "github.com/rebuy-de/rebuy-go-sdk/v8/pkg/logutil" ) // inst.go contains all functions for handling instrumentation (ie metrics and -// logs). All functions do not have an attached type and only rely on the -// context, so we do not have to pass another variable through the code. Having -// the instrumentation code in its own file gives a better separation between -// instrumentation code and actual buisniess logic. Each package can have its -// own ist.go file. - -// We store the metric names in a constant, because this is our only reference -// in the code and using literal strings might be prone to errors. -const ( - instRequestsAcceptEncodingMetric = "request_accept_encoding_total" - instRequestsMetric = "request_total" +// logs). Having the instrumentation code in its own file gives a better +// separation between instrumentation code and actual buisniess logic. Each +// package can have its own inst.go file. + +var ( + instRequestsAcceptEncodingMetric = promauto.NewCounterVec(prometheus.CounterOpts{ + Namespace: "rebuy_go_sdk", + Subsystem: "requests", + Name: "encoding_total", + }, []string{"encoding"}) + instRequestsMetric = promauto.NewCounter(prometheus.CounterOpts{ + Namespace: "rebuy_go_sdk", + Subsystem: "requests", + Name: "total", + }) ) -func InstInit(ctx context.Context) context.Context { - ctx = instutil.NewCounterVec(ctx, instRequestsAcceptEncodingMetric, "encoding") - ctx = instutil.NewCounter(ctx, instRequestsMetric) - return ctx -} - func InstIndexRequest(ctx context.Context, r *http.Request) { logutil.Get(ctx). WithFields(logutil.FromStruct(r.Header)). Infof("got request") - c, ok := instutil.Counter(ctx, instRequestsMetric) - if ok { - // We need to check whether the metric was initialized to avoid a nil - // dereference. - c.Inc() - } + instRequestsMetric.Inc() // We have a metric that lists all accepted encodings. Together with the // total request count we get a ratio of each encoding. This is a good @@ -52,10 +46,7 @@ func InstIndexRequest(ctx context.Context, r *http.Request) { continue } - cv, ok := instutil.CounterVec(ctx, instRequestsAcceptEncodingMetric) - if ok { - cv.WithLabelValues(accept).Inc() - } + instRequestsAcceptEncodingMetric.WithLabelValues(accept).Inc() } } } diff --git a/examples/full/cmd/server.go b/examples/full/cmd/server.go index 36aefe0..a261766 100644 --- a/examples/full/cmd/server.go +++ b/examples/full/cmd/server.go @@ -27,8 +27,6 @@ type Server struct { } func (s *Server) Run(ctx context.Context) error { - ctx = InstInit(ctx) - // Using a errors group is a good practice to manage multiple parallel // running routines and should used once on program startup. group, ctx := errgroup.WithContext(ctx) diff --git a/examples/full/go.mod b/examples/full/go.mod index e8ddd96..73d5577 100644 --- a/examples/full/go.mod +++ b/examples/full/go.mod @@ -7,6 +7,7 @@ replace github.com/rebuy-de/rebuy-go-sdk/v8 => ../.. require ( github.com/go-chi/chi/v5 v5.0.12 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.18.0 github.com/rebuy-de/rebuy-go-sdk/v8 v8.0.0 github.com/redis/go-redis/v9 v9.5.1 github.com/sirupsen/logrus v1.9.3 @@ -16,96 +17,35 @@ require ( ) require ( - dario.cat/mergo v1.0.0 // indirect - github.com/AlekSi/pointer v1.2.0 // indirect github.com/BurntSushi/toml v1.2.1 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect - github.com/aws/aws-sdk-go-v2 v1.25.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.50.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb // indirect - github.com/cavaliergopher/cpio v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect github.com/coreos/go-oidc/v3 v3.9.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/emirpasic/gods v1.18.1 // indirect github.com/gemnasium/logrus-graylog-hook/v3 v3.2.0 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/go-git/go-git/v5 v5.11.0 // indirect github.com/go-jose/go-jose/v3 v3.0.1 // indirect - github.com/gobwas/glob v0.2.3 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/rpmpack v0.5.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/goreleaser/chglog v0.5.0 // indirect - github.com/goreleaser/fileglob v1.3.0 // indirect - github.com/goreleaser/nfpm/v2 v2.35.3 // indirect github.com/gorilla/securecookie v1.1.2 // indirect github.com/gorilla/sessions v1.2.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/huandu/xstrings v1.4.0 // indirect - github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.17.5 // indirect - github.com/klauspost/pgzip v1.2.6 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/sergi/go-diff v1.3.1 // indirect - github.com/shopspring/decimal v1.2.0 // indirect - github.com/skeema/knownhosts v1.2.1 // indirect - github.com/spf13/cast v1.5.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect - gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.21.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/tools v0.18.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/examples/full/go.sum b/examples/full/go.sum index b0f4f2f..2a06abb 100644 --- a/examples/full/go.sum +++ b/examples/full/go.sum @@ -1,127 +1,31 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= -github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= -github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -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/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k= -github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= -github.com/ProtonMail/gopenpgp/v2 v2.7.1 h1:Awsg7MPc2gD3I7IFac2qE3Gdls0lZW8SzrFZ3k1oz0s= -github.com/ProtonMail/gopenpgp/v2 v2.7.1/go.mod h1:/BU5gfAVwqyd8EfC3Eu7zmuhwYQpKs+cGD8M//iiaxs= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.31.1 h1:7XAt0uUg3DtwEKW5ZAGa+K7FZV2DdKQo5K/6TTnfX8Y= github.com/alicebob/miniredis/v2 v2.31.1/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= -github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0 h1:2UO6/nT1lCZq1LqM67Oa4tdgP1CvL1sLSxvuD+VrOeE= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.0/go.mod h1:5zGj2eA85ClyedTDK+Whsu+w9yimnVIZvhvBKrDquM8= -github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= -github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= -github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.2 h1:VEekE/fJWqAWYozxFQ07B+h8NdvTPAYhV13xIBenuO0= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.2/go.mod h1:8vozqAHmDNmoD4YbuDKIfpnLbByzngczL4My1RELLVo= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 h1:TkbRExyKSVHELwG9gz2+gql37jjec2R5vus9faTomwE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0/go.mod h1:T3/9xMKudHhnj8it5EqIrhvv11tVZqWYkKcot+BFStc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 h1:UiSyK6ent6OKpkMJN3+k5HZ4sk4UfchEaaW5wv7SblQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0/go.mod h1:l7kzl8n8DXoRyFz5cIMG70HnPauWa649TUhgw8Rq6lo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 h1:l5puwOHr7IxECuPMIuZG7UKOzAnF24v6t4l+Z5Moay4= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0/go.mod h1:Oov79flWa/n7Ni+lQC3z+VM7PoRM47omRqbJU9B5Y7E= -github.com/aws/aws-sdk-go-v2/service/s3 v1.50.1 h1:bjpWJEXch7moIt3PX2r5XpGROsletl7enqG1Q3Te1Dc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.50.1/go.mod h1:1o/W6JFUuREj2ExoQ21vHJgO7wakvjhol91M9eknFgs= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= -github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= -github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= -github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= -github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/caarlos0/go-rpmutils v0.2.1-0.20240105125627-01185134a559 h1:5TPRjT2njvPKzXUcrcg6Dt+JPzQF+M5K7xb5V1Nwteg= -github.com/caarlos0/go-rpmutils v0.2.1-0.20240105125627-01185134a559/go.mod h1:sUS7SdlihaphHRYa/Uu4haxl9zL6DLGrFjoTsurEYOw= -github.com/caarlos0/testfs v0.4.4 h1:3PHvzHi5Lt+g332CiShwS8ogTgS3HjrmzZxCm6JCDr8= -github.com/caarlos0/testfs v0.4.4/go.mod h1:bRN55zgG4XCUVVHZCeU+/Tz1Q6AxEJOEJTliBy+1DMk= -github.com/cavaliergopher/cpio v1.0.1 h1:KQFSeKmZhv0cr+kawA3a0xTQCU4QxXF1vhU7P7av2KM= -github.com/cavaliergopher/cpio v1.0.1/go.mod h1:pBdaqQjnvXxdS/6CvNDwIANIFSP0xRKI16PX4xejRQc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/coreos/go-oidc/v3 v3.9.0 h1:0J/ogVOd4y8P0f0xUh8l9t07xRP/d8tccvjHl2dcsSo= github.com/coreos/go-oidc/v3 v3.9.0/go.mod h1:rTKz2PYwftcrtoCzV5g5kvfJoWcm0Mk8AF8y1iAQro4= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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/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/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/gemnasium/logrus-graylog-hook/v3 v3.2.0 h1:kWqYB1mtpWV+VM0a4epClv1dP6ICDJiA0Zas3d2G0ow= github.com/gemnasium/logrus-graylog-hook/v3 v3.2.0/go.mod h1:h8lScu3mcvljXI5lvuIt72V6NdJiW2KqxWWN0asGxNQ= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= -github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -135,70 +39,20 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/rpmpack v0.5.0 h1:L16KZ3QvkFGpYhmp23iQip+mx1X39foEsqszjMNBm8A= -github.com/google/rpmpack v0.5.0/go.mod h1:uqVAUVQLq8UY2hCDfmJ/+rtO3aw7qyhc90rCVEabEfI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= -github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= -github.com/goreleaser/chglog v0.5.0 h1:Sk6BMIpx8+vpAf8KyPit34OgWui8c7nKTMHhYx88jJ4= -github.com/goreleaser/chglog v0.5.0/go.mod h1:Ri46M3lrMuv76FHszs3vtABR8J8k1w9JHYAzxeeOl28= -github.com/goreleaser/fileglob v1.3.0 h1:/X6J7U8lbDpQtBvGcwwPS6OpzkNVlVEsFUVRx9+k+7I= -github.com/goreleaser/fileglob v1.3.0/go.mod h1:Jx6BoXv3mbYkEzwm9THo7xbr5egkAraxkGorbJb4RxU= -github.com/goreleaser/nfpm/v2 v2.35.3 h1:YGEygriY8hbsNdCBUif6RLb5xPISDHc+d22rRGXV4Zk= -github.com/goreleaser/nfpm/v2 v2.35.3/go.mod h1:eyKRLSdXPCV1GgJ0tDNe4SqcZD0Fr5cezRwcuLjpxyM= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY= github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= 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/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= -github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= -github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= -github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= 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= @@ -213,121 +67,61 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= -github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3hlSdrBH/b3SdnW/LMY= -github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w= -github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -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.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -gitlab.com/digitalxero/go-conventional-commit v1.0.7 h1:8/dO6WWG+98PMhlZowt/YjuiKhqhGlOCwlIV8SqqGh8= -gitlab.com/digitalxero/go-conventional-commit v1.0.7/go.mod h1:05Xc2BFsSyC5tKhK0y+P3bs0AwUtNuTp+mTpbCU/DZ0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/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.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -339,16 +133,6 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=