memory

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

README

this is a memory-based storage engine, the data will not be stored permanently

# term

### Pod
pod is the smallest storage unit of the engine

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeySum

func KeySum(key []byte) uint64

Types

type Node

type Node struct {
	Meta     *NodeMetadata
	Mappings map[uint64]*Pod
	// contains filtered or unexported fields
}

func (*Node) SetNamespace

func (n *Node) SetNamespace(namespace string)

type NodeMetadata

type NodeMetadata struct {
	NamespaceSize *uint32
	PodSize       uint64
	Namespace     *string
}

func (*NodeMetadata) SetNamespace

func (m *NodeMetadata) SetNamespace(namespace string)

type Pod

type Pod struct {
	Meta *PodMetadata
	Key  []byte
	Data []byte
}

func (*Pod) MapKey

func (p *Pod) MapKey() uint64

type PodMetadata

type PodMetadata struct {
	NamespaceSize *uint32
	KeySize       uint32
	ValueSize     uint32
	TTL           uint32
	// LastUpdated is a timestamp
	LastUpdated uint64
	Namespace   *string
	// contains filtered or unexported fields
}

func (*PodMetadata) EqualState

func (m *PodMetadata) EqualState(state PodState) bool

func (*PodMetadata) PayloadSize

func (m *PodMetadata) PayloadSize() int64

func (*PodMetadata) State

func (m *PodMetadata) State() PodState

type PodState

type PodState uint32
const (
	PodStateOk PodState = iota
)

Jump to

Keyboard shortcuts

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