registrarclient

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEARTBEATOFFSET = 1
	BufSize         = 10
)
View Source
const (
	DEFAULT_LEASE_TIME = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

func WithFileOption

func WithFileOption(filepath string) ClientOption

func WithLeaseTime

func WithLeaseTime(t int64) ClientOption

func WithPassive

func WithPassive(b bool) ClientOption

func WithRegistrarAddr

func WithRegistrarAddr(addr []string) ClientOption

func WithService

func WithService(name, addr string) ClientOption

type ClientOpts

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

func NewDefaultOptions

func NewDefaultOptions() *ClientOpts

func (*ClientOpts) ApplyOpts

func (opt *ClientOpts) ApplyOpts(option []ClientOption)

func (*ClientOpts) WithLeaseTime added in v0.0.2

func (opt *ClientOpts) WithLeaseTime(leaseTime int64) *ClientOpts

func (*ClientOpts) WithPassive added in v0.0.2

func (opt *ClientOpts) WithPassive(b bool) *ClientOpts

func (*ClientOpts) WithRegistrarAddress added in v0.0.2

func (opt *ClientOpts) WithRegistrarAddress(addr []string) *ClientOpts

func (*ClientOpts) WithService added in v0.0.2

func (opt *ClientOpts) WithService(name, addr, version string) *ClientOpts

func (*ClientOpts) WithWeight added in v0.0.4

func (opt *ClientOpts) WithWeight(w int32) *ClientOpts

type RegistrarClient

type RegistrarClient interface {
	Register(ctx context.Context) error
	Close()
	Discover(ctx context.Context, name string) (string, error)
	Subscribe(ctx context.Context, name string) (chan *pb.SubscribeResponse, error)
}

func NewRegistrarClient

func NewRegistrarClient(opts *ClientOpts) RegistrarClient

Jump to

Keyboard shortcuts

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