Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: remove unused fields #3382

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions net/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type Client struct {
once sync.Once
client http.Client
tr *Transport
log logging.Logger
sr secrets.SecretsReader
}

Expand Down Expand Up @@ -67,9 +66,8 @@ func NewClient(o Options) *Client {
Transport: tr,
CheckRedirect: o.CheckRedirect,
},
tr: tr,
log: o.Log,
sr: sr,
tr: tr,
sr: sr,
}

return c
Expand Down
6 changes: 2 additions & 4 deletions net/redisclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,13 @@ func (j *jumpHash) Get(k string) string {
// Multi-probe consistent hashing - mpchash
// https://arxiv.org/pdf/1505.00062.pdf
type multiprobe struct {
hash *mpchash.Multi
shards []string
hash *mpchash.Multi
}

func NewMultiprobe(shards []string) redis.ConsistentHash {
return &multiprobe{
// 2 seeds and k=21 got from library
hash: mpchash.New(shards, siphash64seed, [2]uint64{1, 2}, 21),
shards: shards,
hash: mpchash.New(shards, siphash64seed, [2]uint64{1, 2}, 21),
}
}

Expand Down
4 changes: 0 additions & 4 deletions ratelimit/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const (
type Registry struct {
sync.Mutex
once sync.Once
closed bool
defaults Settings
global Settings
lookup map[Settings]*Ratelimit
swarm Swarmer
Expand Down Expand Up @@ -52,7 +50,6 @@ func NewSwarmRegistry(swarm Swarmer, ro *net.RedisOptions, settings ...Settings)

r := &Registry{
once: sync.Once{},
defaults: defaults,
global: defaults,
lookup: make(map[Settings]*Ratelimit),
swarm: swarm,
Expand All @@ -72,7 +69,6 @@ func NewSwarmRegistry(swarm Swarmer, ro *net.RedisOptions, settings ...Settings)
// Close teardown Registry and dependent resources
func (r *Registry) Close() {
r.once.Do(func() {
r.closed = true
r.redisRing.Close()
for _, rl := range r.lookup {
rl.Close()
Expand Down
5 changes: 1 addition & 4 deletions routesrv/routesrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
// RouteServer is used to serve eskip-formatted routes,
// that originate from the polled data source.
type RouteServer struct {
metrics metrics.Metrics
server *http.Server
supportServer *http.Server
poller *poller
Expand Down Expand Up @@ -53,9 +52,7 @@ func New(opts skipper.Options) (*RouteServer, error) {
m := metrics.NewMetrics(mopt)
metricsHandler := metrics.NewHandler(mopt, m)

rs := &RouteServer{
metrics: m,
}
rs := &RouteServer{}

opentracingOpts := opts.OpenTracing
if len(opentracingOpts) == 0 {
Expand Down
2 changes: 0 additions & 2 deletions secrets/secrettest/secrettest.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ func (tr *TestRegistry) GetEncrypter(refreshInterval time.Duration, s string) (s
}

type TestingSecretSource struct {
getCount int
secretKey string
}

func (s *TestingSecretSource) GetSecret() ([][]byte, error) {
s.getCount++
return [][]byte{[]byte(s.secretKey)}, nil
}
Loading