consul

package
v0.0.0-...-25da3cc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 (*ConsulClient) Get

func (*ConsulClient) GetClient

func (c *ConsulClient) GetClient() *consulapi.Client

func (*ConsulClient) ListKV

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

type Locker

type Locker struct {
	Locker *api.Lock
}

func (*Locker) Lock

func (l *Locker) Lock() (<-chan struct{}, error)

func (*Locker) UnLock

func (l *Locker) UnLock() error

type ServiceConfig

type ServiceConfig struct {
	Name     string
	Tags     []string
	Address  string
	Port     int
	ChechUrl string
}

Jump to

Keyboard shortcuts

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