api

package
v0.0.0-...-580af04 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPCMessage MessageType = 10 + iota
	ClientMessage

	Get          ClientAction = "get"
	Put          ClientAction = "put"
	Delete       ClientAction = "delete"
	Exists       ClientAction = "exists"
	List         ClientAction = "list"
	DeleteTree   ClientAction = "deleteTree"
	Watch        ClientAction = "watch"
	WatchTree    ClientAction = "watchTree"
	NewLock      ClientAction = "newLock"
	AtomicPut    ClientAction = "atomicPut"
	AtomicDelete ClientAction = "atomicDelete"
)

Variables

This section is empty.

Functions

func Decode

func Decode(v interface{}, from io.Reader) error

func Dial

func Dial(address string, msgType MessageType, timeout time.Duration, tlsConfig *tls.Config, retry bool) (net.Conn, error)

func Encode

func Encode(v interface{}, to io.Writer) error

Types

type ClientAction

type ClientAction string

type KVPair

type KVPair struct {
	Key       string
	Value     []byte
	LastIndex uint64
}

type MessageType

type MessageType byte

type Request

type Request struct {
	Action   ClientAction
	Key      string
	Value    []byte
	TTL      time.Duration
	Previous *KVPair
	Args     []string
}

type Response

type Response struct {
	Err       string
	KV        *KVPair
	List      []*KVPair
	Exists    bool
	Completed bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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