etcd

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 https://skyao.gitbooks.io/learning-etcd3/content/documentation/op-guide/configuration.html#--advertise-client-urls https://etcd.readthedocs.io/en/latest/

Index

Constants

This section is empty.

Variables

View Source
var (
	KEY_URL = "116.62.230.114:2379"
	GR_URL  = "47.110.8.212:2379"
	GR_URL2 = "47.110.8.212:2479"
)
View Source
var EtcdPrefix = "/xiao/116.62.230.114/9001"

EtcdPrefix 当前应用配置的前缀

Functions

func CheckRegisted

func CheckRegisted() bool

@since 0.0.1 @since 0.0.10 底层方法重写

func DELETEEtcd added in v0.0.11

func DELETEEtcd(c *gin.Context)

func Delete added in v0.0.11

func Delete(key string) error

func Get added in v0.0.11

func Get(key string) (string, error)

func GetByPrefix added in v0.0.11

func GetByPrefix(prefix string) (*[]KV, error)

func GetEtcd added in v0.0.11

func GetEtcd(c *gin.Context)

func GetEtcds added in v0.0.11

func GetEtcds(c *gin.Context)

@since 0.0.10 获取多条

func GetString

func GetString(key string) (string, error)

GetString 获取 String @since 0.0.1 @since 0.0.10 底层方法重写,因用于Xiao项目 所以打上固定前缀避免冲突

func PUTEtcd added in v0.0.11

func PUTEtcd(c *gin.Context)

func Put added in v0.0.11

func Put(key string, value string) error

func PutKey

func PutKey(key, val string) error

PutKey 设置String @since 0.0.1 @since 0.0.10 底层方法重写,因用于Xiao项目 所以打上固定前缀避免冲突

func Register

func Register()

Register 注册 @since 0.0.1 @since 0.0.10 重写 etcd

func RegisterSelf

func RegisterSelf()

RegisterSelf 将自己注册到 ETCD @since 0.0.1

Types

type DELETEEtcdForm added in v0.0.11

type DELETEEtcdForm struct {
	Key string `json:"key" binding:'required'`
}

type EtcdClient added in v0.0.11

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

func New added in v0.0.11

func New() *EtcdClient

func (*EtcdClient) Delete added in v0.0.11

func (c *EtcdClient) Delete(key string) error

func (*EtcdClient) Get added in v0.0.11

func (c *EtcdClient) Get(key string) (string, error)

Get 获取值

func (*EtcdClient) GetByPrefix added in v0.0.11

func (c *EtcdClient) GetByPrefix(prefix string) (*[]KV, error)

GetByPrefix 通过前缀获取值

func (*EtcdClient) Put added in v0.0.11

func (c *EtcdClient) Put(key string, value string) error

Put 设置值

type GetEtcdFrom added in v0.0.11

type GetEtcdFrom struct {
	Key string `form:"key"`
}

type KV added in v0.0.11

type KV struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type PUTEtcdFrom added in v0.0.11

type PUTEtcdFrom struct {
	Key   string `json:"key" binding:'required'`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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