kvs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "duration_seconds",
			Help:      "The index operation durations in seconds.",
		},
		[]string{
			"func",
		},
	)
	OperationsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "operations_total",
			Help:      "The number of index operations.",
		},
		[]string{
			"func",
		},
	)
)

Functions

func RecordMetrics

func RecordMetrics(start time.Time, funcName string)

Types

type Client

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

func NewClient

func NewClient(address string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Delete

func (c *Client) Delete(req *kvs.DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*Client) Get

func (c *Client) Get(req *kvs.GetRequest, opts ...grpc.CallOption) (*kvs.GetResponse, error)

func (*Client) Join

func (c *Client) Join(req *raft.JoinRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*Client) Leave

func (c *Client) Leave(req *raft.LeaveRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*Client) Put

func (c *Client) Put(req *kvs.PutRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*Client) Snapshot

func (c *Client) Snapshot(opts ...grpc.CallOption) (*empty.Empty, error)

type RootHandler

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

func NewRootHandler

func NewRootHandler(logger *log.Logger) *RootHandler

func (*RootHandler) ServeHTTP

func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server

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

func NewServer

func NewServer(nodeId string, bindAddr string, grpcAddr string, httpAddr string, dataDir string, joinAddr string, logger *log.Logger, httpLogger *log.Logger) *Server

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

type Service

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

func NewService

func NewService(store *store.KeyValueStore, logger *log.Logger) (*Service, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *kvs.DeleteRequest) (*empty.Empty, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, req *kvs.GetRequest) (*kvs.GetResponse, error)

func (*Service) Join

func (s *Service) Join(ctx context.Context, req *raft.JoinRequest) (*empty.Empty, error)

func (*Service) Leave

func (s *Service) Leave(ctx context.Context, req *raft.LeaveRequest) (*empty.Empty, error)

func (*Service) Put

func (s *Service) Put(ctx context.Context, req *kvs.PutRequest) (*empty.Empty, error)

func (*Service) Snapshot

func (s *Service) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error)

Jump to

Keyboard shortcuts

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