Skip to content

Commit

Permalink
unrelated but just move some code around
Browse files Browse the repository at this point in the history
  • Loading branch information
demmer committed Apr 25, 2024
1 parent 5132118 commit 621ba65
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions go/vt/vtgateproxy/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ import (
// type: Only select from hosts of this type (required)
//

// Resolver(https://godoc.org/google.golang.org/grpc/resolver#Resolver).
type JSONGateResolver struct {
target resolver.Target
clientConn resolver.ClientConn
poolType string
}

func (r *JSONGateResolver) ResolveNow(o resolver.ResolveNowOptions) {}

func (r *JSONGateResolver) Close() {
log.Infof("Closing resolver for target %s", r.target.URL.String())
}

type JSONGateResolverBuilder struct {
jsonPath string
addressField string
Expand All @@ -80,13 +93,6 @@ type targetHost struct {
Affinity string
}

// Resolver(https://godoc.org/google.golang.org/grpc/resolver#Resolver).
type JSONGateResolver struct {
target resolver.Target
clientConn resolver.ClientConn
poolType string
}

var (
parseCount = stats.NewCountersWithSingleLabel("JsonDiscoveryParseCount", "Count of results of JSON host file parsing (changed, unchanged, error)", "result")
targetCount = stats.NewGaugesWithSingleLabel("JsonDiscoveryTargetCount", "Count of hosts returned from discovery by pool type", "pool")
Expand Down Expand Up @@ -403,12 +409,6 @@ func (b *JSONGateResolverBuilder) debugTargets() any {
}
}

func (r *JSONGateResolver) ResolveNow(o resolver.ResolveNowOptions) {}

func (r *JSONGateResolver) Close() {
log.Infof("Closing resolver for target %s", r.target.URL.String())
}

const (
// targetsTemplate is a HTML template to display the gate resolver's target hosts.
targetsTemplate = `
Expand Down

0 comments on commit 621ba65

Please sign in to comment.