mvcc

package
v0.0.0-...-8b180c2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiValue

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

MultiValue represents multiple values with at versions in sorted order.

func Append

func Append(mv *MultiValue, v *Value) *MultiValue

Append returns a copy of the input multi-value with a newer version to end. Version of the appending value *must* be larger than all existing versions.

func Compact

func Compact(mv *MultiValue, minVersion int64) *MultiValue

Compact drops older data before the given version unless it is not the only version and is not deleted. Returns the same input multi-value if no compaction can be performed; otherwise, returns a clone of the input multi-value.

func NewMultiValue

func NewMultiValue(v *Value) *MultiValue

NewMultiValue creates a multi-value with initial version.

func (*MultiValue) Fetch

func (mv *MultiValue) Fetch(version int64) (v *Value, found bool)

Fetch returns the value found at the given version or the closest lower version to the given version. Returned value can be a deleted value.

func (*MultiValue) String

func (mv *MultiValue) String() string

String returns the MultiValue as a human-readable string.

type Value

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

func NewValue

func NewValue(ver int64) *Value

NewValue creates a value with given version. Input byte slice should not be modified any further.

func (*Value) Clone

func (v *Value) Clone(ver int64) *Value

func (*Value) Data

func (v *Value) Data() string

func (*Value) Delete

func (v *Value) Delete()

func (*Value) IsDeleted

func (v *Value) IsDeleted() bool

func (*Value) SetData

func (v *Value) SetData(data string)

func (*Value) String

func (v *Value) String() string

func (*Value) Version

func (v *Value) Version() int64

Jump to

Keyboard shortcuts

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