etcd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confstatus

type Confstatus struct {
	httputil.Base

	Request struct{}

	Response struct {
		Endpoints string `json:"endpoints"`
		Username  string `json:"username"`
		Password  string `json:"password"`
	}
}

func (Confstatus) Run

func (c Confstatus) Run(ctx *gin.Context)

type Confupdate

type Confupdate struct {
	httputil.Base
	Request struct {
		Endpoints string `json:"endpoints"` // a;b;c
		UserName  string `json:"username"`
		Password  string `json:"password"`
	}
	Response struct{}
}

func (Confupdate) Run

func (c Confupdate) Run(ctx *gin.Context)

type Confverify

type Confverify struct {
	httputil.Base
	Request  struct{}
	Response struct{}
}

func (Confverify) Run

func (c Confverify) Run(ctx *gin.Context)

type EtcdDriver

type EtcdDriver struct {
	OpTimeout time.Duration
	// contains filtered or unexported fields
}

func NewEtcdDriver

func NewEtcdDriver(options *EtcdOptions) (*EtcdDriver, error)

only check conf syntax

func (*EtcdDriver) Close

func (d *EtcdDriver) Close() error

func (*EtcdDriver) Get

func (d *EtcdDriver) Get(key string) (string, error)

func (*EtcdDriver) HandleError

func (d *EtcdDriver) HandleError(err error) error

func (*EtcdDriver) KeepAlive

func (d *EtcdDriver) KeepAlive(id clientv3.LeaseID) (int64, error)

func (*EtcdDriver) List

func (d *EtcdDriver) List(prefix string) (ans []*EtcdRecord, e error)

func (*EtcdDriver) Ping

func (d *EtcdDriver) Ping() bool

测试是否连通

func (*EtcdDriver) Put

func (d *EtcdDriver) Put(key, value string) error

func (*EtcdDriver) PutWithLease

func (d *EtcdDriver) PutWithLease(key, value string, ttl int64) (clientv3.LeaseID, error)

func (*EtcdDriver) Watch

func (d *EtcdDriver) Watch(ctx context.Context, key string) error

type EtcdOptions

type EtcdOptions struct {
	Endpoints   []string
	DialTimeout time.Duration // 连接超时时间
	OpTimeout   time.Duration // 操作超时时间
	UserName    string
	Password    string
}

type EtcdRecord

type EtcdRecord struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Keydelete

type Keydelete struct {
	httputil.Base
	Request  struct{}
	Response struct{}
}

func (Keydelete) Run

func (c Keydelete) Run(ctx *gin.Context)

type Keylist

type Keylist struct {
	httputil.Base
	Request struct {
		Prefix string `form:"prefix"`
	}
	Response struct{}
}

func (Keylist) Run

func (c Keylist) Run(ctx *gin.Context)

type Keyput

type Keyput struct {
	httputil.Base
	Request struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	}
	Response struct{}
}

func (Keyput) Run

func (c Keyput) Run(ctx *gin.Context)

Jump to

Keyboard shortcuts

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