Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DispatchHandler ¶
type DispatchHandler func(ctx context.Context, conn *grpc.ClientConn)
Represents the callback argument to the dispatch methods
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
A Dispatcher is a utility that facilitates sending queries to multiple grpc servers simultaneously. It maintains an up-to-date list of all pod ips that are part of a Kubernetes service and directs queries to the ips.
func NewDispatcher ¶
func NewDispatcher(connectUrl string, options ...DispatcherOption) (*Dispatcher, error)
func (*Dispatcher) Fanout ¶
func (d *Dispatcher) Fanout(ctx context.Context, fn DispatchHandler)
Sends queries to all available ips at query-time
func (*Dispatcher) FanoutSubscribe ¶
func (d *Dispatcher) FanoutSubscribe(ctx context.Context, fn DispatchHandler) (*Subscription, error)
Sends queries to all available ips at query-time and all subsequent ips when they become available until Unsubscribe() is called
func (*Dispatcher) Ready ¶
func (d *Dispatcher) Ready(ctx context.Context)
Wait until informer has synced with Kubernetes API
func (*Dispatcher) Shutdown ¶
func (d *Dispatcher) Shutdown() error
Closes connection which also stops resolver background processes
func (*Dispatcher) Start ¶
func (d *Dispatcher) Start()
Start background processes and initialize subconns
type DispatcherOption ¶
type DispatcherOption func(*dispatcherOptions)
DispatcherOption configures how we set up the dispatcher
func WithDialOptions ¶
func WithDialOptions(dialOpts ...grpc.DialOption) DispatcherOption
WithDialOptions configures the DialOptions to use when initializing a new grpc connection
func WithKubernetesClientset ¶
func WithKubernetesClientset(clientset kubernetes.Interface) DispatcherOption
WithKubernetesClientset configures the dispatcher to use the clientset when querying Kubernetes API
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Represents interest in pod ips that are part of a Kubernetes service