etcd

package
v0.0.0-...-206c9bf Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

README

etcd

基于etcd的存储器

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcd

type Etcd struct {
	ClientID             string   `json:"-"`
	KeyPrefix            string   `json:"key_prefix"`
	Endpoints            []string `json:"endpoints"`
	DialTimeout          uint     `json:"dial_timeout"`
	Username             string   `json:"username"`
	Password             string   `json:"password"`
	AutoSyncInterval     uint     `json:"auto_sync_interval"`
	DialKeepAliveTime    uint     `json:"dial_keep_alive_time"`
	DialKeepAliveTimeout uint     `json:"dial_keep_alive_timeout"`
	MaxCallSendMsgSize   uint     `json:"max_call_send_msg_size"`
	MaxCallRecvMsgSize   uint     `json:"max_call_recv_msg_size"`
	RejectOldCluster     bool     `json:"reject_old_cluster"`
	PermitWithoutStream  bool     `json:"permit_without_stream"`
	// contains filtered or unexported fields
}

func New

func New(config string) (*Etcd, error)

func (*Etcd) DeleteLocalHost

func (self *Etcd) DeleteLocalHost(key string) error

删除本地主机数据

func (*Etcd) DeleteLocalRoute

func (self *Etcd) DeleteLocalRoute(keyStr string) error

删除本地路由数据

func (*Etcd) DeleteLocalService

func (self *Etcd) DeleteLocalService(key string) error

删除本地服务数据

func (*Etcd) DeleteStorageHost

func (self *Etcd) DeleteStorageHost(hostname string) error

删除存储器中主机数据

func (*Etcd) DeleteStorageRoute

func (self *Etcd) DeleteStorageRoute(routeGroupID, routePath, routeMethod string) error

删除存储器中路由数据

func (*Etcd) DeleteStorageService

func (self *Etcd) DeleteStorageService(serviceID string) error

删除本地服务数据

func (*Etcd) LoadAll

func (self *Etcd) LoadAll() (err error)

加载所有数据

func (*Etcd) LoadAllHost

func (self *Etcd) LoadAllHost() error

从存储器加载所有主机数据到本地

func (*Etcd) LoadAllRoute

func (self *Etcd) LoadAllRoute() error

从存储器加载所有路由到本地

func (*Etcd) LoadAllService

func (self *Etcd) LoadAllService() error

从存储器加载所有服务数据到本地

func (*Etcd) LoadHost

func (self *Etcd) LoadHost(key string, data []byte) error

从存储器加载主机数据到本地,如果不存在则创建

func (*Etcd) LoadRoute

func (self *Etcd) LoadRoute(key string, data []byte) error

从存储器加载路由到本地

func (*Etcd) LoadService

func (self *Etcd) LoadService(data []byte) error

从存储器加载服务数据到本地

func (Etcd) MarshalEasyJSON

func (v Etcd) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Etcd) MarshalJSON

func (v Etcd) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Etcd) SaveAll

func (self *Etcd) SaveAll() (err error)

存储所有数据

func (*Etcd) SaveAllHost

func (self *Etcd) SaveAllHost() error

将本地中所有主机数据保存到存储器

func (*Etcd) SaveAllRoute

func (self *Etcd) SaveAllRoute() (err error)

将本地所有路由保存到存储器

func (*Etcd) SaveAllService

func (self *Etcd) SaveAllService() error

将本地所有服务数据保存到存储器

func (*Etcd) SaveHost

func (self *Etcd) SaveHost(hostname, config string) (err error)

将本地主机数据保存到存储器中,如果不存在则创建

func (*Etcd) SaveRoute

func (self *Etcd) SaveRoute(routeGroupID, routePath, routeMethod, serviceID string) error

保存本地路由到存储器,如果不存在则创建

func (*Etcd) SaveService

func (self *Etcd) SaveService(serviceID, config string) error

将本地服务数据保存到存储器

func (*Etcd) UnmarshalEasyJSON

func (v *Etcd) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Etcd) UnmarshalJSON

func (v *Etcd) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Etcd) Watch

func (self *Etcd) Watch() error

监听变更

Jump to

Keyboard shortcuts

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