client

package
v0.0.0-...-6206b6d Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

type AdminClient interface {
	Consensus(db.Key) bool
	Crash(idservice.ID, int)
	Drop(idservice.ID, idservice.ID, int)
	Partition(int, ...idservice.ID)
}

AdminClient interface provides fault injection opeartion

type BasicClient

type BasicClient struct {
	ClientId        idservice.ID
	PreferredNodeId idservice.ID
	Communication   net.Communication
	// contains filtered or unexported fields
}

func NewClient

func NewClient(preferredNodeId idservice.ID, clientId idservice.ID) *BasicClient

func (*BasicClient) AddPendingChanel

func (c *BasicClient) AddPendingChanel(pending chan interface{}, cmdId int)

func (*BasicClient) Get

func (c *BasicClient) Get(k db.Key) (db.Value, error)

func (*BasicClient) HandleMsg

func (c *BasicClient) HandleMsg(msg interface{})

func (*BasicClient) NextCmdID

func (c *BasicClient) NextCmdID() int

func (*BasicClient) Put

func (c *BasicClient) Put(k db.Key, v db.Value) error

func (*BasicClient) Register

func (c *BasicClient) Register(m interface{}, f interface{})

Register a handle function for each message type

func (*BasicClient) SendCommand

func (c *BasicClient) SendCommand(cmd db.Command) net.Reply

type Client

type Client interface {
	Get(db.Key) (db.Value, error)
	//GetN(k db.Key, n int) (db.Value, error)
	Put(db.Key, db.Value) error
}

Client interface provides get and put for key value store

Jump to

Keyboard shortcuts

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