Documentation ¶
Index ¶
- Constants
- type ClientOption
- type ClientOpts
- func (opt *ClientOpts) ApplyOpts(option []ClientOption)
- func (opt *ClientOpts) WithLeaseTime(leaseTime int64) *ClientOpts
- func (opt *ClientOpts) WithPassive(b bool) *ClientOpts
- func (opt *ClientOpts) WithRegistrarAddress(addr []string) *ClientOpts
- func (opt *ClientOpts) WithService(name string, addr string) *ClientOpts
- type RegistrarClient
Constants ¶
View Source
const ( HEARTBEATOFFSET = 1 MAXRETRY = 2 DEFAULTLEASETIME = 10 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 string, addr string) *ClientOpts
type RegistrarClient ¶
type RegistrarClient struct {
// contains filtered or unexported fields
}
func NewRegistrarClient ¶
func NewRegistrarClient(opts *ClientOpts) *RegistrarClient
func (*RegistrarClient) Subscribe ¶
func (c *RegistrarClient) Subscribe(ctx context.Context, name string) (chan *pb.SubscribeResponse, error)
Click to show internal directories.
Click to hide internal directories.