serial

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Len = 8

Variables

This section is empty.

Functions

func Make

func Make(s uint64) (ser by)

func Match

func Match(index, ser by) bo

Match compares a key bytes to a serial, all indexes have the serial at the end indicating the event record they refer to, and if they match returns true.

Types

type T

type T struct {
	Val by
}

T is a badger DB serial number used for conflict free event record keys.

func FromKey

func FromKey(k by) (p *T)

FromKey expects the last Len bytes of the given slice to be the serial.

func New

func New(ser by) (p *T)

New returns a new serial record key.Element - if nil or short slice is given, initialize a fresh one with Len (for reading), otherwise if equal or longer, trim if long and store into struct (for writing).

func (*T) Len

func (p *T) Len() no

func (*T) Read

func (p *T) Read(buf *bytes.Buffer) (el keys.Element)

func (*T) Uint64

func (p *T) Uint64() (u uint64)

func (*T) Write

func (p *T) Write(buf *bytes.Buffer)

Jump to

Keyboard shortcuts

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