Documentation ¶
Overview ¶
封装了一些 etcd 的常用操作 之前是给 plemis 使用的 , 后续看缓存或者配置文件是否要用
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 ¶
- Variables
- func CheckRegisted() bool
- func DELETEEtcd(c *gin.Context)
- func Delete(key string) error
- func Get(key string) (string, error)
- func GetByPrefix(prefix string) (*[]KV, error)
- func GetEtcd(c *gin.Context)
- func GetEtcds(c *gin.Context)
- func GetString(key string) (string, error)
- func PUTEtcd(c *gin.Context)
- func Put(key string, value string) error
- func PutKey(key, val string) error
- func Register()
- func RegisterSelf()
- type DELETEEtcdForm
- type EtcdClient
- type GetEtcdFrom
- type KV
- type PUTEtcdFrom
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 GetString ¶
GetString 获取 String @since 0.0.1 @since 0.0.10 底层方法重写,因用于Xiao项目 所以打上固定前缀避免冲突
func PutKey ¶
PutKey 设置String @since 0.0.1 @since 0.0.10 底层方法重写,因用于Xiao项目 所以打上固定前缀避免冲突
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
func New ¶
func New() *EtcdClient
func (*EtcdClient) Delete ¶
func (c *EtcdClient) Delete(key string) error
func (*EtcdClient) GetByPrefix ¶
func (c *EtcdClient) GetByPrefix(prefix string) (*[]KV, error)
GetByPrefix 通过前缀获取值
Click to show internal directories.
Click to hide internal directories.