discoverer

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package discoverer

Package discoverer

Index

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() grpc.Client
}

func New

func New(opts ...Option) (d Client, err error)

type Option

type Option func(c *client) error

func WithAutoConnect

func WithAutoConnect(flg bool) Option

func WithDiscoverDuration

func WithDiscoverDuration(dur string) Option

func WithDiscovererAddr

func WithDiscovererAddr(addr string) Option

func WithDiscovererClient

func WithDiscovererClient(gc grpc.Client) Option

func WithDiscovererHostPort

func WithDiscovererHostPort(host string, port int) Option

func WithErrGroup

func WithErrGroup(eg errgroup.Group) Option

func WithName

func WithName(name string) Option

func WithNamespace

func WithNamespace(ns string) Option

func WithNodeName

func WithNodeName(nn string) Option

func WithOnConnectFunc

func WithOnConnectFunc(f func(ctx context.Context, c Client, addr string) error) Option

func WithOnDisconnectFunc

func WithOnDisconnectFunc(f func(ctx context.Context, c Client, addr string) error) Option

func WithOnDiscoverFunc

func WithOnDiscoverFunc(f func(ctx context.Context, c Client, addrs []string) error) Option

func WithOptions

func WithOptions(opts ...grpc.Option) Option

func WithPort

func WithPort(port int) Option

func WithServiceDNSARecord

func WithServiceDNSARecord(a string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL