kvstores

package module
v0.0.0-...-54733ad Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2015 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Unknown            = 1
	Unimplemented      = 2
	BackendUnreachable = 3
	KeyNotFound        = 4
	KeyExists          = 5
	BadVersion         = 6
)

Variables

This section is empty.

Functions

func NormalizeAddress

func NormalizeAddress(addr string, defaultPort uint16) string

normalizeAddress returns addr with the passed default port appended if there is not already a port specified.

Types

type Client

type Client interface {
	Create(path string, data string) *Error
	Delete(path string, version int32) *Error
	Exists(path string) *Error
	GetData(path string) (*Node, *Error)
	SetData(path string, data string, version int32) *Error
	GetChildren(path string) ([]string, *Error)
}

type ConsulClient

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

func NewConsulClient

func NewConsulClient(addr string, dialTimeout time.Duration) (*ConsulClient, error)

func (*ConsulClient) Create

func (c *ConsulClient) Create(path string, data string) *Error

func (*ConsulClient) Delete

func (c *ConsulClient) Delete(path string, version int32) *Error

func (*ConsulClient) Exists

func (c *ConsulClient) Exists(path string) *Error

func (*ConsulClient) GetChildren

func (c *ConsulClient) GetChildren(path string) ([]string, *Error)

func (*ConsulClient) GetData

func (c *ConsulClient) GetData(path string) (*Node, *Error)

func (*ConsulClient) SetData

func (c *ConsulClient) SetData(path string, data string, version int32) *Error

type Error

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

func (*Error) Code

func (e *Error) Code() int

func (*Error) String

func (e *Error) String() string

type EtcdClient

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

func NewEtcdClient

func NewEtcdClient(machines []string, cert, certKey string, caKeys string,
	dialTimeout time.Duration) (*EtcdClient, error)

func (*EtcdClient) Create

func (c *EtcdClient) Create(path string, data string) (err *Error)

func (*EtcdClient) Delete

func (c *EtcdClient) Delete(path string, version int32) (err *Error)

func (*EtcdClient) Exists

func (c *EtcdClient) Exists(path string) (err *Error)

func (*EtcdClient) GetChildren

func (c *EtcdClient) GetChildren(path string) ([]string, *Error)

func (*EtcdClient) GetData

func (c *EtcdClient) GetData(path string) (*Node, *Error)

func (*EtcdClient) SetData

func (c *EtcdClient) SetData(path string, data string, version int32) (err *Error)

type Node

type Node struct {
	Path          string
	Value         string
	CreatedIndex  uint64
	ModifiedIndex uint64
	Nodes         Nodes
}

type Nodes

type Nodes []*Node

Jump to

Keyboard shortcuts

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