sharding

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const EntryIDHexStringLen = TreeIDHexStringLen + UUIDHexStringLen
View Source
const TreeIDHexStringLen = 16
View Source
const UUIDHexStringLen = 64

Variables

This section is empty.

Functions

func GetUUIDFromIDString

func GetUUIDFromIDString(id string) (string, error)

Returns UUID (with no prepended TreeID) from a UUID or EntryID string

func PadToTreeIDLen

func PadToTreeIDLen(t string) (string, error)

Types

type EntryID

type EntryID struct {
	TreeID string
	UUID   string
}

func CreateEntryIDFromParts

func CreateEntryIDFromParts(treeid string, uuid string) (EntryID, error)

This function can take a TreeID of equal or greater length than TreeIDHexStringLen. In case the TreeID length is less than TreeIDHexStringLen, it will be padded to the correct length.

func CreateEntryIDWithActiveTreeID

func CreateEntryIDWithActiveTreeID(uuid string) (EntryID, error)

func (EntryID) ReturnEntryIDString

func (e EntryID) ReturnEntryIDString() string

type LogRange

type LogRange struct {
	TreeID     uint64
	TreeLength uint64
}

type LogRanges

type LogRanges struct {
	Ranges []LogRange
}

func (*LogRanges) ActiveIndex

func (l *LogRanges) ActiveIndex() uint64

ActiveIndex returns the active shard index, always the last shard in the range

func (*LogRanges) ResolveVirtualIndex

func (l *LogRanges) ResolveVirtualIndex(index int) (uint64, uint64)

Jump to

Keyboard shortcuts

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