consul/agent/router/grpc.go
Daniel Nephin f936ca5aea grpc: client conn pool and resolver
Extracted from 936522a13c07e8b732b6fde61bba23d05f7b9a70

Co-authored-by: Paul Banks <banks@banksco.de>
2020-09-24 12:46:22 -04:00

21 lines
593 B
Go

package router
import "github.com/hashicorp/consul/agent/metadata"
// ServerTracker is a wrapper around consul.ServerResolverBuilder to prevent a
// cyclic import dependency.
type ServerTracker interface {
AddServer(*metadata.Server)
RemoveServer(*metadata.Server)
}
// NoOpServerTracker is a ServerTracker that does nothing. Used when gRPC is not
// enabled.
type NoOpServerTracker struct{}
// AddServer implements ServerTracker
func (NoOpServerTracker) AddServer(*metadata.Server) {}
// RemoveServer implements ServerTracker
func (NoOpServerTracker) RemoveServer(*metadata.Server) {}