Documentation ¶
Overview ¶
Package discoverer
Package discoverer
Index ¶
- type Client
- type Option
- func WithAutoConnect(flg bool) Option
- func WithDiscoverDuration(dur string) Option
- func WithDiscovererClient(gc grpc.Client) Option
- func WithErrGroup(eg errgroup.Group) Option
- func WithName(name string) Option
- func WithNamespace(ns string) Option
- func WithNodeName(nn string) Option
- func WithOnConnectFunc(f func(ctx context.Context, c Client, addr string) error) Option
- func WithOnDisconnectFunc(f func(ctx context.Context, c Client, addr string) error) Option
- func WithOnDiscoverFunc(f func(ctx context.Context, c Client, addrs []string) error) Option
- func WithOptions(opts ...grpc.Option) Option
- func WithPort(port int) Option
- func WithReadReplicaClient(gc grpc.Client) Option
- func WithReadReplicaReplicas(num uint64) Option
- func WithServiceDNSARecord(a string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Start(ctx context.Context) (<-chan error, error) GetAddrs(ctx context.Context) []string // GetClient returns the grpc.Client for both read and write. GetClient() grpc.Client // GetReadClient returns the grpc.Client only for read. If there's no readreplica, this returns the grpc.Client for the primary agent. // Use this API only for getting client for agent. For other use cases, use GetClient() instead. // Internally, this API round robin between c.client and c.readClient with the ratio of // agent replicas and read replica agent replicas. GetReadClient() grpc.Client }
type Option ¶
type Option func(c *client) error
func WithAutoConnect ¶
func WithDiscoverDuration ¶
func WithDiscovererClient ¶
func WithErrGroup ¶
func WithNamespace ¶
func WithNodeName ¶
func WithOnConnectFunc ¶
func WithOnDisconnectFunc ¶
func WithOnDiscoverFunc ¶
func WithOptions ¶
func WithReadReplicaClient ¶ added in v1.7.11
func WithReadReplicaReplicas ¶ added in v1.7.11
func WithServiceDNSARecord ¶
Click to show internal directories.
Click to hide internal directories.