record

package
v0.0.0-...-7d60247 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchUpdateRequest

type BatchUpdateRequest struct {
	Elements []Element

	Responder chan<- UpdateResponse
}

func (BatchUpdateRequest) IsMessage

func (BatchUpdateRequest) IsMessage()

type DeleteRequest

type DeleteRequest struct {
	Key string

	Responder chan<- UpdateResponse
}

func (DeleteRequest) IsMessage

func (DeleteRequest) IsMessage()

type Element

type Element struct {
	Key   string
	Value interface{}
}

type GetRequest

type GetRequest struct {
	Version uint64
	Key     string

	Responder chan<- GetResponse
}

func (GetRequest) IsMessage

func (GetRequest) IsMessage()

type GetResponse

type GetResponse struct {
	Element
	Ok bool
}

type Record

type Record struct {
	CurrentVersion uint64
	Nodes          node.Nodes
	// contains filtered or unexported fields
}

Record is a Persistent Map

func New

func New() *Record

func (*Record) BatchUpdate

func (record *Record) BatchUpdate(updates map[string]interface{}) (uint64, error)

func (*Record) Delete

func (record *Record) Delete(key string) (uint64, error)

func (*Record) Get

func (record *Record) Get(ver uint64, key string) (interface{}, bool)

func (*Record) MarshalBinary

func (record *Record) MarshalBinary() ([]byte, error)

func (*Record) Restore

func (record *Record) Restore(table kv.Table) error

func (*Record) Snapshot

func (record *Record) Snapshot(version uint64) Snapshot

func (*Record) Store

func (record *Record) Store(table kv.Table) error

func (*Record) StoreSingle

func (record *Record) StoreSingle(key string, table kv.Table) error

func (*Record) UnmarshalBinary

func (record *Record) UnmarshalBinary(data []byte) error

func (*Record) Update

func (record *Record) Update(key string, value interface{}) (uint64, error)

type Snapshot

type Snapshot map[string]interface{}

type SnapshotRequest

type SnapshotRequest struct {
	Version uint64

	Responder chan<- Snapshot
}

func (SnapshotRequest) IsMessage

func (SnapshotRequest) IsMessage()

type Store

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

func NewStore

func NewStore(table kv.Table) *Store

func (*Store) Handle

func (store *Store) Handle(_ phi.Task, msg phi.Message)

type UpdateRequest

type UpdateRequest struct {
	Element

	Responder chan<- UpdateResponse
}

func (UpdateRequest) IsMessage

func (UpdateRequest) IsMessage()

type UpdateResponse

type UpdateResponse struct {
	Version uint64
	Err     error
}

Jump to

Keyboard shortcuts

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