etcd

package
v0.0.0-...-d09ac20 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client      *clientv3.Client
	Key         string
	ServiceList map[string]string
	// contains filtered or unexported fields
}

func (*Client) DelServiceList

func (this *Client) DelServiceList(key string)

func (*Client) GetValue

func (this *Client) GetValue(key string) ([]string, error)

func (*Client) SetServiceList

func (this *Client) SetServiceList(key, val string)

type Service

type Service struct {
	Client        *clientv3.Client
	Lease         clientv3.Lease
	LeaseResp     *clientv3.LeaseGrantResponse
	CancelFunc    func()
	KeepAliveChan <-chan *clientv3.LeaseKeepAliveResponse
	Key           string
}

func (*Service) PutService

func (this *Service) PutService(key, val string) error

通过租约 注册服务

func (*Service) RevokeLease

func (this *Service) RevokeLease() error

撤销租约

func (*Service) SetLease

func (this *Service) SetLease(ttl int64) error

设置租约

Jump to

Keyboard shortcuts

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