state

package
v0.0.0-...-858e4a7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conflict

func Conflict(gamma *Command, delta *Command) bool

func ConflictBatch

func ConflictBatch(batch1 []Command, batch2 []Command) bool

func IsRead

func IsRead(command *Command) bool

func KeyComparator

func KeyComparator(a, b interface{}) int

Types

type Command

type Command struct {
	Op Operation
	K  Key
	V  Value
}

func NOOP

func NOOP() []Command

func (*Command) Execute

func (c *Command) Execute(st *State) Value

func (*Command) Marshal

func (t *Command) Marshal(w io.Writer)

func (*Command) String

func (t *Command) String() string

func (*Command) Unmarshal

func (t *Command) Unmarshal(r io.Reader) error

type Key

type Key int64

func (*Key) Marshal

func (t *Key) Marshal(w io.Writer)

func (*Key) String

func (t *Key) String() string

func (*Key) Unmarshal

func (t *Key) Unmarshal(r io.Reader) error

type Operation

type Operation uint8
const (
	NONE Operation = iota
	PUT
	GET
	SCAN
)

func (*Operation) Marshal

func (t *Operation) Marshal(w io.Writer)

func (*Operation) Unmarshal

func (t *Operation) Unmarshal(r io.Reader) error

type State

type State struct {
	Store *treemap.Map
	// contains filtered or unexported fields
}

func InitState

func InitState() *State

type Value

type Value []byte

func NIL

func NIL() Value

func (*Value) Marshal

func (t *Value) Marshal(w io.Writer)

func (*Value) String

func (t *Value) String() string

func (*Value) Unmarshal

func (t *Value) Unmarshal(r io.Reader) error

Jump to

Keyboard shortcuts

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