service

package
v0.0.0-...-a319e5f Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRaft

func NewRaft(cfg *config.Raft, fsm raft.FSM, trans raft.Transport) (*raft.Raft, error)

func NewRaftLayer

func NewRaftLayer(advertise net.Addr, l net.Listener) *raftLayer

func Tar

func Tar(base string, w io.Writer) error

func Untar

func Untar(base string, r io.Reader) error

Types

type FSM

type FSM struct {
	*leveldb.DB
	// contains filtered or unexported fields
}

func NewFSM

func NewFSM(cfg *config.DB) (*FSM, error)

func (*FSM) Apply

func (f *FSM) Apply(l *raft.Log) interface{}

func (*FSM) Restore

func (f *FSM) Restore(r io.ReadCloser) error

func (*FSM) Snapshot

func (f *FSM) Snapshot() (raft.FSMSnapshot, error)

type KVS

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

func NewKVS

func NewKVS(serv *Server) *KVS

func (*KVS) Apply

func (s *KVS) Apply(req *proto.Request, rep *proto.Reply) error

TODO forward

func (*KVS) Ping

func (s *KVS) Ping(req *proto.Request, rep *proto.Reply) error

func (*KVS) Read

func (s *KVS) Read(req *proto.Request, rep *proto.Reply) error

TODO forward

type Server

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

func NewServer

func NewServer(cfg *config.Config) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Serve

func (s *Server) Serve() error

Jump to

Keyboard shortcuts

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