Documentation ¶
Index ¶
- Variables
- type ConsulClient
- func (c *ConsulClient) CreateLocker(key string) (*Locker, error)
- func (c *ConsulClient) CreateLockerOpts(opts *consulapi.LockOptions) (*Locker, error)
- func (c *ConsulClient) Delete(key string, opt *consulapi.WriteOptions) (*consulapi.WriteMeta, error)
- func (c *ConsulClient) Get(key string, opt *consulapi.QueryOptions) (*consulapi.KVPair, *consulapi.QueryMeta, error)
- func (c *ConsulClient) GetClient() *consulapi.Client
- func (c *ConsulClient) ListKV(prefix string, opt *consulapi.QueryOptions) (consulapi.KVPairs, *consulapi.QueryMeta, error)
- func (c *ConsulClient) ListSession() ([]*consulapi.SessionEntry, *consulapi.QueryMeta, error)
- func (c *ConsulClient) RegisterService(service *ServiceConfig) error
- func (c *ConsulClient) SearchService(addr string, serviceName string, tag string) ([]*ServiceConfig, error)
- func (c *ConsulClient) Set(key string, value string, opt *consulapi.WriteOptions) (*consulapi.WriteMeta, error)
- type Locker
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNotExistsKey = errors.New("not exists this key")
Functions ¶
This section is empty.
Types ¶
type ConsulClient ¶
type ConsulClient struct {
// contains filtered or unexported fields
}
func NewConsulClient ¶
func NewConsulClient(addr string) (*ConsulClient, error)
func (*ConsulClient) CreateLocker ¶
func (c *ConsulClient) CreateLocker(key string) (*Locker, error)
func (*ConsulClient) CreateLockerOpts ¶
func (c *ConsulClient) CreateLockerOpts(opts *consulapi.LockOptions) (*Locker, error)
func (*ConsulClient) Delete ¶
func (c *ConsulClient) Delete(key string, opt *consulapi.WriteOptions) (*consulapi.WriteMeta, error)
func (*ConsulClient) Get ¶
func (c *ConsulClient) Get(key string, opt *consulapi.QueryOptions) (*consulapi.KVPair, *consulapi.QueryMeta, error)
func (*ConsulClient) GetClient ¶
func (c *ConsulClient) GetClient() *consulapi.Client
func (*ConsulClient) ListKV ¶
func (c *ConsulClient) ListKV(prefix string, opt *consulapi.QueryOptions) (consulapi.KVPairs, *consulapi.QueryMeta, error)
func (*ConsulClient) ListSession ¶
func (c *ConsulClient) ListSession() ([]*consulapi.SessionEntry, *consulapi.QueryMeta, error)
func (*ConsulClient) RegisterService ¶
func (c *ConsulClient) RegisterService(service *ServiceConfig) error
func (*ConsulClient) SearchService ¶
func (c *ConsulClient) SearchService(addr string, serviceName string, tag string) ([]*ServiceConfig, error)
func (*ConsulClient) Set ¶
func (c *ConsulClient) Set(key string, value string, opt *consulapi.WriteOptions) (*consulapi.WriteMeta, error)
Click to show internal directories.
Click to hide internal directories.