Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(w http.ResponseWriter, req *http.Request, s Server, key string, dir bool, value string, expireTime time.Time) error

func DeleteHandler

func DeleteHandler(w http.ResponseWriter, req *http.Request, s Server) error

func GetHandler

func GetHandler(w http.ResponseWriter, req *http.Request, s Server) error

func PostHandler

func PostHandler(w http.ResponseWriter, req *http.Request, s Server) error

func PutHandler

func PutHandler(w http.ResponseWriter, req *http.Request, s Server) error

func SetHandler

func SetHandler(w http.ResponseWriter, req *http.Request, s Server, key string, dir bool, value string, expireTime time.Time) error

func UpdateHandler

func UpdateHandler(w http.ResponseWriter, req *http.Request, s Server, key, value string, expireTime time.Time) error

Types

type Server

type Server interface {
	State() string
	Leader() string
	CommitIndex() uint64
	Term() uint64
	PeerURL(string) (string, bool)
	ClientURL(string) (string, bool)
	Store() store.Store
	Dispatch(raft.Command, http.ResponseWriter, *http.Request) error
}

The Server interface provides all the methods required for the v2 API.