etcd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEtcdEmbedConfig

func NewEtcdEmbedConfig(ctx *Context) (*embed.Config, error)

Types

type Client

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

func (*Client) Close

func (c *Client) Close()

func (*Client) GetBackupMeta

func (c *Client) GetBackupMeta(key polypb.BackupMetaKey) (polypb.BackupMetaSlice, error)

func (*Client) GetNodeMeta

func (c *Client) GetNodeMeta(key polypb.NodeMetaKey) ([]*polypb.NodeMeta, error)

func (*Client) PutBackupMeta

func (c *Client) PutBackupMeta(key polypb.BackupMetaKey, meta *polypb.BackupMeta) error

func (*Client) PutNodeMeta

func (c *Client) PutNodeMeta(key polypb.NodeMetaKey, meta *polypb.NodeMeta) error

func (*Client) RemoveBackupMeta

func (c *Client) RemoveBackupMeta(key polypb.BackupMetaKey) error

func (*Client) RemoveNodeMeta

func (c *Client) RemoveNodeMeta(key polypb.NodeMetaKey) error

type ClientAPI

type ClientAPI interface {
	GetBackupMeta(key polypb.BackupMetaKey) (polypb.BackupMetaSlice, error)
	PutBackupMeta(key polypb.BackupMetaKey, meta *polypb.BackupMeta) error
	RemoveBackupMeta(key polypb.BackupMetaKey) error

	GetNodeMeta(key polypb.NodeMetaKey) ([]*polypb.NodeMeta, error)
	PutNodeMeta(key polypb.NodeMetaKey, meta *polypb.NodeMeta) error
	RemoveNodeMeta(key polypb.NodeMetaKey) error

	Close()
}

func NewClient

func NewClient(cfg clientv3.Config) (ClientAPI, error)

type Context

type Context struct {
	Host       string
	ClientPort string
	PeerPort   string
	DataDir    string
	JoinAddr   string
	NodeID     polypb.NodeID
}

func (*Context) AddMember

func (c *Context) AddMember(peerUrl string) (string, error)

type EtcdServer

type EtcdServer struct {
	Server *embed.Etcd

	ClientPort string
	// contains filtered or unexported fields
}

func NewEtcdServer

func NewEtcdServer(cfg *embed.Config) (*EtcdServer, error)

func (*EtcdServer) Close

func (e *EtcdServer) Close()

Jump to

Keyboard shortcuts

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