service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 24 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 gRPC invocation durations in seconds.",
		},
		[]string{
			"func",
		},
	)

	RequestsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "requests_total",
			Help:      "The number of gRPC requests.",
		},
		[]string{
			"func",
		},
	)
)

Functions

func Metrics

func Metrics(start time.Time, funcName string) error

Types

type KVSService

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

func NewKVSService

func NewKVSService(peerAddress string, raftConfig *braft.RaftConfig, bootstrap bool, storeConfig *boltdb.StoreConfig, indexConfig *bleve.IndexConfig) (*KVSService, error)

func (*KVSService) Bulk

func (*KVSService) Delete

func (*KVSService) DeleteMetadata

func (s *KVSService) DeleteMetadata(req *protobuf.LeaveRequest) error

func (*KVSService) Get

func (*KVSService) GetMetadata

func (s *KVSService) GetMetadata(id string) (*protobuf.Metadata, error)

func (*KVSService) Join

func (*KVSService) LeaderID

func (s *KVSService) LeaderID() (string, error)

func (*KVSService) Leave

func (*KVSService) Peers

func (s *KVSService) Peers(ctx context.Context, req *empty.Empty) (*protobuf.PeersResponse, error)

func (*KVSService) Put

func (*KVSService) PutMetadata

func (s *KVSService) PutMetadata(req *protobuf.JoinRequest) error

func (*KVSService) Search

func (*KVSService) SetLogger

func (s *KVSService) SetLogger(logger *log.Logger)

func (*KVSService) Snapshot

func (s *KVSService) Snapshot(ctx context.Context, req *empty.Empty) (*protobuf.SnapshotResponse, error)

func (*KVSService) Start

func (s *KVSService) Start() error

func (*KVSService) Stop

func (s *KVSService) Stop() error

func (*KVSService) WaitForLeader

func (s *KVSService) WaitForLeader(timeout time.Duration) (string, error)

Jump to

Keyboard shortcuts

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