bootstrap

package
v0.0.0-...-2e7796a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetRequestType = iota + 1
	PutRequestType
)
View Source
const (
	GetResponseType = iota + 1
	PutResponseType
)

Variables

This section is empty.

Functions

func ResetClientFailureDetector

func ResetClientFailureDetector()

Types

type Client

type Client struct {
	Id     int
	Config configs.Root
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientId int, c configs.Root) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Run

func (c *Client) Run(reqCh chan Request, respCh chan Response) error

type GetRequest

type GetRequest struct {
	Key string
}

func (GetRequest) String

func (r GetRequest) String() string

func (GetRequest) Type

func (r GetRequest) Type() RequestType

type PutRequest

type PutRequest struct {
	Key   string
	Value string
}

func (PutRequest) String

func (r PutRequest) String() string

func (PutRequest) Type

func (r PutRequest) Type() RequestType

type Request

type Request interface {
	Type() RequestType
	String() string
}

type RequestType

type RequestType int

type Response

type Response struct {
	Index int
	OK    bool
	Key   string
	Value string
	// contains filtered or unexported fields
}

func (Response) Type

func (r Response) Type() ResponseType

type ResponseType

type ResponseType int

type Server

type Server struct {
	Id     int
	Config configs.Root
	// contains filtered or unexported fields
}

func NewServer

func NewServer(srvId int, c configs.Root, db *badger.DB) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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