etcd

package
v0.0.0-...-0cb5874 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(svc *Service) resolver.Builder

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, endpoints []string, prefix string, options ...ClientOption) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetInstances

func (c *Client) GetInstances(svc string) ([]sd.Instance, error)

func (*Client) Register

func (c *Client) Register(svc string, inst sd.Instance, ttl int64) (func(), error)

func (*Client) Watch

func (c *Client) Watch(svc string, ch chan<- struct{}) func()

type ClientOption

type ClientOption func(*ClientOptions)

func WithDailKeepAliveTime

func WithDailKeepAliveTime(v time.Duration) ClientOption

func WithDailTimeout

func WithDailTimeout(v time.Duration) ClientOption

func WithDialKeepAliveTimeout

func WithDialKeepAliveTimeout(v time.Duration) ClientOption

type ClientOptions

type ClientOptions struct {
	DialTimeout          time.Duration
	DialKeepAliveTime    time.Duration
	DialKeepAliveTimeout time.Duration
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(client *Client, name string) (*Service, error)

func (*Service) Register

func (s *Service) Register(inst sd.Instance, ttl int64) (func(), error)

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) Subscribe

func (s *Service) Subscribe(ch chan<- sd.Event)

func (*Service) Unsubscribe

func (s *Service) Unsubscribe(ch chan<- sd.Event)

Jump to

Keyboard shortcuts

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