pbservice

package
v0.0.0-...-6ec47af Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK             = "OK"
	ErrNoKey       = "ErrNoKey"
	ErrWrongServer = "ErrWrongServer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clerk

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

func MakeClerk

func MakeClerk(vshost string, me string) *Clerk

func (*Clerk) Append

func (ck *Clerk) Append(key string, value string)

tell the primary to append to key's value. must keep trying until it succeeds.

func (*Clerk) Get

func (ck *Clerk) Get(key string) string

fetch a key's value from the current primary; if they key has never been set, return "". Get() must keep trying until it either the primary replies with the value or the primary says the key doesn't exist (has never been Put().

func (*Clerk) Put

func (ck *Clerk) Put(key string, value string)

tell the primary to update key's value. must keep trying until it succeeds.

func (*Clerk) PutAppend

func (ck *Clerk) PutAppend(key string, value string, op string)

send a Put or Append RPC

type Err

type Err string

type GetArgs

type GetArgs struct {
	Key string
}

type GetReply

type GetReply struct {
	Err   Err
	Value string
}

type PBServer

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

func StartServer

func StartServer(vshost string, me string) *PBServer

func (*PBServer) Get

func (pb *PBServer) Get(args *GetArgs, reply *GetReply) error

func (*PBServer) PutAppend

func (pb *PBServer) PutAppend(args *PutAppendArgs, reply *PutAppendReply) error

type PutAppendArgs

type PutAppendArgs struct {
	Key   string
	Value string
}

Put or Append

type PutAppendReply

type PutAppendReply struct {
	Err Err
}

Jump to

Keyboard shortcuts

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