etcdcli

package module
v0.0.0-...-b10ff82 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 7 Imported by: 0

README

etcdcli

实现 1. 熔断 2. 负载均衡(轮训)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type V2

type V2 struct {
	Endpoints []string
	Username  string
	Password  string
	Cli       client.Client
	KeysApi   client.KeysAPI
}

func NewConnV2

func NewConnV2(data []string, username, password string) (*V2, error)

data []string{"http://localhost:2379"}

func (*V2) DeleteV2

func (this *V2) DeleteV2(key string) (*client.Response, error)

func (*V2) DeleteWithPrefixV2

func (this *V2) DeleteWithPrefixV2(key string) (*client.Response, error)

func (*V2) GetV2

func (this *V2) GetV2(key string) (*client.Response, error)

func (*V2) GetWithPreifxV2

func (this *V2) GetWithPreifxV2(key string) (*client.Response, error)

func (*V2) Init

func (this *V2) Init() error

func (*V2) PutTtlV2

func (this *V2) PutTtlV2(key, value string, ttl int64) (*client.Response, error)

func (*V2) PutV2

func (this *V2) PutV2(key, value string) (*client.Response, error)

func (*V2) SetDir

func (this *V2) SetDir(key string) (*client.Response, error)

type V3

type V3 struct {
	Endpoints []string
	Username  string
	Password  string
	Cli       *clientv3.Client
}

func NewConnV3

func NewConnV3(data []string, username, password string) (*V3, error)

func (*V3) DeleteV3

func (this *V3) DeleteV3(key string) (*clientv3.DeleteResponse, error)

func (*V3) DeleteWithPrefixV3

func (this *V3) DeleteWithPrefixV3(key string) (*clientv3.DeleteResponse, error)

func (*V3) GetV3

func (this *V3) GetV3(key string) (*clientv3.GetResponse, error)

func (*V3) GetWithPreifxV3

func (this *V3) GetWithPreifxV3(key string) (*clientv3.GetResponse, error)

func (*V3) Init

func (this *V3) Init() error

func (*V3) PutTtlV3

func (this *V3) PutTtlV3(key, value string, ttl int64) (*clientv3.PutResponse, error)

func (*V3) PutV3

func (this *V3) PutV3(key, value string) (*clientv3.PutResponse, error)

Jump to

Keyboard shortcuts

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