replica

package
v0.0.0-...-d00d6e8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replica

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

func NewReplica

func NewReplica(pid int, storage *storage.InMemory) *Replica

func (*Replica) Accept

func (r *Replica) Accept(
	sender int,
	request *rpc.AcceptRequest,
) (*rpc.AcceptResponse, error)

func (*Replica) Apply

func (r *Replica) Apply(
	sender int,
	request *rpc.ApplyRequest,
) error

func (*Replica) Commit

func (r *Replica) Commit(
	sender int,
	request *rpc.CommitRequest,
) error

func (*Replica) Pid

func (r *Replica) Pid() int

func (*Replica) PreAccept

func (r *Replica) PreAccept(
	sender int,
	request *rpc.PreAcceptRequest,
) (*rpc.PreAcceptResponse, error)

func (*Replica) Read

func (r *Replica) Read(
	sender int,
	request *rpc.ReadRequest,
) (map[string]string, error)

func (*Replica) Snapshot

func (r *Replica) Snapshot() (map[string]string, error)

type State

type State int
const (
	StateRunning State = iota
	StatePaused
	StateStopped
)

Jump to

Keyboard shortcuts

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