service

package
v0.0.0-...-42f29b8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCService

type GRPCService struct {
	pb.UnimplementedExampleServer
	// contains filtered or unexported fields
}

func NewGrpcService

func NewGrpcService(fsm *fsm.StateMachine, kv KV) *GRPCService

func (*GRPCService) Add

func (r *GRPCService) Add(ctx context.Context, req *pb.AddRequest) (*pb.AddResponse, error)

func (*GRPCService) Get

func (r *GRPCService) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error)

func (*GRPCService) Stat

func (r *GRPCService) Stat(ctx context.Context, req *pb.StatRequest) (*pb.StatResponse, error)

type KV

type KV interface {
	Apply(ctx context.Context, key, val string) (uint64, error)
	Query(ctx context.Context, key []byte, consistent bool) (uint64, []byte, error)
	Stats() (map[string]any, error)
	GetLeader() (bool, raft.ServerAddress, error)
}

Jump to

Keyboard shortcuts

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