zk

package
v0.0.0-...-4972dd0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CN2P

func CN2P(name string) string

ConfigNameToPath

func GetOneHost

func GetOneHost() string

func MonitorNodeRoot

func MonitorNodeRoot() string

func MyMonitorNode

func MyMonitorNode() (string, error)

func P2CN

func P2CN(path string) string

PathToConfigName

Types

type Conn

type Conn struct {

	// the underground connection to storage server has been re-created.
	DriverReset chan bool
	// contains filtered or unexported fields
}

func (*Conn) Close

func (conn *Conn) Close()

func (*Conn) Create

func (conn *Conn) Create(path string, data []byte, lease clientv3.LeaseID) (string, error)

func (*Conn) CreateDriverResetChan

func (conn *Conn) CreateDriverResetChan()

func (*Conn) Exists

func (conn *Conn) Exists(path string) (bool, error)

func (*Conn) ExistsW

func (conn *Conn) ExistsW(path string) clientv3.WatchChan

func (*Conn) Get

func (conn *Conn) Get(path string) ([]byte, error)

func (*Conn) GetDriverResetChan

func (conn *Conn) GetDriverResetChan() <-chan bool

func (*Conn) Grant

func (conn *Conn) Grant(ttl int64) (clientv3.LeaseID, error)

func (*Conn) KeepAlive

func (conn *Conn) KeepAlive(ctx context.Context, lease clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error)

func (*Conn) KeepAliveOnce

func (conn *Conn) KeepAliveOnce(ctx context.Context, lease clientv3.LeaseID) (*clientv3.LeaseKeepAliveResponse, error)

func (*Conn) Set

func (conn *Conn) Set(path string, data []byte, lease ...clientv3.LeaseID) (string, error)

type Storage

type Storage struct {
	Conn *Conn
}

func CreateConn

func CreateConn(callback func(string, bool)) (*Storage, error)

func GetConn

func GetConn(callback func(string, bool)) (*Storage, error)

获取一个连接单例

Jump to

Keyboard shortcuts

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