etcd

package
v0.0.0-...-161ecb4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT = 5 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcd

type Etcd struct {
	// contains filtered or unexported fields
}

func GetDefaultEtcdService

func GetDefaultEtcdService() *Etcd

func (*Etcd) CheckKey

func (etcd *Etcd) CheckKey(client string, prefix PrefixEnum, keyPath string) (bool, error)

func (*Etcd) Delete

func (etcd *Etcd) Delete(client string, prefix PrefixEnum, keyPath string) error

func (*Etcd) DeleteByKey

func (etcd *Etcd) DeleteByKey(key string) error

func (*Etcd) EscapeUnauthenticated

func (etcd *Etcd) EscapeUnauthenticated(errGet error) error

func (*Etcd) Get

func (etcd *Etcd) Get(client string, prefix PrefixEnum, keyPath string) (string, error)

func (*Etcd) GetBytes

func (etcd *Etcd) GetBytes(client string, prefix PrefixEnum, keyPath string) ([]byte, error)

func (*Etcd) GetClient

func (etcd *Etcd) GetClient() *clientv3.Client

func (*Etcd) GetKey

func (etcd *Etcd) GetKey(client string, prefix PrefixEnum, key string) string

func (*Etcd) GetList

func (etcd *Etcd) GetList(client string, prefix PrefixEnum, keyPath string) ([]*EtcdItem, error)

func (*Etcd) LeaseGrant

func (etcd *Etcd) LeaseGrant(ttl int64) (*clientv3.LeaseGrantResponse, error)

func (*Etcd) LeaseKeepLive

func (etcd *Etcd) LeaseKeepLive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error)

func (*Etcd) LeaseKeepLiveOnce

func (etcd *Etcd) LeaseKeepLiveOnce(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseKeepAliveResponse, error)

func (*Etcd) LeaseRevoke

func (etcd *Etcd) LeaseRevoke(id clientv3.LeaseID) error

func (*Etcd) Put

func (etcd *Etcd) Put(client string, prefix PrefixEnum, keyPath, value string) error

func (*Etcd) PutWithTTL

func (etcd *Etcd) PutWithTTL(client string, prefix PrefixEnum, keyPath, value string, ttl int64) error

func (*Etcd) PutWithTTLId

func (etcd *Etcd) PutWithTTLId(client string, prefix PrefixEnum, keyPath, value string, ttlId clientv3.LeaseID) error

func (*Etcd) WatchKey

func (etcd *Etcd) WatchKey(client string, prefix PrefixEnum, key string) clientv3.WatchChan

func (*Etcd) WatchPath

func (etcd *Etcd) WatchPath(client string, prefix PrefixEnum, keyPath string) clientv3.WatchChan

type EtcdConf

type EtcdConf struct {
	Urls     []string
	UserName string
	Password string
}

type EtcdItem

type EtcdItem struct {
	Path  string `json:"path"`
	Value string `json:"value"`
}

type PrefixEnum

type PrefixEnum string
const (
	PrefixEnumConfig PrefixEnum = "config"
	PrefixEnumWorker PrefixEnum = "worker"
	PrefixEnumMaster PrefixEnum = "master"
	PrefixEnumJob    PrefixEnum = "job"
	PrefixEnumFlow   PrefixEnum = "flow"
)

Jump to

Keyboard shortcuts

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