kvlib

package
v0.0.0-...-668de4a Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClockUpdateArgs

type ClockUpdateArgs struct {
	Clientid uint8  // client id issueing this put
	Clock    uint64 // value of lamport clock at the issuing client
}

args in clockupdate(args)

type DisconnectArgs

type DisconnectArgs struct {
	Clientid uint8 // client id issueing this put
}

args in disconnect(args)

type GetArgs

type GetArgs struct {
	Key      string // key to look up
	Clientid uint8  // client id issuing this get
	Clock    uint64 // value of lamport clock at the issuing client
}

args in get(args)

type KVService

type KVService struct {
	Clientid        uint8
	ClockUpdateRate uint8
	Clock           uint64
	Replicas        []*rpc.Client
	Mux             sync.Mutex
}

func Init

func Init(id uint8, updateRate uint8, addresses []string) (*KVService, error)

func (*KVService) Disconnect

func (kv *KVService) Disconnect() error

func (*KVService) Get

func (kv *KVService) Get(key string) (string, error)

func (*KVService) Put

func (kv *KVService) Put(key string, val string) error

type PutArgs

type PutArgs struct {
	Key      string // key to associate value with
	Val      string // value
	Clientid uint8  // client id issueing this put
	Clock    uint64 // value of lamport clock at the issuing client
}

args in put(args)

type ValReply

type ValReply struct {
	Val string // value; depends on the call
}

Reply from service for all the API calls above.

Jump to

Keyboard shortcuts

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