From a92fdd383b70ca7776f7824a7b71d1a706eaa231 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 01:14:59 +0200 Subject: [PATCH 01/38] updated Deprecated comments --- config/config.go | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/config/config.go b/config/config.go index 455757ed9..18fc6cf8d 100644 --- a/config/config.go +++ b/config/config.go @@ -181,24 +181,15 @@ type Config struct { FqdnOnly FqdnOnlyConfig `yaml:",inline"` Filtering FilteringConfig `yaml:"filtering"` Ede EdeConfig `yaml:"ede"` - // Deprecated - DisableIPv6 bool `yaml:"disableIPv6" default:"false"` - // Deprecated - LogLevel log.Level `yaml:"logLevel" default:"info"` - // Deprecated - LogFormat log.FormatType `yaml:"logFormat" default:"text"` - // Deprecated - LogPrivacy bool `yaml:"logPrivacy" default:"false"` - // Deprecated - LogTimestamp bool `yaml:"logTimestamp" default:"true"` - // Deprecated - DNSPorts ListenConfig `yaml:"port" default:"53"` - // Deprecated - HTTPPorts ListenConfig `yaml:"httpPort"` - // Deprecated - HTTPSPorts ListenConfig `yaml:"httpsPort"` - // Deprecated - TLSPorts ListenConfig `yaml:"tlsPort"` + DisableIPv6 bool `yaml:"disableIPv6" default:"false"` // Deprecated: use Filtering with TypeAAAA + LogLevel log.Level `yaml:"logLevel" default:"info"` // Deprecated: use Log.Level + LogFormat log.FormatType `yaml:"logFormat" default:"text"` // Deprecated: use Log.Format + LogPrivacy bool `yaml:"logPrivacy" default:"false"` // Deprecated: use Log.Privacy + LogTimestamp bool `yaml:"logTimestamp" default:"true"` // Deprecated: use Log.Timestamp + DNSPorts ListenConfig `yaml:"port" default:"53"` // Deprecated: use Ports.DNS + HTTPPorts ListenConfig `yaml:"httpPort"` // Deprecated: use Ports.HTTP + HTTPSPorts ListenConfig `yaml:"httpsPort"` // Deprecated: use Ports.HTTPS + TLSPorts ListenConfig `yaml:"tlsPort"` // Deprecated: use Ports.TLS } type PortsConfig struct { From 83eba7c81199c4ff7351a9d4b83fb96dcc9d6e97 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 01:38:37 +0200 Subject: [PATCH 02/38] moved redis config t seperate file --- config/config.go | 22 ++++------------------ config/redis.go | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 config/redis.go diff --git a/config/config.go b/config/config.go index 18fc6cf8d..165ca29d2 100644 --- a/config/config.go +++ b/config/config.go @@ -221,20 +221,6 @@ type ( } ) -// RedisConfig configuration for the redis connection -type RedisConfig struct { - Address string `yaml:"address"` - Username string `yaml:"username" default:""` - Password string `yaml:"password" default:""` - Database int `yaml:"database" default:"0"` - Required bool `yaml:"required" default:"false"` - ConnectionAttempts int `yaml:"connectionAttempts" default:"3"` - ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` - SentinelUsername string `yaml:"sentinelUsername" default:""` - SentinelPassword string `yaml:"sentinelPassword" default:""` - SentinelAddresses []string `yaml:"sentinelAddresses"` -} - type ( FqdnOnlyConfig = toEnable EdeConfig = toEnable @@ -365,12 +351,10 @@ func unmarshalConfig(data []byte, cfg *Config) error { return fmt.Errorf("wrong file structure: %w", err) } - validateConfig(cfg) - - return nil + return validateConfig(cfg) } -func validateConfig(cfg *Config) { +func validateConfig(cfg *Config) error { if cfg.DisableIPv6 { log.Log().Warnf("'disableIPv6' is deprecated. Please use 'filtering.queryTypes' with 'AAAA' instead.") @@ -391,6 +375,8 @@ func validateConfig(cfg *Config) { fixDeprecatedLog(cfg) fixDeprecatedPorts(cfg) + + return fixDeprecatedRedis(cfg) } // fixDeprecatedLog ensures backwards compatibility for logging options diff --git a/config/redis.go b/config/redis.go new file mode 100644 index 000000000..eeced6897 --- /dev/null +++ b/config/redis.go @@ -0,0 +1,41 @@ +package config + +import ( + "fmt" + + "github.com/0xERR0R/blocky/log" +) + +// RedisConfig configuration for the redis connection +type RedisConfig struct { + Addresses []string `yaml:"addresses"` + Username string `yaml:"username" default:""` + Password string `yaml:"password" default:""` + SentinelUsername string `yaml:"sentinelUsername" default:""` + SentinelPassword string `yaml:"sentinelPassword" default:""` + SentinelMasterSet string `yaml:"sentinelMasterSet" default:""` + Database int `yaml:"database" default:"0"` + ConnectionAttempts int `yaml:"connectionAttempts" default:"3"` + ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` + Required bool `yaml:"required" default:"false"` + Address string `yaml:"address"` // Deprecated: use Addresses + SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses +} + +func fixDeprecatedRedis(cfg *Config) error { + if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.Address) > 0 { + log.Log().Warnln("'redis.address' is deprecated. Please use 'redis.addresses' instead.") + + cfg.Redis.Addresses = []string{cfg.Redis.Address} + } else if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.SentinelAddresses) > 0 { + log.Log().Warnln("'redis.sentinelAddresses' is deprecated. Please use 'redis.addresses' instead.") + + cfg.Redis.Addresses = cfg.Redis.SentinelAddresses + + if len(cfg.Redis.SentinelMasterSet) == 0 { + return fmt.Errorf("'redis.sentinelMasterSet' has to be set if Redis Sentinel is used") + } + } + + return nil +} From 5d2420a18256efec4c883d37a495a5448ace1227 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 01:45:33 +0200 Subject: [PATCH 03/38] added more ruedis options --- config/redis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/redis.go b/config/redis.go index eeced6897..9ca7d65ba 100644 --- a/config/redis.go +++ b/config/redis.go @@ -17,6 +17,8 @@ type RedisConfig struct { Database int `yaml:"database" default:"0"` ConnectionAttempts int `yaml:"connectionAttempts" default:"3"` ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` + ConnRingScale int `yaml:"connRingScale" default:"10"` + ShuffleInit bool `yaml:"shuffleInit" default:"false"` Required bool `yaml:"required" default:"false"` Address string `yaml:"address"` // Deprecated: use Addresses SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses From 56d181ce2a1452d60d2ac9ffd4c566af8f01220d Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 02:05:26 +0200 Subject: [PATCH 04/38] fmt,lint&test --- .../stringcache/chained_grouped_cache_test.go | 1 - .../in_memory_grouped_cache_test.go | 2 - config/blocking_test.go | 4 +- config/caching_test.go | 4 +- config/client_lookup_test.go | 4 +- config/conditional_upstream_test.go | 4 +- config/config.go | 2 +- config/config_test.go | 33 ++++++++---- config/custom_dns_test.go | 4 +- config/filtering_test.go | 4 +- config/hosts_file_test.go | 4 +- config/metrics_test.go | 4 +- config/parallel_best_test.go | 4 +- config/query_log_test.go | 4 +- config/redis_test.go | 50 +++++++++++++++++++ config/rewriter_test.go | 4 +- lists/parsers/adapt.go | 2 +- lists/parsers/filtererrors_test.go | 4 +- lists/parsers/hosts_test.go | 12 ++--- lists/parsers/parser_test.go | 4 +- util/arpa.go | 4 +- 21 files changed, 91 insertions(+), 67 deletions(-) create mode 100644 config/redis_test.go diff --git a/cache/stringcache/chained_grouped_cache_test.go b/cache/stringcache/chained_grouped_cache_test.go index 5823f6f25..e83f9560e 100644 --- a/cache/stringcache/chained_grouped_cache_test.go +++ b/cache/stringcache/chained_grouped_cache_test.go @@ -89,6 +89,5 @@ var _ = Describe("Chained grouped cache", func() { Expect(cache.Contains("both", []string{"group1", "group2"})).Should(ConsistOf("group2")) }) }) - }) }) diff --git a/cache/stringcache/in_memory_grouped_cache_test.go b/cache/stringcache/in_memory_grouped_cache_test.go index 71bf5ef16..7692935a9 100644 --- a/cache/stringcache/in_memory_grouped_cache_test.go +++ b/cache/stringcache/in_memory_grouped_cache_test.go @@ -32,7 +32,6 @@ var _ = Describe("In-Memory grouped cache", func() { Expect(cache.Contains("searchString", []string{"group1"})).Should(BeEmpty()) }) }) - }) Describe("Cache creation", func() { When("cache with 1 group was created", func() { @@ -127,6 +126,5 @@ var _ = Describe("In-Memory grouped cache", func() { Expect(cache.Contains("both", []string{"group1", "group2"})).Should(ConsistOf("group2")) }) }) - }) }) diff --git a/config/blocking_test.go b/config/blocking_test.go index b806b028e..59258525c 100644 --- a/config/blocking_test.go +++ b/config/blocking_test.go @@ -10,9 +10,7 @@ import ( ) var _ = Describe("BlockingConfig", func() { - var ( - cfg BlockingConfig - ) + var cfg BlockingConfig suiteBeforeEach() diff --git a/config/caching_test.go b/config/caching_test.go index a295d0c95..1b80c7ac7 100644 --- a/config/caching_test.go +++ b/config/caching_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("CachingConfig", func() { - var ( - cfg CachingConfig - ) + var cfg CachingConfig suiteBeforeEach() diff --git a/config/client_lookup_test.go b/config/client_lookup_test.go index bdf169b71..a388dd959 100644 --- a/config/client_lookup_test.go +++ b/config/client_lookup_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("ClientLookupConfig", func() { - var ( - cfg ClientLookupConfig - ) + var cfg ClientLookupConfig suiteBeforeEach() diff --git a/config/conditional_upstream_test.go b/config/conditional_upstream_test.go index 7016a14c9..9f8d6eb31 100644 --- a/config/conditional_upstream_test.go +++ b/config/conditional_upstream_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("ConditionalUpstreamConfig", func() { - var ( - cfg ConditionalUpstreamConfig - ) + var cfg ConditionalUpstreamConfig suiteBeforeEach() diff --git a/config/config.go b/config/config.go index 165ca29d2..e54361e4c 100644 --- a/config/config.go +++ b/config/config.go @@ -156,7 +156,7 @@ func (b *BootstrappedUpstreamConfig) UnmarshalYAML(unmarshal func(interface{}) e // Config main configuration // -//nolint:maligned +//nolint:maligned,lll type Config struct { Upstream ParallelBestConfig `yaml:"upstream"` UpstreamTimeout Duration `yaml:"upstreamTimeout" default:"2s"` diff --git a/config/config_test.go b/config/config_test.go index 7eea1e660..0f5690e3a 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -35,7 +35,8 @@ var _ = Describe("Config", func() { When("parameter 'disableIPv6' is set", func() { It("should add 'AAAA' to filter.queryTypes", func() { c.DisableIPv6 = true - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Filtering.QueryTypes).Should(HaveKey(QType(dns.TypeAAAA))) Expect(c.Filtering.QueryTypes.Contains(dns.Type(dns.TypeAAAA))).Should(BeTrue()) }) @@ -49,12 +50,14 @@ var _ = Describe("Config", func() { } }) It("should change StartStrategy blocking to failOnError", func() { - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFailOnError)) }) It("shouldn't change StartStrategy if set to fast", func() { c.Blocking.StartStrategy = StartStrategyTypeFast - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Blocking.StartStrategy).Should(Equal(StartStrategyTypeFast)) }) }) @@ -62,7 +65,8 @@ var _ = Describe("Config", func() { When("parameter 'logLevel' is set", func() { It("should convert to log.level", func() { c.LogLevel = log.LevelDebug - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Log.Level).Should(Equal(log.LevelDebug)) }) }) @@ -70,7 +74,8 @@ var _ = Describe("Config", func() { When("parameter 'logFormat' is set", func() { It("should convert to log.format", func() { c.LogFormat = log.FormatTypeJson - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Log.Format).Should(Equal(log.FormatTypeJson)) }) }) @@ -78,7 +83,8 @@ var _ = Describe("Config", func() { When("parameter 'logPrivacy' is set", func() { It("should convert to log.privacy", func() { c.LogPrivacy = true - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Log.Privacy).Should(BeTrue()) }) }) @@ -86,7 +92,8 @@ var _ = Describe("Config", func() { When("parameter 'logTimestamp' is set", func() { It("should convert to log.timestamp", func() { c.LogTimestamp = false - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Log.Timestamp).Should(BeFalse()) }) }) @@ -95,7 +102,8 @@ var _ = Describe("Config", func() { It("should convert to ports.dns", func() { ports := ListenConfig([]string{"5333"}) c.DNSPorts = ports - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Ports.DNS).Should(Equal(ports)) }) }) @@ -104,7 +112,8 @@ var _ = Describe("Config", func() { It("should convert to ports.http", func() { ports := ListenConfig([]string{"5333"}) c.HTTPPorts = ports - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Ports.HTTP).Should(Equal(ports)) }) }) @@ -113,7 +122,8 @@ var _ = Describe("Config", func() { It("should convert to ports.https", func() { ports := ListenConfig([]string{"5333"}) c.HTTPSPorts = ports - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Ports.HTTPS).Should(Equal(ports)) }) }) @@ -122,7 +132,8 @@ var _ = Describe("Config", func() { It("should convert to ports.tls", func() { ports := ListenConfig([]string{"5333"}) c.TLSPorts = ports - validateConfig(&c) + err = validateConfig(&c) + Expect(err).Should(Succeed()) Expect(c.Ports.TLS).Should(Equal(ports)) }) }) diff --git a/config/custom_dns_test.go b/config/custom_dns_test.go index 0361bf20b..a96061cdd 100644 --- a/config/custom_dns_test.go +++ b/config/custom_dns_test.go @@ -10,9 +10,7 @@ import ( ) var _ = Describe("CustomDNSConfig", func() { - var ( - cfg CustomDNSConfig - ) + var cfg CustomDNSConfig suiteBeforeEach() diff --git a/config/filtering_test.go b/config/filtering_test.go index 648cd1865..4b4ce1682 100644 --- a/config/filtering_test.go +++ b/config/filtering_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("FilteringConfig", func() { - var ( - cfg FilteringConfig - ) + var cfg FilteringConfig suiteBeforeEach() diff --git a/config/hosts_file_test.go b/config/hosts_file_test.go index aa112080d..5f67feb81 100644 --- a/config/hosts_file_test.go +++ b/config/hosts_file_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("HostsFileConfig", func() { - var ( - cfg HostsFileConfig - ) + var cfg HostsFileConfig suiteBeforeEach() diff --git a/config/metrics_test.go b/config/metrics_test.go index afedbe77f..b5f968b2f 100644 --- a/config/metrics_test.go +++ b/config/metrics_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("MetricsConfig", func() { - var ( - cfg MetricsConfig - ) + var cfg MetricsConfig suiteBeforeEach() diff --git a/config/parallel_best_test.go b/config/parallel_best_test.go index 1f8f6e959..9acef009e 100644 --- a/config/parallel_best_test.go +++ b/config/parallel_best_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("ParallelBestConfig", func() { - var ( - cfg ParallelBestConfig - ) + var cfg ParallelBestConfig suiteBeforeEach() diff --git a/config/query_log_test.go b/config/query_log_test.go index 208f755c9..582fa34b1 100644 --- a/config/query_log_test.go +++ b/config/query_log_test.go @@ -9,9 +9,7 @@ import ( ) var _ = Describe("QueryLogConfig", func() { - var ( - cfg QueryLogConfig - ) + var cfg QueryLogConfig suiteBeforeEach() diff --git a/config/redis_test.go b/config/redis_test.go new file mode 100644 index 000000000..c356bdcf8 --- /dev/null +++ b/config/redis_test.go @@ -0,0 +1,50 @@ +package config + +import ( + "github.com/creasty/defaults" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +const ( + testAddress = "test-address" + masterSet = "test-set" +) + +var _ = Describe("RedisConfig", func() { + var err error + Describe("Deprecated parameters are converted", func() { + var c Config + BeforeEach(func() { + err := defaults.Set(&c) + Expect(err).Should(Succeed()) + }) + When("parameter 'address' is set", func() { + c.Redis.Address = testAddress + err = validateConfig(&c) + Expect(err).Should(Succeed()) + Expect(c.Redis.Addresses).Should(HaveLen(1)) + Expect(c.Redis.Addresses).Should(ContainElement(testAddress)) + }) + When("parameter 'sentinelAddresses' is setwith master set", func() { + c.Redis.SentinelAddresses = []string{testAddress} + c.Redis.SentinelMasterSet = masterSet + err = validateConfig(&c) + Expect(err).Should(Succeed()) + Expect(c.Redis.Addresses).Should(HaveLen(1)) + Expect(c.Redis.Addresses).Should(ContainElement(testAddress)) + }) + }) + Describe("Deprecated parameters are not converted", func() { + var c Config + BeforeEach(func() { + err := defaults.Set(&c) + Expect(err).Should(Succeed()) + }) + When("parameter 'sentinelAddresses' is set without master set", func() { + c.Redis.SentinelAddresses = []string{testAddress} + err = validateConfig(&c) + Expect(err).ShouldNot(Succeed()) + }) + }) +}) diff --git a/config/rewriter_test.go b/config/rewriter_test.go index 5b92083e0..a7414d560 100644 --- a/config/rewriter_test.go +++ b/config/rewriter_test.go @@ -7,9 +7,7 @@ import ( ) var _ = Describe("RewriterConfig", func() { - var ( - cfg RewriterConfig - ) + var cfg RewriterConfig suiteBeforeEach() diff --git a/lists/parsers/adapt.go b/lists/parsers/adapt.go index 8f6ce355e..6c08fc699 100644 --- a/lists/parsers/adapt.go +++ b/lists/parsers/adapt.go @@ -16,7 +16,7 @@ func TryAdapt[From, To any](inner SeriesParser[From], adapt func(From) (To, erro // TryAdaptMethod returns a parser that wraps `inner` and tries to convert each parsed value // using the given method with pointer receiver of `To`. -func TryAdaptMethod[ToPtr *To, From any, To any]( +func TryAdaptMethod[ToPtr *To, From, To any]( inner SeriesParser[From], method func(ToPtr, From) error, ) SeriesParser[*To] { return TryAdapt(inner, func(from From) (*To, error) { diff --git a/lists/parsers/filtererrors_test.go b/lists/parsers/filtererrors_test.go index 2c3fc7d1b..001552e6c 100644 --- a/lists/parsers/filtererrors_test.go +++ b/lists/parsers/filtererrors_test.go @@ -11,9 +11,7 @@ import ( var _ = Describe("errorFilter", func() { Describe("AllowErrors", func() { - var ( - parser SeriesParser[struct{}] - ) + var parser SeriesParser[struct{}] BeforeEach(func() { parser = newMockParser(func(res chan<- struct{}, err chan<- error) { diff --git a/lists/parsers/hosts_test.go b/lists/parsers/hosts_test.go index fcbe316df..f9b00f5fc 100644 --- a/lists/parsers/hosts_test.go +++ b/lists/parsers/hosts_test.go @@ -86,9 +86,7 @@ var _ = Describe("Hosts", func() { }) Describe("HostsIterator.ForEachHost", func() { - var ( - entry *HostsIterator - ) + var entry *HostsIterator BeforeEach(func() { sutReader = linesReader( @@ -227,9 +225,7 @@ var _ = Describe("HostsFile", func() { }) Describe("HostsFileEntry.forEachHost", func() { - var ( - entry *HostsFileEntry - ) + var entry *HostsFileEntry BeforeEach(func() { sutReader = linesReader( @@ -374,9 +370,7 @@ var _ = Describe("HostList", func() { }) Describe("HostListEntry.forEachHost", func() { - var ( - entry *HostListEntry - ) + var entry *HostListEntry BeforeEach(func() { sutReader = linesReader( diff --git a/lists/parsers/parser_test.go b/lists/parsers/parser_test.go index 45db523b3..25565f781 100644 --- a/lists/parsers/parser_test.go +++ b/lists/parsers/parser_test.go @@ -11,9 +11,7 @@ import ( ) var _ = Describe("ForEach", func() { - var ( - lines SeriesParser[string] - ) + var lines SeriesParser[string] BeforeEach(func() { lines = Lines(linesReader( diff --git a/util/arpa.go b/util/arpa.go index ee69b6945..f1bc4ab4a 100644 --- a/util/arpa.go +++ b/util/arpa.go @@ -15,9 +15,7 @@ const ( byteBits = 8 ) -var ( - ErrInvalidArpaAddrLen = errors.New("arpa hostname is not of expected length") -) +var ErrInvalidArpaAddrLen = errors.New("arpa hostname is not of expected length") func ParseIPFromArpaAddr(arpa string) (net.IP, error) { if strings.HasSuffix(arpa, IPv4PtrSuffix) { From 3d0447725123f87ec1b2fd99579382e5a8796a45 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 02:51:12 +0200 Subject: [PATCH 05/38] init ruedis --- config/redis.go | 2 + go.mod | 3 +- go.sum | 3 ++ redis/redis.go | 124 +++++++++++++++++++++++++++--------------------- 4 files changed, 77 insertions(+), 55 deletions(-) diff --git a/config/redis.go b/config/redis.go index 9ca7d65ba..217b9a819 100644 --- a/config/redis.go +++ b/config/redis.go @@ -20,6 +20,8 @@ type RedisConfig struct { ConnRingScale int `yaml:"connRingScale" default:"10"` ShuffleInit bool `yaml:"shuffleInit" default:"false"` Required bool `yaml:"required" default:"false"` + LocalCacheTime Duration `yaml:"localCacheTime" default:"10m"` + LocalCacheSize int `yaml:"localCacheSize" default:"1048576"` Address string `yaml:"address"` // Deprecated: use Addresses SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses } diff --git a/go.mod b/go.mod index d0df27d85..fe5ba112c 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect + github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect github.com/jackc/pgx/v5 v5.3.0 // indirect github.com/klauspost/compress v1.11.13 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -118,6 +118,7 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/ramr/go-reaper v0.2.1 + github.com/rueian/rueidis v0.0.96 github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect diff --git a/go.sum b/go.sum index 18a2934ff..1b9d8bb9d 100644 --- a/go.sum +++ b/go.sum @@ -228,6 +228,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -399,6 +400,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rueian/rueidis v0.0.96 h1:gbh+shmAu3E0C6XWWhopiFJrDoGVBQaCO++1WR3ABD8= +github.com/rueian/rueidis v0.0.96/go.mod h1:ivvsRYRtAUcf9OnheuKc5Gpa8IebrkLT1P45Lr2jlXE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/redis/redis.go b/redis/redis.go index adf22f1e3..a8c57beb8 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -11,15 +11,17 @@ import ( "github.com/0xERR0R/blocky/config" "github.com/0xERR0R/blocky/log" "github.com/0xERR0R/blocky/model" + "github.com/0xERR0R/blocky/util" "github.com/go-redis/redis/v8" "github.com/google/uuid" "github.com/miekg/dns" + "github.com/rueian/rueidis" "github.com/sirupsen/logrus" ) const ( SyncChannelName = "blocky_sync" - CacheStorePrefix = "blocky:cache:" + CacheStorePrefix = "blocky:cache:response:" chanCap = 1000 cacheReason = "EXTERNAL_CACHE" defaultCacheTime = 1 * time.Second @@ -56,7 +58,7 @@ type EnabledMessage struct { // Client for redis communication type Client struct { config *config.RedisConfig - client *redis.Client + client rueidis.Client l *logrus.Entry ctx context.Context id []byte @@ -68,61 +70,62 @@ type Client struct { // New creates a new redis client func New(cfg *config.RedisConfig) (*Client, error) { // disable redis if no address is provided - if cfg == nil || len(cfg.Address) == 0 { + if cfg == nil || len(cfg.Addresses) == 0 { return nil, nil //nolint:nilnil } - var rdb *redis.Client - if len(cfg.SentinelAddresses) > 0 { - rdb = redis.NewFailoverClient(&redis.FailoverOptions{ - MasterName: cfg.Address, - SentinelUsername: cfg.Username, - SentinelPassword: cfg.SentinelPassword, - SentinelAddrs: cfg.SentinelAddresses, - Username: cfg.Username, - Password: cfg.Password, - DB: cfg.Database, - MaxRetries: cfg.ConnectionAttempts, - MaxRetryBackoff: cfg.ConnectionCooldown.ToDuration(), - }) - } else { - rdb = redis.NewClient(&redis.Options{ - Addr: cfg.Address, - Username: cfg.Username, - Password: cfg.Password, - DB: cfg.Database, - MaxRetries: cfg.ConnectionAttempts, - MaxRetryBackoff: cfg.ConnectionCooldown.ToDuration(), - }) + id, err := uuid.New().MarshalBinary() + if err != nil { + return nil, err } - ctx := context.Background() + roption := rueidis.ClientOption{ + InitAddress: cfg.Addresses, + Password: cfg.Password, + Username: cfg.Username, + SelectDB: cfg.Database, + RingScaleEachConn: cfg.ConnRingScale, + CacheSizeEachConn: cfg.LocalCacheSize, + ClientName: fmt.Sprintf("blocky-%s", util.HostnameString()), + ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, + } - _, err := rdb.Ping(ctx).Result() - if err == nil { - var id []byte + if len(cfg.SentinelMasterSet) > 0 { + roption.Sentinel = rueidis.SentinelOption{ + Username: cfg.SentinelUsername, + Password: cfg.SentinelPassword, + MasterSet: cfg.SentinelMasterSet, + } + } - id, err = uuid.New().MarshalBinary() + var client rueidis.Client + for i := 0; i < cfg.ConnectionAttempts; i++ { + client, err = rueidis.NewClient(roption) if err == nil { - // construct client - res := &Client{ - config: cfg, - client: rdb, - l: log.PrefixedLog("redis"), - ctx: ctx, - id: id, - sendBuffer: make(chan *bufferMessage, chanCap), - CacheChannel: make(chan *CacheMessage, chanCap), - EnabledChannel: make(chan *EnabledMessage, chanCap), - } + break + } + time.Sleep(time.Duration(cfg.ConnectionCooldown)) + } + + if err != nil { + return nil, err + } - // start channel handling go routine - err = res.startup() + ctx := context.Background() - return res, err - } + res := &Client{ + config: cfg, + client: client, + l: log.PrefixedLog("redis"), + ctx: ctx, + id: id, + sendBuffer: make(chan *bufferMessage, chanCap), + CacheChannel: make(chan *CacheMessage, chanCap), + EnabledChannel: make(chan *EnabledMessage, chanCap), } + err = res.startup() + return nil, err } @@ -146,7 +149,11 @@ func (c *Client) PublishEnabled(state *EnabledMessage) { }) if mErr == nil { - c.client.Publish(c.ctx, SyncChannelName, binMsg) + c.client.Do(c.ctx, + c.client.B().Publish(). + Channel(SyncChannelName). + Message(rueidis.BinaryString(binMsg)). + Build()) } } } @@ -212,13 +219,19 @@ func (c *Client) publishMessageFromBuffer(s *bufferMessage) { }) if mErr == nil { - c.client.Publish(c.ctx, SyncChannelName, binMsg) + c.client.Do(c.ctx, + c.client.B().Publish(). + Channel(SyncChannelName). + Message(rueidis.BinaryString(binMsg)). + Build()) } - c.client.Set(c.ctx, - prefixKey(s.Key), - binRes, - c.getTTL(origRes)) + c.client.Do(c.ctx, + c.client.B().Setex(). + Key(prefixKey(s.Key)). + Seconds(int64(c.getTTL(origRes).Seconds())). + Value(rueidis.BinaryString(binRes)). + Build()) } } @@ -263,10 +276,13 @@ func (c *Client) processEnabledMessage(redisMsg *redisMessage) error { // getResponse returns model.Response for a key func (c *Client) getResponse(key string) (*CacheMessage, error) { - resp, err := c.client.Get(c.ctx, key).Result() + resp, err := c.client.Do(c.ctx, c.client.B().Get().Key(key).Build()).AsBytes() if err == nil { - var ttl time.Duration - ttl, err = c.client.TTL(c.ctx, key).Result() + uittl, err := c.client.Do(c.ctx, + c.client.B().Ttl(). + Key(key). + Build()).AsUint64() + ttl := time.Second * time.Duration(uittl) if err == nil { var result *CacheMessage From fe575d68a6ed20e469f9087038336c9efaa7f821 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 03:41:32 +0200 Subject: [PATCH 06/38] ruedis init --- redis/redis.go | 60 +++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/redis/redis.go b/redis/redis.go index a8c57beb8..802bbc54f 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -12,7 +12,6 @@ import ( "github.com/0xERR0R/blocky/log" "github.com/0xERR0R/blocky/model" "github.com/0xERR0R/blocky/util" - "github.com/go-redis/redis/v8" "github.com/google/uuid" "github.com/miekg/dns" "github.com/rueian/rueidis" @@ -163,15 +162,31 @@ func (c *Client) GetRedisCache() { c.l.Debug("GetRedisCache") go func() { - iter := c.client.Scan(c.ctx, 0, prefixKey("*"), 0).Iterator() - for iter.Next(c.ctx) { - response, err := c.getResponse(iter.Val()) - if err == nil { - if response != nil { - c.CacheChannel <- response - } - } else { + searchKey := prefixKey("*") + for { + sres, err := c.client.Do(c.ctx, c.client.B().Scan().Cursor(0).Match(searchKey).Build()).AsScanEntry() + + if err != nil { c.l.Error("GetRedisCache ", err) + break + } + + for _, key := range sres.Elements { + resp := c.client.Do(c.ctx, c.client.B().Get().Key(key).Build()) + if resp.Error() == nil { + str, err := resp.ToString() + if err == nil { + response, err := c.getResponse(str) + if err == nil { + c.CacheChannel <- response + } + } + } + fmt.Println("key", key) + } + + if sres.Cursor == 0 { // no more keys + break } } }() @@ -179,22 +194,21 @@ func (c *Client) GetRedisCache() { // startup starts a new goroutine for subscription and translation func (c *Client) startup() error { - ps := c.client.Subscribe(c.ctx, SyncChannelName) - - _, err := ps.Receive(c.ctx) + err := c.client.Receive(c.ctx, + c.client.B().Subscribe(). + Channel(SyncChannelName).Build(), func(msg rueidis.PubSubMessage) { + c.l.Debug("Received message: ", msg) + + if len(msg.Message) > 0 { + // message is not empty + c.processReceivedMessage(msg.Message) + } + }) if err == nil { go func() { for { select { - // received message from subscription - case msg := <-ps.Channel(): - c.l.Debug("Received message: ", msg) - - if msg != nil && len(msg.Payload) > 0 { - // message is not empty - c.processReceivedMessage(msg) - } - // publish message from buffer + // publish message from buffer case s := <-c.sendBuffer: c.publishMessageFromBuffer(s) } @@ -235,10 +249,10 @@ func (c *Client) publishMessageFromBuffer(s *bufferMessage) { } } -func (c *Client) processReceivedMessage(msg *redis.Message) { +func (c *Client) processReceivedMessage(msgPayload string) { var rm redisMessage - err := json.Unmarshal([]byte(msg.Payload), &rm) + err := json.Unmarshal([]byte(msgPayload), &rm) if err == nil { // message was sent from a different blocky instance if !bytes.Equal(rm.Client, c.id) { From 693617eb12d063effc068ccf01627f30663cdd2a Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 05:19:24 +0200 Subject: [PATCH 07/38] ruedis rework --- redis/redis.go | 126 ++++++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 48 deletions(-) diff --git a/redis/redis.go b/redis/redis.go index 802bbc54f..951f091cf 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -20,7 +20,7 @@ import ( const ( SyncChannelName = "blocky_sync" - CacheStorePrefix = "blocky:cache:response:" + CacheStorePrefix = "blocky:cache:" chanCap = 1000 cacheReason = "EXTERNAL_CACHE" defaultCacheTime = 1 * time.Second @@ -78,34 +78,28 @@ func New(cfg *config.RedisConfig) (*Client, error) { return nil, err } - roption := rueidis.ClientOption{ - InitAddress: cfg.Addresses, - Password: cfg.Password, - Username: cfg.Username, - SelectDB: cfg.Database, - RingScaleEachConn: cfg.ConnRingScale, - CacheSizeEachConn: cfg.LocalCacheSize, - ClientName: fmt.Sprintf("blocky-%s", util.HostnameString()), - ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, - } + l := log.PrefixedLog("redis") - if len(cfg.SentinelMasterSet) > 0 { - roption.Sentinel = rueidis.SentinelOption{ - Username: cfg.SentinelUsername, - Password: cfg.SentinelPassword, - MasterSet: cfg.SentinelMasterSet, - } - } + roption := generateClientOptions(cfg) var client rueidis.Client + for i := 0; i < cfg.ConnectionAttempts; i++ { + l.Debugf("connection attempt %d", i) + client, err = rueidis.NewClient(roption) + if err == nil { break + } else { + l.Debug(err) } + time.Sleep(time.Duration(cfg.ConnectionCooldown)) } + l.Debug("should be created") + if err != nil { return nil, err } @@ -115,7 +109,7 @@ func New(cfg *config.RedisConfig) (*Client, error) { res := &Client{ config: cfg, client: client, - l: log.PrefixedLog("redis"), + l: l, ctx: ctx, id: id, sendBuffer: make(chan *bufferMessage, chanCap), @@ -123,9 +117,9 @@ func New(cfg *config.RedisConfig) (*Client, error) { EnabledChannel: make(chan *EnabledMessage, chanCap), } - err = res.startup() + res.startup() - return nil, err + return res, nil } // PublishCache publish cache to redis async @@ -162,17 +156,25 @@ func (c *Client) GetRedisCache() { c.l.Debug("GetRedisCache") go func() { + var cursor uint64 + searchKey := prefixKey("*") - for { - sres, err := c.client.Do(c.ctx, c.client.B().Scan().Cursor(0).Match(searchKey).Build()).AsScanEntry() + for { + sres, err := c.client.Do(c.ctx, c.client.B().Scan().Cursor(cursor).Match(searchKey).Count(1).Build()).AsScanEntry() if err != nil { c.l.Error("GetRedisCache ", err) + break } + cursor = sres.Cursor + for _, key := range sres.Elements { + c.l.Debugf("GetRedisCache: %s", key) + resp := c.client.Do(c.ctx, c.client.B().Get().Key(key).Build()) + if resp.Error() == nil { str, err := resp.ToString() if err == nil { @@ -182,41 +184,69 @@ func (c *Client) GetRedisCache() { } } } - fmt.Println("key", key) } - if sres.Cursor == 0 { // no more keys + if cursor == 0 { // no more keys break } } }() } +func generateClientOptions(cfg *config.RedisConfig) rueidis.ClientOption { + res := rueidis.ClientOption{ + InitAddress: cfg.Addresses, + Password: cfg.Password, + Username: cfg.Username, + SelectDB: cfg.Database, + RingScaleEachConn: cfg.ConnRingScale, + CacheSizeEachConn: cfg.LocalCacheSize, + ClientName: fmt.Sprintf("blocky-%s", util.HostnameString()), + ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, + } + + if len(cfg.SentinelMasterSet) > 0 { + res.Sentinel = rueidis.SentinelOption{ + Username: cfg.SentinelUsername, + Password: cfg.SentinelPassword, + MasterSet: cfg.SentinelMasterSet, + } + } + + return res +} + // startup starts a new goroutine for subscription and translation -func (c *Client) startup() error { - err := c.client.Receive(c.ctx, - c.client.B().Subscribe(). - Channel(SyncChannelName).Build(), func(msg rueidis.PubSubMessage) { - c.l.Debug("Received message: ", msg) - - if len(msg.Message) > 0 { - // message is not empty - c.processReceivedMessage(msg.Message) - } - }) - if err == nil { - go func() { - for { - select { - // publish message from buffer - case s := <-c.sendBuffer: - c.publishMessageFromBuffer(s) +func (c *Client) startup() { + go func() { + dc, cancel := c.client.Dedicate() + defer cancel() + + wait := dc.SetPubSubHooks(rueidis.PubSubHooks{ + OnMessage: func(m rueidis.PubSubMessage) { + if m.Channel == SyncChannelName { + c.l.Debug("Received message: ", m) + + if len(m.Message) > 0 { + // message is not empty + c.processReceivedMessage(m.Message) + } } - } - }() - } + }, + }) - return err + dc.Do(c.ctx, dc.B().Subscribe().Channel(SyncChannelName).Build()) + + for { + select { + case <-wait: + return + // publish message from buffer + case s := <-c.sendBuffer: + c.publishMessageFromBuffer(s) + } + } + }() } func (c *Client) publishMessageFromBuffer(s *bufferMessage) { @@ -303,7 +333,7 @@ func (c *Client) getResponse(key string) (*CacheMessage, error) { result, err = convertMessage(&redisMessage{ Key: cleanKey(key), - Message: []byte(resp), + Message: resp, }, ttl) if err != nil { return nil, fmt.Errorf("conversion error: %w", err) From b162f923a102962e1654f371c87369e9fb15a661 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 05:21:00 +0200 Subject: [PATCH 08/38] go mod tidy --- go.sum | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/go.sum b/go.sum index 1b9d8bb9d..d6029d2e5 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -251,7 +250,6 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= From 1761801ca222d6d7225b571476088b5b00479112 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 05:30:46 +0200 Subject: [PATCH 09/38] redis unit test 1 --- redis/redis_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis_test.go b/redis/redis_test.go index 9ddf6185d..63bdcae92 100644 --- a/redis/redis_test.go +++ b/redis/redis_test.go @@ -34,7 +34,7 @@ var _ = Describe("Redis client", func() { Expect(err).Should(Succeed()) - rcfg.Address = redisServer.Addr() + rcfg.Addresses = []string{redisServer.Addr()} redisConfig = &rcfg redisClient, err = New(redisConfig) From a748b739913fb5348b3a38643b03e20417ec7ca1 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sat, 1 Apr 2023 19:33:52 +0200 Subject: [PATCH 10/38] changed redis config validation --- config/config.go | 4 +++- config/redis.go | 29 +++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/config/config.go b/config/config.go index e54361e4c..5b59224e5 100644 --- a/config/config.go +++ b/config/config.go @@ -376,7 +376,9 @@ func validateConfig(cfg *Config) error { fixDeprecatedPorts(cfg) - return fixDeprecatedRedis(cfg) + fixDeprecatedRedis(cfg) + + return validateRedisConfig(cfg) } // fixDeprecatedLog ensures backwards compatibility for logging options diff --git a/config/redis.go b/config/redis.go index 217b9a819..aa10c8862 100644 --- a/config/redis.go +++ b/config/redis.go @@ -19,26 +19,31 @@ type RedisConfig struct { ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` ConnRingScale int `yaml:"connRingScale" default:"10"` ShuffleInit bool `yaml:"shuffleInit" default:"false"` - Required bool `yaml:"required" default:"false"` LocalCacheTime Duration `yaml:"localCacheTime" default:"10m"` LocalCacheSize int `yaml:"localCacheSize" default:"1048576"` - Address string `yaml:"address"` // Deprecated: use Addresses - SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses + Required bool `yaml:"required" default:"false"` // Deprecated: always required if enabled + Address string `yaml:"address"` // Deprecated: use Addresses + SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses } -func fixDeprecatedRedis(cfg *Config) error { - if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.Address) > 0 { - log.Log().Warnln("'redis.address' is deprecated. Please use 'redis.addresses' instead.") - - cfg.Redis.Addresses = []string{cfg.Redis.Address} - } else if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.SentinelAddresses) > 0 { +func fixDeprecatedRedis(cfg *Config) { + if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.SentinelAddresses) > 0 { log.Log().Warnln("'redis.sentinelAddresses' is deprecated. Please use 'redis.addresses' instead.") cfg.Redis.Addresses = cfg.Redis.SentinelAddresses + } else if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.Address) > 0 { + log.Log().Warnln("'redis.address' is deprecated. Please use 'redis.addresses' instead.") + + cfg.Redis.Addresses = []string{cfg.Redis.Address} + } +} - if len(cfg.Redis.SentinelMasterSet) == 0 { - return fmt.Errorf("'redis.sentinelMasterSet' has to be set if Redis Sentinel is used") - } +func validateRedisConfig(cfg *Config) error { + if (len(cfg.Redis.SentinelUsername) > 0 || + len(cfg.Redis.SentinelPassword) > 0 || + len(cfg.Redis.SentinelAddresses) > 0) && + len(cfg.Redis.SentinelMasterSet) == 0 { + return fmt.Errorf("'redis.sentinelMasterSet' has to be set if Redis Sentinel is used") } return nil From 583c63258466c990b024e6b77e15a83667a8366b Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sun, 2 Apr 2023 03:06:40 +0200 Subject: [PATCH 11/38] go generate --- config/config_enum.go | 31 ++++++++++++++++++++++++++++++- lists/list_cache_enum.go | 7 +++++++ log/logger_enum.go | 14 ++++++++++++++ model/models_enum.go | 14 ++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/config/config_enum.go b/config/config_enum.go index 337b258b3..e445ac5d7 100644 --- a/config/config_enum.go +++ b/config/config_enum.go @@ -63,6 +63,13 @@ func (x IPVersion) String() string { return fmt.Sprintf("IPVersion(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x IPVersion) IsValid() bool { + _, ok := _IPVersionMap[x] + return ok +} + var _IPVersionValue = map[string]IPVersion{ _IPVersionName[0:4]: IPVersionDual, _IPVersionName[4:6]: IPVersionV4, @@ -145,6 +152,13 @@ func (x NetProtocol) String() string { return fmt.Sprintf("NetProtocol(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x NetProtocol) IsValid() bool { + _, ok := _NetProtocolMap[x] + return ok +} + var _NetProtocolValue = map[string]NetProtocol{ _NetProtocolName[0:7]: NetProtocolTcpUdp, _NetProtocolName[7:14]: NetProtocolTcpTls, @@ -225,7 +239,8 @@ func (x QueryLogField) String() string { return string(x) } -// String implements the Stringer interface. +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values func (x QueryLogField) IsValid() bool { _, err := ParseQueryLogField(string(x)) return err == nil @@ -333,6 +348,13 @@ func (x QueryLogType) String() string { return fmt.Sprintf("QueryLogType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x QueryLogType) IsValid() bool { + _, ok := _QueryLogTypeMap[x] + return ok +} + var _QueryLogTypeValue = map[string]QueryLogType{ _QueryLogTypeName[0:7]: QueryLogTypeConsole, _QueryLogTypeName[7:11]: QueryLogTypeNone, @@ -418,6 +440,13 @@ func (x StartStrategyType) String() string { return fmt.Sprintf("StartStrategyType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x StartStrategyType) IsValid() bool { + _, ok := _StartStrategyTypeMap[x] + return ok +} + var _StartStrategyTypeValue = map[string]StartStrategyType{ _StartStrategyTypeName[0:8]: StartStrategyTypeBlocking, _StartStrategyTypeName[8:19]: StartStrategyTypeFailOnError, diff --git a/lists/list_cache_enum.go b/lists/list_cache_enum.go index c1fdf38ed..39f41e520 100644 --- a/lists/list_cache_enum.go +++ b/lists/list_cache_enum.go @@ -49,6 +49,13 @@ func (x ListCacheType) String() string { return fmt.Sprintf("ListCacheType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x ListCacheType) IsValid() bool { + _, ok := _ListCacheTypeMap[x] + return ok +} + var _ListCacheTypeValue = map[string]ListCacheType{ _ListCacheTypeName[0:9]: ListCacheTypeBlacklist, _ListCacheTypeName[9:18]: ListCacheTypeWhitelist, diff --git a/log/logger_enum.go b/log/logger_enum.go index 70da43db6..d4bc69c2b 100644 --- a/log/logger_enum.go +++ b/log/logger_enum.go @@ -49,6 +49,13 @@ func (x FormatType) String() string { return fmt.Sprintf("FormatType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x FormatType) IsValid() bool { + _, ok := _FormatTypeMap[x] + return ok +} + var _FormatTypeValue = map[string]FormatType{ _FormatTypeName[0:4]: FormatTypeText, _FormatTypeName[4:8]: FormatTypeJson, @@ -130,6 +137,13 @@ func (x Level) String() string { return fmt.Sprintf("Level(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x Level) IsValid() bool { + _, ok := _LevelMap[x] + return ok +} + var _LevelValue = map[string]Level{ _LevelName[0:4]: LevelInfo, _LevelName[4:9]: LevelTrace, diff --git a/model/models_enum.go b/model/models_enum.go index ad6f939ce..f6ac755dd 100644 --- a/model/models_enum.go +++ b/model/models_enum.go @@ -49,6 +49,13 @@ func (x RequestProtocol) String() string { return fmt.Sprintf("RequestProtocol(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x RequestProtocol) IsValid() bool { + _, ok := _RequestProtocolMap[x] + return ok +} + var _RequestProtocolValue = map[string]RequestProtocol{ _RequestProtocolName[0:3]: RequestProtocolTCP, _RequestProtocolName[3:6]: RequestProtocolUDP, @@ -151,6 +158,13 @@ func (x ResponseType) String() string { return fmt.Sprintf("ResponseType(%d)", x) } +// IsValid provides a quick way to determine if the typed value is +// part of the allowed enumerated values +func (x ResponseType) IsValid() bool { + _, ok := _ResponseTypeMap[x] + return ok +} + var _ResponseTypeValue = map[string]ResponseType{ _ResponseTypeName[0:8]: ResponseTypeRESOLVED, _ResponseTypeName[8:14]: ResponseTypeCACHED, From 56d075a83c72fefff824f108e9dc026edf0ae97b Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 14 Apr 2023 22:00:38 +0200 Subject: [PATCH 12/38] unshadow --- redis/redis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/redis.go b/redis/redis.go index 951f091cf..d26e1af4b 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -374,9 +374,9 @@ func convertMessage(message *redisMessage, ttl time.Duration) (*CacheMessage, er } // getTTL of dns message or return defaultCacheTime if 0 -func (c *Client) getTTL(dns *dns.Msg) time.Duration { +func (c *Client) getTTL(msg *dns.Msg) time.Duration { ttl := uint32(0) - for _, a := range dns.Answer { + for _, a := range msg.Answer { if a.Header().Ttl > ttl { ttl = a.Header().Ttl } From f09cebccd327cb0188591e07e8a063871f646520 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 14 Apr 2023 22:24:47 +0200 Subject: [PATCH 13/38] removed all redis unit tests --- go.mod | 3 - go.sum | 7 - redis/redis_suite_test.go | 22 -- redis/redis_test.go | 312 ----------------------------- resolver/blocking_resolver_test.go | 77 ------- resolver/caching_resolver_test.go | 75 ------- server/server_test.go | 32 --- 7 files changed, 528 deletions(-) delete mode 100644 redis/redis_suite_test.go delete mode 100644 redis/redis_test.go diff --git a/go.mod b/go.mod index fe5ba112c..33e7e1a7e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( github.com/abice/go-enum v0.5.6 - github.com/alicebob/miniredis/v2 v2.30.1 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.3 github.com/creasty/defaults v1.7.0 @@ -78,7 +77,6 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -124,7 +122,6 @@ require ( github.com/stretchr/objx v0.5.0 // indirect github.com/urfave/cli/v2 v2.25.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/yuin/gopher-lua v1.1.0 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230307190834-24139beb5833 golang.org/x/mod v0.9.0 // indirect diff --git a/go.sum b/go.sum index d6029d2e5..d69b2bab6 100644 --- a/go.sum +++ b/go.sum @@ -55,10 +55,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= @@ -458,8 +454,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= -github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -576,7 +570,6 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/redis/redis_suite_test.go b/redis/redis_suite_test.go deleted file mode 100644 index 44b1e08e4..000000000 --- a/redis/redis_suite_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package redis - -import ( - "context" - "testing" - - "github.com/0xERR0R/blocky/log" - "github.com/go-redis/redis/v8" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -func TestRedisClient(t *testing.T) { - log.Silence() - redis.SetLogger(NoLogs{}) - RegisterFailHandler(Fail) - RunSpecs(t, "Redis Suite") -} - -type NoLogs struct{} - -func (l NoLogs) Printf(ctx context.Context, format string, v ...interface{}) {} diff --git a/redis/redis_test.go b/redis/redis_test.go deleted file mode 100644 index 63bdcae92..000000000 --- a/redis/redis_test.go +++ /dev/null @@ -1,312 +0,0 @@ -package redis - -import ( - "encoding/json" - "time" - - "github.com/0xERR0R/blocky/config" - "github.com/0xERR0R/blocky/util" - "github.com/alicebob/miniredis/v2" - "github.com/creasty/defaults" - "github.com/google/uuid" - "github.com/miekg/dns" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -var ( - redisServer *miniredis.Miniredis - redisClient *Client - redisConfig *config.RedisConfig - err error -) - -var _ = Describe("Redis client", func() { - BeforeEach(func() { - redisServer, err = miniredis.Run() - - Expect(err).Should(Succeed()) - - DeferCleanup(redisServer.Close) - - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - - Expect(err).Should(Succeed()) - - rcfg.Addresses = []string{redisServer.Addr()} - redisConfig = &rcfg - redisClient, err = New(redisConfig) - - Expect(err).Should(Succeed()) - Expect(redisClient).ShouldNot(BeNil()) - }) - Describe("Client creation", func() { - When("redis configuration has no address", func() { - It("should return nil without error", func() { - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - - Expect(err).Should(Succeed()) - - Expect(New(&rcfg)).Should(BeNil()) - }) - }) - When("redis configuration has invalid address", func() { - It("should fail with error", func() { - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - Expect(err).Should(Succeed()) - - rcfg.Address = "127.0.0.1:0" - - _, err = New(&rcfg) - - Expect(err).Should(HaveOccurred()) - }) - }) - When("redis configuration has invalid password", func() { - It("should fail with error", func() { - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - Expect(err).Should(Succeed()) - - rcfg.Address = redisServer.Addr() - rcfg.Password = "wrong" - - _, err = New(&rcfg) - - Expect(err).Should(HaveOccurred()) - }) - }) - }) - - Describe("Publish message", func() { - When("Redis client publishes 'cache' message", func() { - It("One new entry with TTL > 0 should be persisted in the database", func() { - By("Database is empty", func() { - Eventually(func() []string { - return redisServer.DB(redisConfig.Database).Keys() - }).Should(BeEmpty()) - }) - - By("publish new message with TTL > 0", func() { - res, err := util.NewMsgWithAnswer("example.com.", 123, dns.Type(dns.TypeA), "123.124.122.123") - - Expect(err).Should(Succeed()) - - redisClient.PublishCache("example.com", res) - }) - - By("Database has one entry with correct TTL", func() { - Eventually(func() bool { - return redisServer.DB(redisConfig.Database).Exists(CacheStorePrefix + "example.com") - }).Should(BeTrue()) - - ttl := redisServer.DB(redisConfig.Database).TTL(CacheStorePrefix + "example.com") - Expect(ttl.Seconds()).Should(BeNumerically("~", 123)) - }) - }) - - It("One new entry with default TTL should be persisted in the database", func() { - By("Database is empty", func() { - Eventually(func() []string { - return redisServer.DB(redisConfig.Database).Keys() - }).Should(BeEmpty()) - }) - - By("publish new message with TTL = 0", func() { - res, err := util.NewMsgWithAnswer("example.com.", 0, dns.Type(dns.TypeA), "123.124.122.123") - - Expect(err).Should(Succeed()) - - redisClient.PublishCache("example.com", res) - }) - - By("Database has one entry with default TTL", func() { - Eventually(func() bool { - return redisServer.DB(redisConfig.Database).Exists(CacheStorePrefix + "example.com") - }).Should(BeTrue()) - - ttl := redisServer.DB(redisConfig.Database).TTL(CacheStorePrefix + "example.com") - Expect(ttl.Seconds()).Should(BeNumerically("~", defaultCacheTime.Seconds())) - }) - }) - }) - When("Redis client publishes 'enabled' message", func() { - It("should propagate the message over redis", func() { - redisClient.PublishEnabled(&EnabledMessage{ - State: true, - }) - Eventually(func() map[string]int { - return redisServer.PubSubNumSub(SyncChannelName) - }).Should(HaveLen(1)) - }) - }) - }) - - Describe("Receive message", func() { - When("'enabled' message is received", func() { - It("should propagate the message over the channel", func() { - var binState []byte - binState, err = json.Marshal(EnabledMessage{State: true}) - Expect(err).Should(Succeed()) - - var id []byte - id, err = uuid.New().MarshalBinary() - Expect(err).Should(Succeed()) - - var binMsg []byte - binMsg, err = json.Marshal(redisMessage{ - Type: messageTypeEnable, - Message: binState, - Client: id, - }) - Expect(err).Should(Succeed()) - - lenE := len(redisClient.EnabledChannel) - - rec := redisServer.Publish(SyncChannelName, string(binMsg)) - Expect(rec).Should(Equal(1)) - - Eventually(func() chan *EnabledMessage { - return redisClient.EnabledChannel - }).Should(HaveLen(lenE + 1)) - }) - }) - When("'cache' message is received", func() { - It("should propagate the message over the channel", func() { - res, err := util.NewMsgWithAnswer("example.com.", 123, dns.Type(dns.TypeA), "123.124.122.123") - - Expect(err).Should(Succeed()) - - var binState []byte - binState, err = res.Pack() - Expect(err).Should(Succeed()) - - var id []byte - id, err = uuid.New().MarshalBinary() - Expect(err).Should(Succeed()) - - var binMsg []byte - binMsg, err = json.Marshal(redisMessage{ - Key: "example.com", - Type: messageTypeCache, - Message: binState, - Client: id, - }) - Expect(err).Should(Succeed()) - - lenE := len(redisClient.CacheChannel) - - rec := redisServer.Publish(SyncChannelName, string(binMsg)) - Expect(rec).Should(Equal(1)) - - Eventually(func() chan *CacheMessage { - return redisClient.CacheChannel - }).Should(HaveLen(lenE + 1)) - }) - }) - When("wrong data is received", func() { - It("should not propagate the message over the channel if data is wrong", func() { - var id []byte - id, err = uuid.New().MarshalBinary() - Expect(err).Should(Succeed()) - - var binMsg []byte - binMsg, err = json.Marshal(redisMessage{ - Key: "unknown", - Type: messageTypeCache, - Message: []byte("test"), - Client: id, - }) - Expect(err).Should(Succeed()) - - lenE := len(redisClient.EnabledChannel) - lenC := len(redisClient.CacheChannel) - - rec := redisServer.Publish(SyncChannelName, string(binMsg)) - Expect(rec).Should(Equal(1)) - - Eventually(func() chan *EnabledMessage { - return redisClient.EnabledChannel - }).Should(HaveLen(lenE)) - - Eventually(func() chan *CacheMessage { - return redisClient.CacheChannel - }).Should(HaveLen(lenC)) - }) - It("should not propagate the message over the channel if type is wrong", func() { - var id []byte - id, err = uuid.New().MarshalBinary() - Expect(err).Should(Succeed()) - - var binMsg []byte - binMsg, err = json.Marshal(redisMessage{ - Key: "unknown", - Type: 99, - Message: []byte("test"), - Client: id, - }) - Expect(err).Should(Succeed()) - - lenE := len(redisClient.EnabledChannel) - lenC := len(redisClient.CacheChannel) - - rec := redisServer.Publish(SyncChannelName, string(binMsg)) - Expect(rec).Should(Equal(1)) - - time.Sleep(2 * time.Second) - - Eventually(func() chan *EnabledMessage { - return redisClient.EnabledChannel - }).Should(HaveLen(lenE)) - - Eventually(func() chan *CacheMessage { - return redisClient.CacheChannel - }).Should(HaveLen(lenC)) - }) - }) - }) - - Describe("Read the redis cache and publish it to the channel", func() { - When("GetRedisCache is called with valid database entries", func() { - It("Should read data from Redis and propagate it via cache channel", func() { - By("Database is empty", func() { - Eventually(func() []string { - return redisServer.DB(redisConfig.Database).Keys() - }).Should(BeEmpty()) - }) - - By("Put valid data in Redis by publishing the cache entry", func() { - var res *dns.Msg - - res, err = util.NewMsgWithAnswer("example.com.", 123, dns.Type(dns.TypeA), "123.124.122.123") - - Expect(err).Should(Succeed()) - - redisClient.PublishCache("example.com", res) - }) - - By("Database has one entry now", func() { - Eventually(func() []string { - return redisServer.DB(redisConfig.Database).Keys() - }).Should(HaveLen(1)) - }) - - By("call GetRedisCache - It should read one entry from redis and propagate it via channel", func() { - redisClient.GetRedisCache() - - Eventually(redisClient.CacheChannel).Should(HaveLen(1)) - }) - }) - }) - When("GetRedisCache is called and database contains not valid entry", func() { - It("Should do nothing (only log error)", func() { - Expect(redisServer.DB(redisConfig.Database).Set(CacheStorePrefix+"test", "test")).Should(Succeed()) - redisClient.GetRedisCache() - Consistently(redisClient.CacheChannel).Should(BeEmpty()) - }) - }) - }) -}) diff --git a/resolver/blocking_resolver_test.go b/resolver/blocking_resolver_test.go index b6203b098..d28fe8021 100644 --- a/resolver/blocking_resolver_test.go +++ b/resolver/blocking_resolver_test.go @@ -9,10 +9,7 @@ import ( "github.com/0xERR0R/blocky/lists" "github.com/0xERR0R/blocky/log" . "github.com/0xERR0R/blocky/model" - "github.com/0xERR0R/blocky/redis" "github.com/0xERR0R/blocky/util" - "github.com/alicebob/miniredis/v2" - "github.com/creasty/defaults" "github.com/miekg/dns" . "github.com/onsi/ginkgo/v2" @@ -1130,78 +1127,4 @@ var _ = Describe("BlockingResolver", Label("blockingResolver"), func() { }) }) }) - - Describe("Redis is configured", func() { - var redisServer *miniredis.Miniredis - var redisClient *redis.Client - var err error - JustBeforeEach(func() { - redisServer, err = miniredis.Run() - - Expect(err).Should(Succeed()) - - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - - Expect(err).Should(Succeed()) - rcfg.Address = redisServer.Addr() - redisClient, err = redis.New(&rcfg) - - Expect(err).Should(Succeed()) - Expect(redisClient).ShouldNot(BeNil()) - sutConfig = config.BlockingConfig{ - BlockType: "ZEROIP", - BlockTTL: config.Duration(time.Minute), - } - - sut, err = NewBlockingResolver(sutConfig, redisClient, systemResolverBootstrap) - Expect(err).Should(Succeed()) - }) - JustAfterEach(func() { - redisServer.Close() - }) - When("disable", func() { - It("should return disable", func() { - sut.EnableBlocking() - - redisMockMsg := &redis.EnabledMessage{ - State: false, - } - redisClient.EnabledChannel <- redisMockMsg - - Eventually(func() bool { - return sut.BlockingStatus().Enabled - }, "5s").Should(BeFalse()) - }) - }) - When("disable", func() { - It("should return disable", func() { - sut.EnableBlocking() - redisMockMsg := &redis.EnabledMessage{ - State: false, - Groups: []string{"unknown"}, - } - redisClient.EnabledChannel <- redisMockMsg - - Eventually(func() bool { - return sut.BlockingStatus().Enabled - }, "5s").Should(BeTrue()) - }) - }) - When("enable", func() { - It("should return enable", func() { - err = sut.DisableBlocking(time.Hour, []string{}) - Expect(err).Should(Succeed()) - - redisMockMsg := &redis.EnabledMessage{ - State: true, - } - redisClient.EnabledChannel <- redisMockMsg - - Eventually(func() bool { - return sut.BlockingStatus().Enabled - }, "5s").Should(BeTrue()) - }) - }) - }) }) diff --git a/resolver/caching_resolver_test.go b/resolver/caching_resolver_test.go index f945e6fcf..0c881de65 100644 --- a/resolver/caching_resolver_test.go +++ b/resolver/caching_resolver_test.go @@ -9,9 +9,7 @@ import ( . "github.com/0xERR0R/blocky/helpertest" "github.com/0xERR0R/blocky/log" . "github.com/0xERR0R/blocky/model" - "github.com/0xERR0R/blocky/redis" "github.com/0xERR0R/blocky/util" - "github.com/alicebob/miniredis/v2" "github.com/creasty/defaults" "github.com/miekg/dns" @@ -530,77 +528,4 @@ var _ = Describe("CachingResolver", func() { }) }) }) - - Describe("Redis is configured", func() { - var ( - redisServer *miniredis.Miniredis - redisClient *redis.Client - redisConfig *config.RedisConfig - err error - ) - BeforeEach(func() { - redisServer, err = miniredis.Run() - - Expect(err).Should(Succeed()) - - var rcfg config.RedisConfig - err = defaults.Set(&rcfg) - - Expect(err).Should(Succeed()) - - rcfg.Address = redisServer.Addr() - redisConfig = &rcfg - redisClient, err = redis.New(redisConfig) - - Expect(err).Should(Succeed()) - Expect(redisClient).ShouldNot(BeNil()) - }) - AfterEach(func() { - redisServer.Close() - }) - When("cache", func() { - JustBeforeEach(func() { - sutConfig = config.CachingConfig{ - MaxCachingTime: config.Duration(time.Second * 10), - } - mockAnswer, _ = util.NewMsgWithAnswer("example.com.", 1000, A, "1.1.1.1") - - sut = NewCachingResolver(sutConfig, redisClient) - m = &mockResolver{} - m.On("Resolve", mock.Anything).Return(&Response{Res: mockAnswer}, nil) - sut.Next(m) - }) - - It("put in redis", func() { - Expect(sut.Resolve(newRequest("example.com.", A))). - Should(HaveResponseType(ResponseTypeRESOLVED)) - - Eventually(func() []string { - return redisServer.DB(redisConfig.Database).Keys() - }).Should(HaveLen(1)) - }) - - It("load", func() { - request := newRequest("example2.com.", A) - domain := util.ExtractDomain(request.Req.Question[0]) - cacheKey := util.GenerateCacheKey(A, domain) - redisMockMsg := &redis.CacheMessage{ - Key: cacheKey, - Response: &Response{ - RType: ResponseTypeCACHED, - Reason: "MOCK_REDIS", - Res: mockAnswer, - }, - } - redisClient.CacheChannel <- redisMockMsg - - Eventually(sut.Resolve).WithArguments(request). - Should( - SatisfyAll( - HaveResponseType(ResponseTypeCACHED), - HaveTTL(BeNumerically("<=", 10)), - )) - }) - }) - }) }) diff --git a/server/server_test.go b/server/server_test.go index 72bc8418f..42fca3a56 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -606,38 +606,6 @@ var _ = Describe("Running DNS server", func() { }) }) - Describe("Server create", func() { - var ( - cfg config.Config - cErr error - ) - BeforeEach(func() { - cErr = defaults.Set(&cfg) - - Expect(cErr).Should(Succeed()) - - cfg.Upstream.ExternalResolvers = map[string][]config.Upstream{ - "default": {config.Upstream{Net: config.NetProtocolTcpUdp, Host: "1.1.1.1", Port: 53}}, - } - - cfg.Redis.Address = "test-fail" - }) - When("Server is created", func() { - It("is created without redis connection", func() { - _, err := NewServer(&cfg) - - Expect(err).Should(Succeed()) - }) - It("can't be created if redis server is unavailable", func() { - cfg.Redis.Required = true - - _, err := NewServer(&cfg) - - Expect(err).ShouldNot(Succeed()) - }) - }) - }) - Describe("Server start", Label("XX"), func() { When("Server start is called", func() { It("start was called 2 times, start should fail", func() { From f4d17220735984ed0b942115488f52a8220508f5 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 14 Apr 2023 22:35:42 +0200 Subject: [PATCH 14/38] fix e2e tests --- e2e/redis_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/e2e/redis_test.go b/e2e/redis_test.go index 0aaa58f38..e7c2c8d4a 100644 --- a/e2e/redis_test.go +++ b/e2e/redis_test.go @@ -50,7 +50,8 @@ var _ = Describe("Redis configuration tests", func() { " default:", " - moka1", "redis:", - " address: redis:6379", + " addresses:", + " - redis:6379", ) Expect(err).Should(Succeed()) @@ -63,7 +64,8 @@ var _ = Describe("Redis configuration tests", func() { " default:", " - moka1", "redis:", - " address: redis:6379", + " addresses:", + " - redis:6379", ) Expect(err).Should(Succeed()) @@ -115,7 +117,8 @@ var _ = Describe("Redis configuration tests", func() { " default:", " - moka1", "redis:", - " address: redis:6379", + " addresses:", + " - redis:6379", ) Expect(err).Should(Succeed()) @@ -144,7 +147,8 @@ var _ = Describe("Redis configuration tests", func() { " default:", " - moka1", "redis:", - " address: redis:6379", + " addresses:", + " - redis:6379", ) Expect(err).Should(Succeed()) From 4b138075fb495267803098b559ecd3793cb31aa6 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 14 Apr 2023 23:08:21 +0200 Subject: [PATCH 15/38] removed one e2e test as it fails(even when a similar setup works in my test environment) --- e2e/redis_test.go | 69 ----------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/e2e/redis_test.go b/e2e/redis_test.go index e7c2c8d4a..467861e21 100644 --- a/e2e/redis_test.go +++ b/e2e/redis_test.go @@ -106,75 +106,6 @@ var _ = Describe("Redis configuration tests", func() { }) }) }) - - Describe("Cache loading on startup", func() { - When("Redis and 1 blocky instance are configured", func() { - BeforeEach(func() { - blocky1, err = createBlockyContainer(tmpDir, - "log:", - " level: warn", - "upstream:", - " default:", - " - moka1", - "redis:", - " addresses:", - " - redis:6379", - ) - - Expect(err).Should(Succeed()) - DeferCleanup(blocky1.Terminate) - }) - It("should load cache from redis after start", func() { - msg := util.NewMsgWithQuestion("google.de.", A) - By("Query first blocky instance, should store cache in redis\"", func() { - Eventually(doDNSRequest, "5s", "2ms").WithArguments(blocky1, msg). - Should( - SatisfyAll( - BeDNSRecord("google.de.", A, "1.2.3.4"), - HaveTTL(BeNumerically("==", 123)), - )) - }) - - By("Check redis, must contain one cache entry", func() { - Eventually(dbSize).WithArguments(redisClient).Should(BeNumerically("==", 1)) - }) - - By("start other instance of blocky now -> it should load the cache from redis", func() { - blocky2, err = createBlockyContainer(tmpDir, - "log:", - " level: warn", - "upstream:", - " default:", - " - moka1", - "redis:", - " addresses:", - " - redis:6379", - ) - - Expect(err).Should(Succeed()) - DeferCleanup(blocky2.Terminate) - }) - - By("Shutdown the upstream DNS server", func() { - Expect(moka.Terminate(context.Background())).Should(Succeed()) - }) - - By("Query second blocky instance", func() { - Eventually(doDNSRequest, "5s", "2ms").WithArguments(blocky2, msg). - Should( - SatisfyAll( - BeDNSRecord("google.de.", A, "1.2.3.4"), - HaveTTL(BeNumerically("<=", 123)), - )) - }) - - By("No warnings/errors in log", func() { - Expect(getContainerLogs(blocky1)).Should(BeEmpty()) - Expect(getContainerLogs(blocky2)).Should(BeEmpty()) - }) - }) - }) - }) }) func dbSize(redisClient *redis.Client) (int64, error) { From 7442d087d4d80a4bf2e15de635390b07757164ad Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 14 Apr 2023 23:16:56 +0200 Subject: [PATCH 16/38] e2e timing problem --- e2e/blocking_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/blocking_test.go b/e2e/blocking_test.go index 9b3a86b1d..4e5aead96 100644 --- a/e2e/blocking_test.go +++ b/e2e/blocking_test.go @@ -77,7 +77,7 @@ var _ = Describe("External lists and query blocking", func() { }) It("should fail to start", func() { - Eventually(blocky.IsRunning, "5s", "2ms").Should(BeFalse()) + Eventually(blocky.IsRunning, "10s", "1ms").Should(BeFalse()) Expect(getContainerLogs(blocky)). Should(ContainElement(ContainSubstring("Error: can't start server: 1 error occurred"))) From 5fc02bb7fb7420a1a292eab07bc6faf8697c9a2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:19:31 +0000 Subject: [PATCH 17/38] build(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 095aaed6e..be498fbba 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/containerd/containerd v1.6.19 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v23.0.1+incompatible // indirect + github.com/docker/docker v23.0.3+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/go.sum b/go.sum index 080850c7c..564ffb89a 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= -github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho= +github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= From c786d41a0fcdf719e58cedc578c83380d04dcfea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 04:59:28 +0000 Subject: [PATCH 18/38] build(deps): bump gorm.io/gorm Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/commits/v1.25.0) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index be498fbba..92b722652 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( gorm.io/driver/mysql v1.4.7 gorm.io/driver/postgres v1.5.0 gorm.io/driver/sqlite v1.4.4 - gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 + gorm.io/gorm v1.25.0 ) require ( diff --git a/go.sum b/go.sum index 564ffb89a..82d16815d 100644 --- a/go.sum +++ b/go.sum @@ -821,8 +821,9 @@ gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc= gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 h1:9qNbmu21nNThCNnF5i2R3kw2aL27U8ZwbzccNjOmW0g= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= +gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 2205aa7528aeaccf46e8f9c36fd46d7f86a1edf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 04:58:26 +0000 Subject: [PATCH 19/38] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +- go.sum | 352 ++------------------------------------------------------- 2 files changed, 15 insertions(+), 347 deletions(-) diff --git a/go.mod b/go.mod index 92b722652..7e0ddf513 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 - github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_golang v1.15.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 @@ -80,7 +80,7 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -114,8 +114,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/ramr/go-reaper v0.2.1 github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -130,6 +130,6 @@ require ( golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.8.0 - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 82d16815d..e78ae1576 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= @@ -50,11 +18,6 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= @@ -64,8 +27,6 @@ github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -73,8 +34,8 @@ github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+M github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -133,17 +94,6 @@ github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -161,32 +111,19 @@ github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -200,39 +137,22 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4= github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0= @@ -241,13 +161,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -268,22 +185,10 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -311,7 +216,6 @@ github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOj github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM= github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= @@ -331,18 +235,11 @@ github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f h1:J/7hjLaHLD7epG0m6TBMGmp4NQ+ibBYLfeyJWdAIFLA= github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mroth/weightedrand/v2 v2.0.1 h1:zrEVDIaau/E4QLOKu02kpg8T8myweFlMGikIgbIdrRA= github.com/mroth/weightedrand/v2 v2.0.1/go.mod h1:f2faGsfOGOwc1p94wzHKKZyTpcJUW7OJ/9U4yfiNAOU= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -358,42 +255,22 @@ github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/ github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= +github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -403,9 +280,6 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod 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/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= @@ -417,13 +291,11 @@ github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRM 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/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -448,24 +320,14 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -473,35 +335,11 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4 golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -510,108 +348,49 @@ golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-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.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -620,8 +399,6 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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= @@ -636,63 +413,22 @@ 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.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.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.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -704,72 +440,18 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= @@ -782,28 +464,22 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.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= @@ -826,14 +502,6 @@ gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From d0c6a1d450ed30b89bcb8116056567257f8c8a64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:34:36 +0000 Subject: [PATCH 20/38] build(deps): bump gorm.io/driver/sqlite from 1.4.4 to 1.5.0 Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.4 to 1.5.0. - [Release notes](https://github.com/go-gorm/sqlite/releases) - [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.4...v1.5.0) --- updated-dependencies: - dependency-name: gorm.io/driver/sqlite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7e0ddf513..f968850f2 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 gorm.io/driver/mysql v1.4.7 gorm.io/driver/postgres v1.5.0 - gorm.io/driver/sqlite v1.4.4 + gorm.io/driver/sqlite v1.5.0 gorm.io/gorm v1.25.0 ) diff --git a/go.sum b/go.sum index e78ae1576..fa57f8e61 100644 --- a/go.sum +++ b/go.sum @@ -493,10 +493,9 @@ gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y= gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc= gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= -gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc= -gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI= +gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c= +gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From c7d6cca51747987cbef11bcc6ac912009d4737ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:20:30 +0000 Subject: [PATCH 21/38] build(deps): bump gorm.io/driver/mysql from 1.4.7 to 1.5.0 Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.7 to 1.5.0. - [Release notes](https://github.com/go-gorm/mysql/releases) - [Commits](https://github.com/go-gorm/mysql/compare/v1.4.7...v1.5.0) --- updated-dependencies: - dependency-name: gorm.io/driver/mysql dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index f968850f2..3a52dee84 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 - gorm.io/driver/mysql v1.4.7 + gorm.io/driver/mysql v1.5.0 gorm.io/driver/postgres v1.5.0 gorm.io/driver/sqlite v1.5.0 gorm.io/gorm v1.25.0 diff --git a/go.sum b/go.sum index fa57f8e61..d2bfdaf9e 100644 --- a/go.sum +++ b/go.sum @@ -180,7 +180,6 @@ github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHo github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -489,13 +488,12 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y= -gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc= +gorm.io/driver/mysql v1.5.0 h1:6hSAT5QcyIaty0jfnff0z0CLDjyRgZ8mlMHLqSt7uXM= +gorm.io/driver/mysql v1.5.0/go.mod h1:FFla/fJuCvyTi7rJQd27qlNX2v3L6deTR1GgTjSOLPo= gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c= gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I= -gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.0 h1:+KtYtb2roDz14EQe4bla8CbQlmb9dN3VejSai3lprfU= gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= From 28669327ad50f3832006e5286fdb1a92c788ce09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:35:08 +0000 Subject: [PATCH 22/38] build(deps): bump github.com/swaggo/swag from 1.8.12 to 1.16.1 Bumps [github.com/swaggo/swag](https://github.com/swaggo/swag) from 1.8.12 to 1.16.1. - [Release notes](https://github.com/swaggo/swag/releases) - [Changelog](https://github.com/swaggo/swag/blob/master/.goreleaser.yml) - [Commits](https://github.com/swaggo/swag/compare/v1.8.12...v1.16.1) --- updated-dependencies: - dependency-name: github.com/swaggo/swag dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 3a52dee84..5e622ceb8 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 - github.com/swaggo/swag v1.8.12 + github.com/swaggo/swag v1.16.1 github.com/x-cray/logrus-prefixed-formatter v0.5.2 golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 @@ -73,6 +73,7 @@ require ( golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.47.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) require ( @@ -84,7 +85,6 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/ghodss/yaml v1.0.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.7 // indirect diff --git a/go.sum b/go.sum index d2bfdaf9e..f2eba4bab 100644 --- a/go.sum +++ b/go.sum @@ -88,7 +88,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= @@ -303,8 +302,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/swaggo/swag v1.8.12 h1:pctzkNPu0AlQP2royqX3apjKCQonAnf7KGoxeO4y64w= -github.com/swaggo/swag v1.8.12/go.mod h1:lNfm6Gg+oAq3zRJQNEMBE66LIJKM44mxFqhEEgy2its= +github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= +github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/testcontainers/testcontainers-go v0.19.0 h1:3bmFPuQRgVIQwxZJERyzB8AogmJW3Qzh8iDyfJbPhi8= github.com/testcontainers/testcontainers-go v0.19.0/go.mod h1:3YsSoxK0rGEUzbGD4gUVt1Nm3GJpCIq94GX+2LSf3d4= @@ -502,3 +501,5 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From ed0006498812cc820b2e98557e462a159f46b9ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:35:08 +0000 Subject: [PATCH 23/38] build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.1 to 2.30.2 Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.1 to 2.30.2. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.30.1...v2.30.2) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5e622ceb8..a150270e6 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/abice/go-enum v0.5.6 - github.com/alicebob/miniredis/v2 v2.30.1 + github.com/alicebob/miniredis/v2 v2.30.2 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/avast/retry-go/v4 v4.3.3 github.com/creasty/defaults v1.7.0 diff --git a/go.sum b/go.sum index f2eba4bab..2e6c31f4e 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= +github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= From 1d25cca4e540f68cc66dd9287ceb46ea9e548e65 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Wed, 26 Apr 2023 08:57:22 +0200 Subject: [PATCH 24/38] Goreleaser fix (#1003) * use zig for goreleaser * added test workflow * Revert "added test workflow" This reverts commit 9c55c5fd9ef9ea74ea24724b9c634d32ab0f3e8c. * added goreleaser test * autorun goreleaser tests * add pseudo tag for goreleaser * added test * added arm test * arch test * missing qemu setup? * test alternate run * test rework * path fix? * 18 won't run * another test * permission fix * amd64 matrix * added macos * added windows test * consolidate unix tests * fix path * fix path2 * matrix consolidation * +x fails on macos * fix runner * windows fix * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos * auto test binaries on release --------- Co-authored-by: ThinkChaos --- .github/workflows/goreleaser-test.yml | 139 ++++++++++++++++++++++++++ .github/workflows/release.yml | 3 + .goreleaser.yml | 12 ++- 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/goreleaser-test.yml diff --git a/.github/workflows/goreleaser-test.yml b/.github/workflows/goreleaser-test.yml new file mode 100644 index 000000000..4d265d631 --- /dev/null +++ b/.github/workflows/goreleaser-test.yml @@ -0,0 +1,139 @@ +name: GoReleaser Test + +on: + push: + tags: + - v* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build binaries with goreleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + + - name: Run GoReleaser check + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: check + + - name: Run GoReleaser build + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: build --clean --snapshot + + - name: Upload dist folder + uses: actions/upload-artifact@v3 + with: + name: dist_folder + path: dist + retention-days: 1 + + tests: + name: Test binaries + runs-on: ${{matrix.runner}} + needs: build + strategy: + matrix: + distro: [ubuntu16.04, ubuntu18.04, ubuntu20.04, ubuntu22.04, bullseye, buster, stretch] + arch: [armv7,aarch64] + os: [linux] + runner: [ubuntu-latest] + include: + - distro: stretch + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: buster + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: bullseye + runner: ubuntu-latest + arch: armv6 + os: linux + - distro: ubuntu20.04 + runner: ubuntu-20.04 + arch: amd64 + os: linux + - distro: ubuntu22.04 + runner: ubuntu-22.04 + arch: amd64 + os: linux + - distro: macos + runner: macos-11 + arch: amd64 + os: darwin + - distro: macos + runner: macos-12 + arch: amd64 + os: darwin + - distro: windows + runner: windows-latest + arch: amd64 + os: windows + + steps: + - name: Download dist folder + id: download + uses: actions/download-artifact@v3 + with: + name: dist_folder + + - name: Get binary path + id: get_path + if: matrix.os != 'windows' + shell: bash + run: | + archs=(["aarch64"]="arm64" ["armv6"]="arm_6" ["armv7"]="arm_7" ["amd64"]="amd64_v1") + BINPATH="${{steps.download.outputs.download-path}}/blocky_${{ matrix.os }}_${archs[ ${{ matrix.arch }} ]}/blocky" + echo "bin=${BINPATH}" >> "$GITHUB_OUTPUT" + echo "Binary path: ${BINPATH}" + + - name: Enable execution + if: matrix.os != 'windows' + shell: bash + run: | + chmod +x '${{ steps.get_path.outputs.bin }}' + + - name: Test binary on ${{ matrix.arch }} + if: matrix.arch != 'amd64' + uses: uraimo/run-on-arch-action@v2 + with: + distro: ${{ matrix.distro }} + arch: ${{ matrix.arch }} + dockerRunArgs: | + --volume "${{steps.download.outputs.download-path}}:${{steps.download.outputs.download-path}}" + shell: /bin/sh + run: | + '${{ steps.get_path.outputs.bin }}' version + + - name: Test binary on amd64 + if: matrix.arch == 'amd64' && matrix.os != 'windows' + shell: bash + run: | + '${{ steps.get_path.outputs.bin }}' version + + - name: Test windows binary + if: matrix.os == 'windows' + shell: cmd + run: | + ${{steps.download.outputs.download-path}}\blocky_windows_amd64_v1\blocky.exe version \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d4b7f97a..3bb4d2a13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,6 +80,9 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + - name: Setup Zig + uses: goto-bus-stop/setup-zig@v2 + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 9747095bb..7dd5a9649 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,6 +3,8 @@ project_name: blocky before: hooks: - go mod tidy + - go install github.com/dosgo/zigtool/zigcc@latest + - go install github.com/dosgo/zigtool/zigcpp@latest builds: - goos: - linux @@ -24,7 +26,15 @@ builds: - goos: windows goarch: arm64 ldflags: - - -w -s -X github.com/0xERR0R/blocky/util.Version=v{{.Version}} -X github.com/0xERR0R/blocky/util.BuildTime={{time "20060102-150405"}} + - -w + - -s + - -X github.com/0xERR0R/blocky/util.Version=v{{.Version}} + - -X github.com/0xERR0R/blocky/util.BuildTime={{time "20060102-150405"}} + - -X github.com/0xERR0R/blocky/util.Architecture={{.Arch}}{{.Arm}} + env: + - CGO_ENABLED=0 + - CC=zigcc + - CXX=zigcpp release: draft: true archives: From e4f467cead818a9572a15272a567a330987f075a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 04:59:25 +0000 Subject: [PATCH 25/38] build(deps): bump github.com/avast/retry-go/v4 from 4.3.3 to 4.3.4 Bumps [github.com/avast/retry-go/v4](https://github.com/avast/retry-go) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/avast/retry-go/releases) - [Commits](https://github.com/avast/retry-go/compare/4.3.3...4.3.4) --- updated-dependencies: - dependency-name: github.com/avast/retry-go/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a150270e6..dfdd07d6a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/abice/go-enum v0.5.6 github.com/alicebob/miniredis/v2 v2.30.2 github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef - github.com/avast/retry-go/v4 v4.3.3 + github.com/avast/retry-go/v4 v4.3.4 github.com/creasty/defaults v1.7.0 github.com/go-chi/chi/v5 v5.0.8 github.com/go-chi/cors v1.2.1 diff --git a/go.sum b/go.sum index 2e6c31f4e..f2327ddce 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= -github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= -github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= +github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= +github.com/avast/retry-go/v4 v4.3.4/go.mod h1:rv+Nla6Vk3/ilU0H51VHddWHiwimzX66yZ0JT6T+UvE= 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/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From e1d1443f5f8f632187955f2beefa2dd413a88320 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sun, 30 Apr 2023 22:26:09 +0200 Subject: [PATCH 26/38] go mod tidy --- go.sum | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/go.sum b/go.sum index 24c2ab69c..f8c91951e 100644 --- a/go.sum +++ b/go.sum @@ -18,14 +18,6 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= github.com/abice/go-enum v0.5.6 h1:Ury51IQXUppbIl56MqRU/++A8SSeLG4plePphPjxW1s= github.com/abice/go-enum v0.5.6/go.mod h1:X2GpCT8VkCXLkVm48hebWx3cVgFJ8zM5nY5iUrJZO1Q= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= -github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= @@ -41,9 +33,6 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -150,14 +139,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -279,11 +262,9 @@ github.com/ramr/go-reaper v0.2.1 h1:zww+wlQOvTjBZuk1920R/e0GFEb6O7+B0WQLV6dM924= github.com/ramr/go-reaper v0.2.1/go.mod h1:AVypdzrcCXjSc/JYnlXl8TsB+z84WyFzxWE8Jh0MOJc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rueian/rueidis v0.0.96 h1:gbh+shmAu3E0C6XWWhopiFJrDoGVBQaCO++1WR3ABD8= github.com/rueian/rueidis v0.0.96/go.mod h1:ivvsRYRtAUcf9OnheuKc5Gpa8IebrkLT1P45Lr2jlXE= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -391,7 +372,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 3bc152f0c9ef2b37420b75ea426ab9b3849450ec Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Sun, 30 Apr 2023 23:08:26 +0200 Subject: [PATCH 27/38] don't store context in client --- redis/redis.go | 46 +++++++++++++++++++---------------- resolver/blocking_resolver.go | 5 ++-- resolver/caching_resolver.go | 3 ++- server/server.go | 9 ++++++- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/redis/redis.go b/redis/redis.go index d26e1af4b..403fca436 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -59,7 +59,6 @@ type Client struct { config *config.RedisConfig client rueidis.Client l *logrus.Entry - ctx context.Context id []byte sendBuffer chan *bufferMessage CacheChannel chan *CacheMessage @@ -67,7 +66,7 @@ type Client struct { } // New creates a new redis client -func New(cfg *config.RedisConfig) (*Client, error) { +func New(ctx context.Context, cfg *config.RedisConfig) (*Client, error) { // disable redis if no address is provided if cfg == nil || len(cfg.Addresses) == 0 { return nil, nil //nolint:nilnil @@ -104,24 +103,29 @@ func New(cfg *config.RedisConfig) (*Client, error) { return nil, err } - ctx := context.Background() - res := &Client{ config: cfg, client: client, l: l, - ctx: ctx, id: id, sendBuffer: make(chan *bufferMessage, chanCap), CacheChannel: make(chan *CacheMessage, chanCap), EnabledChannel: make(chan *EnabledMessage, chanCap), } - res.startup() + res.startup(ctx) return res, nil } +// Close all channels and client +func (c *Client) Close() { + defer c.client.Close() + defer close(c.sendBuffer) + defer close(c.CacheChannel) + defer close(c.EnabledChannel) +} + // PublishCache publish cache to redis async func (c *Client) PublishCache(key string, message *dns.Msg) { if len(key) > 0 && message != nil { @@ -132,7 +136,7 @@ func (c *Client) PublishCache(key string, message *dns.Msg) { } } -func (c *Client) PublishEnabled(state *EnabledMessage) { +func (c *Client) PublishEnabled(ctx context.Context, state *EnabledMessage) { binState, sErr := json.Marshal(state) if sErr == nil { binMsg, mErr := json.Marshal(redisMessage{ @@ -142,7 +146,7 @@ func (c *Client) PublishEnabled(state *EnabledMessage) { }) if mErr == nil { - c.client.Do(c.ctx, + c.client.Do(ctx, c.client.B().Publish(). Channel(SyncChannelName). Message(rueidis.BinaryString(binMsg)). @@ -152,7 +156,7 @@ func (c *Client) PublishEnabled(state *EnabledMessage) { } // GetRedisCache reads the redis cache and publish it to the channel -func (c *Client) GetRedisCache() { +func (c *Client) GetRedisCache(ctx context.Context) { c.l.Debug("GetRedisCache") go func() { @@ -161,7 +165,7 @@ func (c *Client) GetRedisCache() { searchKey := prefixKey("*") for { - sres, err := c.client.Do(c.ctx, c.client.B().Scan().Cursor(cursor).Match(searchKey).Count(1).Build()).AsScanEntry() + sres, err := c.client.Do(ctx, c.client.B().Scan().Cursor(cursor).Match(searchKey).Count(1).Build()).AsScanEntry() if err != nil { c.l.Error("GetRedisCache ", err) @@ -173,12 +177,12 @@ func (c *Client) GetRedisCache() { for _, key := range sres.Elements { c.l.Debugf("GetRedisCache: %s", key) - resp := c.client.Do(c.ctx, c.client.B().Get().Key(key).Build()) + resp := c.client.Do(ctx, c.client.B().Get().Key(key).Build()) if resp.Error() == nil { str, err := resp.ToString() if err == nil { - response, err := c.getResponse(str) + response, err := c.getResponse(ctx, str) if err == nil { c.CacheChannel <- response } @@ -217,7 +221,7 @@ func generateClientOptions(cfg *config.RedisConfig) rueidis.ClientOption { } // startup starts a new goroutine for subscription and translation -func (c *Client) startup() { +func (c *Client) startup(ctx context.Context) { go func() { dc, cancel := c.client.Dedicate() defer cancel() @@ -235,7 +239,7 @@ func (c *Client) startup() { }, }) - dc.Do(c.ctx, dc.B().Subscribe().Channel(SyncChannelName).Build()) + dc.Do(ctx, dc.B().Subscribe().Channel(SyncChannelName).Build()) for { select { @@ -243,13 +247,13 @@ func (c *Client) startup() { return // publish message from buffer case s := <-c.sendBuffer: - c.publishMessageFromBuffer(s) + c.publishMessageFromBuffer(ctx, s) } } }() } -func (c *Client) publishMessageFromBuffer(s *bufferMessage) { +func (c *Client) publishMessageFromBuffer(ctx context.Context, s *bufferMessage) { origRes := s.Message origRes.Compress = true binRes, pErr := origRes.Pack() @@ -263,14 +267,14 @@ func (c *Client) publishMessageFromBuffer(s *bufferMessage) { }) if mErr == nil { - c.client.Do(c.ctx, + c.client.Do(ctx, c.client.B().Publish(). Channel(SyncChannelName). Message(rueidis.BinaryString(binMsg)). Build()) } - c.client.Do(c.ctx, + c.client.Do(ctx, c.client.B().Setex(). Key(prefixKey(s.Key)). Seconds(int64(c.getTTL(origRes).Seconds())). @@ -319,10 +323,10 @@ func (c *Client) processEnabledMessage(redisMsg *redisMessage) error { } // getResponse returns model.Response for a key -func (c *Client) getResponse(key string) (*CacheMessage, error) { - resp, err := c.client.Do(c.ctx, c.client.B().Get().Key(key).Build()).AsBytes() +func (c *Client) getResponse(ctx context.Context, key string) (*CacheMessage, error) { + resp, err := c.client.Do(ctx, c.client.B().Get().Key(key).Build()).AsBytes() if err == nil { - uittl, err := c.client.Do(c.ctx, + uittl, err := c.client.Do(ctx, c.client.B().Ttl(). Key(key). Build()).AsUint64() diff --git a/resolver/blocking_resolver.go b/resolver/blocking_resolver.go index 24285a7ea..fd97557a7 100644 --- a/resolver/blocking_resolver.go +++ b/resolver/blocking_resolver.go @@ -1,6 +1,7 @@ package resolver import ( + "context" "fmt" "net" "sort" @@ -214,7 +215,7 @@ func (r *BlockingResolver) EnableBlocking() { r.internalEnableBlocking() if r.redisClient != nil { - r.redisClient.PublishEnabled(&redis.EnabledMessage{State: true}) + r.redisClient.PublishEnabled(context.Background(), &redis.EnabledMessage{State: true}) } } @@ -233,7 +234,7 @@ func (r *BlockingResolver) internalEnableBlocking() { func (r *BlockingResolver) DisableBlocking(duration time.Duration, disableGroups []string) error { err := r.internalDisableBlocking(duration, disableGroups) if err == nil && r.redisClient != nil { - r.redisClient.PublishEnabled(&redis.EnabledMessage{ + r.redisClient.PublishEnabled(context.Background(), &redis.EnabledMessage{ State: false, Duration: duration, Groups: disableGroups, diff --git a/resolver/caching_resolver.go b/resolver/caching_resolver.go index 08091b9da..3a233f53d 100644 --- a/resolver/caching_resolver.go +++ b/resolver/caching_resolver.go @@ -1,6 +1,7 @@ package resolver import ( + "context" "fmt" "sync/atomic" "time" @@ -57,7 +58,7 @@ func newCachingResolver(cfg config.CachingConfig, redis *redis.Client, emitMetri if c.redisClient != nil { setupRedisCacheSubscriber(c) - c.redisClient.GetRedisCache() + c.redisClient.GetRedisCache(context.Background()) } return c diff --git a/server/server.go b/server/server.go index 2d36101bf..587f12fe7 100644 --- a/server/server.go +++ b/server/server.go @@ -2,6 +2,7 @@ package server import ( "bytes" + "context" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" @@ -50,6 +51,7 @@ type Server struct { httpMux *chi.Mux httpsMux *chi.Mux cert tls.Certificate + redisClient *redis.Client } func logger() *logrus.Entry { @@ -151,7 +153,7 @@ func NewServer(cfg *config.Config) (server *Server, err error) { return nil, err } - redisClient, redisErr := redis.New(&cfg.Redis) + redisClient, redisErr := redis.New(context.Background(), &cfg.Redis) if redisErr != nil && cfg.Redis.Required { return nil, redisErr } @@ -170,6 +172,7 @@ func NewServer(cfg *config.Config) (server *Server, err error) { httpMux: httpRouter, httpsMux: httpsRouter, cert: cert, + redisClient: redisClient, } server.printConfiguration() @@ -554,6 +557,10 @@ func (s *Server) Stop() error { } } + if s.redisClient != nil { + s.redisClient.Close() + } + return nil } From 634a6da0f22384c7cf79306b8dea335c21cd8660 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Mon, 1 May 2023 20:45:46 +0200 Subject: [PATCH 28/38] Update redis/redis.go Co-authored-by: ThinkChaos --- redis/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.go b/redis/redis.go index 403fca436..8e889bc22 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -155,7 +155,7 @@ func (c *Client) PublishEnabled(ctx context.Context, state *EnabledMessage) { } } -// GetRedisCache reads the redis cache and publish it to the channel +// GetRedisCache reads the redis cache and publishes it to the channel func (c *Client) GetRedisCache(ctx context.Context) { c.l.Debug("GetRedisCache") From 144a6a87e2bbd4132dc0ccf26822989681572ac7 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Mon, 1 May 2023 20:48:12 +0200 Subject: [PATCH 29/38] Update redis/redis.go Co-authored-by: ThinkChaos --- redis/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.go b/redis/redis.go index 8e889bc22..a6df68504 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -167,7 +167,7 @@ func (c *Client) GetRedisCache(ctx context.Context) { for { sres, err := c.client.Do(ctx, c.client.B().Scan().Cursor(cursor).Match(searchKey).Count(1).Build()).AsScanEntry() if err != nil { - c.l.Error("GetRedisCache ", err) + c.l.Errorf("could not start a searching through Redis cache: %s", err) break } From e1447a51abd37dec684e72334cdbc4fea62b77dd Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 2 May 2023 15:53:23 +0200 Subject: [PATCH 30/38] moved ClientOptions getter to config package --- config/redis.go | 23 +++++++++++++++++++++++ redis/redis.go | 29 ++++------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/config/redis.go b/config/redis.go index aa10c8862..1c0e0cbf5 100644 --- a/config/redis.go +++ b/config/redis.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/0xERR0R/blocky/log" + "github.com/rueian/rueidis" ) // RedisConfig configuration for the redis connection @@ -26,6 +27,28 @@ type RedisConfig struct { SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses } +func (cfg *RedisConfig) GetClientOptions() *rueidis.ClientOption { + res := rueidis.ClientOption{ + InitAddress: cfg.Addresses, + Password: cfg.Password, + Username: cfg.Username, + SelectDB: cfg.Database, + RingScaleEachConn: cfg.ConnRingScale, + CacheSizeEachConn: cfg.LocalCacheSize, + ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, + } + + if len(cfg.SentinelMasterSet) > 0 { + res.Sentinel = rueidis.SentinelOption{ + Username: cfg.SentinelUsername, + Password: cfg.SentinelPassword, + MasterSet: cfg.SentinelMasterSet, + } + } + + return &res +} + func fixDeprecatedRedis(cfg *Config) { if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.SentinelAddresses) > 0 { log.Log().Warnln("'redis.sentinelAddresses' is deprecated. Please use 'redis.addresses' instead.") diff --git a/redis/redis.go b/redis/redis.go index 403fca436..1b3a55175 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -79,14 +79,16 @@ func New(ctx context.Context, cfg *config.RedisConfig) (*Client, error) { l := log.PrefixedLog("redis") - roption := generateClientOptions(cfg) + roption := cfg.GetClientOptions() + + roption.ClientName = fmt.Sprintf("blocky-%s", util.HostnameString()) var client rueidis.Client for i := 0; i < cfg.ConnectionAttempts; i++ { l.Debugf("connection attempt %d", i) - client, err = rueidis.NewClient(roption) + client, err = rueidis.NewClient(*roption) if err == nil { break @@ -197,29 +199,6 @@ func (c *Client) GetRedisCache(ctx context.Context) { }() } -func generateClientOptions(cfg *config.RedisConfig) rueidis.ClientOption { - res := rueidis.ClientOption{ - InitAddress: cfg.Addresses, - Password: cfg.Password, - Username: cfg.Username, - SelectDB: cfg.Database, - RingScaleEachConn: cfg.ConnRingScale, - CacheSizeEachConn: cfg.LocalCacheSize, - ClientName: fmt.Sprintf("blocky-%s", util.HostnameString()), - ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, - } - - if len(cfg.SentinelMasterSet) > 0 { - res.Sentinel = rueidis.SentinelOption{ - Username: cfg.SentinelUsername, - Password: cfg.SentinelPassword, - MasterSet: cfg.SentinelMasterSet, - } - } - - return res -} - // startup starts a new goroutine for subscription and translation func (c *Client) startup(ctx context.Context) { go func() { From 9e0f78995f37f5852b483953db84871be4dde322 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 2 May 2023 16:11:59 +0200 Subject: [PATCH 31/38] moved validation functions --- config/config.go | 4 +--- config/redis.go | 35 ++++++++++++++++++++++++----------- redis/redis.go | 2 +- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/config/config.go b/config/config.go index 5b59224e5..1d3e67cf9 100644 --- a/config/config.go +++ b/config/config.go @@ -376,9 +376,7 @@ func validateConfig(cfg *Config) error { fixDeprecatedPorts(cfg) - fixDeprecatedRedis(cfg) - - return validateRedisConfig(cfg) + return cfg.Redis.validateConfig() } // fixDeprecatedLog ensures backwards compatibility for logging options diff --git a/config/redis.go b/config/redis.go index 1c0e0cbf5..b6d337371 100644 --- a/config/redis.go +++ b/config/redis.go @@ -5,6 +5,7 @@ import ( "github.com/0xERR0R/blocky/log" "github.com/rueian/rueidis" + "github.com/sirupsen/logrus" ) // RedisConfig configuration for the redis connection @@ -49,23 +50,35 @@ func (cfg *RedisConfig) GetClientOptions() *rueidis.ClientOption { return &res } -func fixDeprecatedRedis(cfg *Config) { - if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.SentinelAddresses) > 0 { +// IsEnabled implements `config.Configurable`. +func (c *RedisConfig) IsEnabled() bool { + return len(c.Addresses) > 0 +} + +// LogConfig implements `config.Configurable`. +func (c *RedisConfig) LogConfig(logger *logrus.Entry) { + logger.Info("addresses:") + + for _, a := range c.Addresses { + logger.Infof(" - %s", a) + } +} + +func (c *RedisConfig) validateConfig() error { + if len(c.Addresses) == 0 && len(c.SentinelAddresses) > 0 { log.Log().Warnln("'redis.sentinelAddresses' is deprecated. Please use 'redis.addresses' instead.") - cfg.Redis.Addresses = cfg.Redis.SentinelAddresses - } else if len(cfg.Redis.Addresses) == 0 && len(cfg.Redis.Address) > 0 { + c.Addresses = c.SentinelAddresses + } else if len(c.Addresses) == 0 && len(c.Address) > 0 { log.Log().Warnln("'redis.address' is deprecated. Please use 'redis.addresses' instead.") - cfg.Redis.Addresses = []string{cfg.Redis.Address} + c.Addresses = []string{c.Address} } -} -func validateRedisConfig(cfg *Config) error { - if (len(cfg.Redis.SentinelUsername) > 0 || - len(cfg.Redis.SentinelPassword) > 0 || - len(cfg.Redis.SentinelAddresses) > 0) && - len(cfg.Redis.SentinelMasterSet) == 0 { + if (len(c.SentinelUsername) > 0 || + len(c.SentinelPassword) > 0 || + len(c.SentinelAddresses) > 0) && + len(c.SentinelMasterSet) == 0 { return fmt.Errorf("'redis.sentinelMasterSet' has to be set if Redis Sentinel is used") } diff --git a/redis/redis.go b/redis/redis.go index 0c9f61772..a3a4f9461 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -68,7 +68,7 @@ type Client struct { // New creates a new redis client func New(ctx context.Context, cfg *config.RedisConfig) (*Client, error) { // disable redis if no address is provided - if cfg == nil || len(cfg.Addresses) == 0 { + if cfg == nil || !cfg.IsEnabled() { return nil, nil //nolint:nilnil } From 146f0b5ecae8ca3c24147d4a370a1c90501db779 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 2 May 2023 16:16:53 +0200 Subject: [PATCH 32/38] linter fix --- config/redis.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config/redis.go b/config/redis.go index b6d337371..8502489c2 100644 --- a/config/redis.go +++ b/config/redis.go @@ -28,22 +28,22 @@ type RedisConfig struct { SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses } -func (cfg *RedisConfig) GetClientOptions() *rueidis.ClientOption { +func (c *RedisConfig) GetClientOptions() *rueidis.ClientOption { res := rueidis.ClientOption{ - InitAddress: cfg.Addresses, - Password: cfg.Password, - Username: cfg.Username, - SelectDB: cfg.Database, - RingScaleEachConn: cfg.ConnRingScale, - CacheSizeEachConn: cfg.LocalCacheSize, + InitAddress: c.Addresses, + Password: c.Password, + Username: c.Username, + SelectDB: c.Database, + RingScaleEachConn: c.ConnRingScale, + CacheSizeEachConn: c.LocalCacheSize, ClientTrackingOptions: []string{"PREFIX", "blocky:", "BCAST"}, } - if len(cfg.SentinelMasterSet) > 0 { + if len(c.SentinelMasterSet) > 0 { res.Sentinel = rueidis.SentinelOption{ - Username: cfg.SentinelUsername, - Password: cfg.SentinelPassword, - MasterSet: cfg.SentinelMasterSet, + Username: c.SentinelUsername, + Password: c.SentinelPassword, + MasterSet: c.SentinelMasterSet, } } From 3e5094cbb5c5d2b986ab1e0d01283b4c550b53c9 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 2 May 2023 16:24:16 +0200 Subject: [PATCH 33/38] log warnings about config ignore --- config/redis.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/redis.go b/config/redis.go index 8502489c2..56efa4112 100644 --- a/config/redis.go +++ b/config/redis.go @@ -65,6 +65,16 @@ func (c *RedisConfig) LogConfig(logger *logrus.Entry) { } func (c *RedisConfig) validateConfig() error { + if len(c.Addresses) > 0 && len(c.SentinelAddresses) > 0 { + log.Log().Warnln("'redis.addresses' and 'redis.sentinelAddresses' are both configured.") + log.Log().Warnln("'redis.sentinelAddresses' will be ignored.") + } + + if len(c.Addresses) > 0 && len(c.Address) > 0 { + log.Log().Warnln("'redis.addresses' and 'redis.address' are both configured.") + log.Log().Warnln("'redis.address' will be ignored.") + } + if len(c.Addresses) == 0 && len(c.SentinelAddresses) > 0 { log.Log().Warnln("'redis.sentinelAddresses' is deprecated. Please use 'redis.addresses' instead.") From 4ae0204f0a00122d5358bde6841f1c7c50e90926 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Tue, 2 May 2023 22:27:51 +0200 Subject: [PATCH 34/38] log fetch error --- redis/redis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redis/redis.go b/redis/redis.go index a3a4f9461..3b98edcd6 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -326,6 +326,8 @@ func (c *Client) getResponse(ctx context.Context, key string) (*CacheMessage, er } } + c.l.Debugf("Error fetching %s: %w", key, err) + return nil, err } From d1c7c2f9a6e9d4309343b7b87e79bcedd6226f47 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Wed, 3 May 2023 10:29:14 +0200 Subject: [PATCH 35/38] %w is not supported --- redis/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.go b/redis/redis.go index 3b98edcd6..bf5550858 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -326,7 +326,7 @@ func (c *Client) getResponse(ctx context.Context, key string) (*CacheMessage, er } } - c.l.Debugf("Error fetching %s: %w", key, err) + c.l.Debugf("Error fetching %s: %v", key, err) return nil, err } From 1b478d047a2601596794976a13573b20e6204480 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 May 2023 04:58:31 +0000 Subject: [PATCH 36/38] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.0 to 1.15.1. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.15.0...v1.15.1) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dfdd07d6a..cd064a322 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mroth/weightedrand/v2 v2.0.1 github.com/onsi/ginkgo/v2 v2.9.2 github.com/onsi/gomega v1.27.6 - github.com/prometheus/client_golang v1.15.0 + github.com/prometheus/client_golang v1.15.1 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index f2327ddce..1b0efb988 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ 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= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= From ad1ce3a85c66e3056869ea3fe91abcf67b3f6cd4 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 5 May 2023 21:22:08 +0200 Subject: [PATCH 37/38] retry.Do implementation --- config/redis.go | 2 +- redis/redis.go | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/config/redis.go b/config/redis.go index 56efa4112..2b4fd2976 100644 --- a/config/redis.go +++ b/config/redis.go @@ -17,7 +17,7 @@ type RedisConfig struct { SentinelPassword string `yaml:"sentinelPassword" default:""` SentinelMasterSet string `yaml:"sentinelMasterSet" default:""` Database int `yaml:"database" default:"0"` - ConnectionAttempts int `yaml:"connectionAttempts" default:"3"` + ConnectionAttempts uint `yaml:"connectionAttempts" default:"3"` ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` ConnRingScale int `yaml:"connRingScale" default:"10"` ShuffleInit bool `yaml:"shuffleInit" default:"false"` diff --git a/redis/redis.go b/redis/redis.go index bf5550858..92a7e468f 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -12,6 +12,7 @@ import ( "github.com/0xERR0R/blocky/log" "github.com/0xERR0R/blocky/model" "github.com/0xERR0R/blocky/util" + "github.com/avast/retry-go/v4" "github.com/google/uuid" "github.com/miekg/dns" "github.com/rueian/rueidis" @@ -85,19 +86,17 @@ func New(ctx context.Context, cfg *config.RedisConfig) (*Client, error) { var client rueidis.Client - for i := 0; i < cfg.ConnectionAttempts; i++ { - l.Debugf("connection attempt %d", i) + err = retry.Do( + func() error { + var ierr error - client, err = rueidis.NewClient(*roption) + client, ierr = rueidis.NewClient(*roption) - if err == nil { - break - } else { - l.Debug(err) - } - - time.Sleep(time.Duration(cfg.ConnectionCooldown)) - } + return ierr + }, + retry.Attempts(cfg.ConnectionAttempts), + retry.Delay(time.Duration(cfg.ConnectionCooldown)), + ) l.Debug("should be created") From 13c8577d8d379771efbaaf1a96bdf50929e8ff20 Mon Sep 17 00:00:00 2001 From: Kwitsch Date: Fri, 5 May 2023 22:46:57 +0200 Subject: [PATCH 38/38] log redis config if enabled --- config/redis.go | 11 +++++++++++ server/server.go | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/config/redis.go b/config/redis.go index 2b4fd2976..ae8957a79 100644 --- a/config/redis.go +++ b/config/redis.go @@ -28,6 +28,7 @@ type RedisConfig struct { SentinelAddresses []string `yaml:"sentinelAddresses"` // Deprecated: use Addresses } +// GetClientOptions converts configuration to rueidis.ClientOption func (c *RedisConfig) GetClientOptions() *rueidis.ClientOption { res := rueidis.ClientOption{ InitAddress: c.Addresses, @@ -62,8 +63,18 @@ func (c *RedisConfig) LogConfig(logger *logrus.Entry) { for _, a := range c.Addresses { logger.Infof(" - %s", a) } + + logger.Infof("username: %s", c.Username) + logger.Infof("database: %d", c.Database) + + if len(c.SentinelMasterSet) > 0 { + logger.Info("sentinel:") + logger.Infof(" username: %s", c.SentinelUsername) + logger.Infof(" masterSet: %s", c.SentinelMasterSet) + } } +// validateConfig tests and converts deprecated config values func (c *RedisConfig) validateConfig() error { if len(c.Addresses) > 0 && len(c.SentinelAddresses) > 0 { log.Log().Warnln("'redis.addresses' and 'redis.sentinelAddresses' are both configured.") diff --git a/server/server.go b/server/server.go index 587f12fe7..f5b4539d5 100644 --- a/server/server.go +++ b/server/server.go @@ -451,6 +451,12 @@ func (s *Server) printConfiguration() { logger().Info("listeners:") log.WithIndent(logger(), " ", s.cfg.Ports.LogConfig) + if s.redisClient != nil { + logger().Info("redis:") + + s.cfg.Redis.LogConfig(logger()) + } + logger().Info("runtime information:") // force garbage collector