raftkv

package module
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: 19 Imported by: 0

README

Drax

An embeddable distributed k/v store for Go

Drax is a distributed k/v store based on raft (specifically https://github.com/hashicorp/raft) The intent is to be relatively light-weight and embeddable, while implementing the API from https://github.com/docker/libkv

Drax is NOT intended for production use. Use at your own risk. This should be considered ALPHA quality.

###TODO:

  • Add tests
  • Add support for watches
  • Serious code cleanup
  • Imrpove RPC semantics
  • Look at using something other than JSON for encoding/decoding K/V messages, and RPC messages
  • Add more documentation (both in code and examples)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRaftPort = "2380"
)

Functions

This section is empty.

Types

type Cluster

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

func New

func New(l net.Listener, home, addr, peer string, tlsConfig *tls.Config) (*Cluster, error)

func (*Cluster) Errors

func (c *Cluster) Errors() <-chan error

func (*Cluster) KVStore

func (c *Cluster) KVStore() libkvstore.Store

func (*Cluster) Shutdown

func (c *Cluster) Shutdown()

func (*Cluster) ShutdownCh

func (c *Cluster) ShutdownCh() <-chan struct{}

type RPCServer

type RPCServer struct {
	net.Listener
	// contains filtered or unexported fields
}

RPCServer handles routing from an an incoming conneciton to a specified backend. These backends are determined based on the 1st byte read from the incoming connection

type Raft

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

func (*Raft) AddPeer

func (r *Raft) AddPeer(peer string) error

func (*Raft) Apply

func (r *Raft) Apply(b []byte) error

func (*Raft) Close

func (r *Raft) Close() error

func (*Raft) IsLeader

func (r *Raft) IsLeader() bool

func (*Raft) Leader

func (r *Raft) Leader() string

func (*Raft) LeaderCh

func (r *Raft) LeaderCh() <-chan interface{}

func (*Raft) Peers

func (r *Raft) Peers() ([]string, error)

func (*Raft) RemovePeer

func (r *Raft) RemovePeer(peer string) error

func (*Raft) SetPeers

func (r *Raft) SetPeers(peers []string) error

func (*Raft) ShutdownCh

func (r *Raft) ShutdownCh() <-chan struct{}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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