data

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package data defines common data types for transaction identifiers and related operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxID

type TxID []byte

TxID represents a transaction id.

func NewTId

func NewTId() TxID

NewTId generates a new random 128-bit transaction ID.

func (TxID) Equal

func (t TxID) Equal(other TxID) bool

Equal reports whether t and other are the same transaction ID.

func (TxID) String

func (t TxID) String() string

type TxIDSet

type TxIDSet []TxID

TxIDSet is a set of transaction IDs optimized for small sizes.

func NewTxIDSet

func NewTxIDSet(ids ...TxID) TxIDSet

NewTxIDSet creates a TxIDSet containing the given transaction IDs, deduplicating any repeats.

func TxIDSetDiff

func TxIDSetDiff(a, b TxIDSet) TxIDSet

TxIDSetDiff is a set difference between a and b. It returns a new set where all elements of b have been removed from a.

func TxIDSetIntersect

func TxIDSetIntersect(a, b TxIDSet) TxIDSet

TxIDSetIntersect is a set intersection between a and b. It returns a new set with only elements common between a and b.

func TxIDSetUnion

func TxIDSetUnion(a, b TxIDSet) TxIDSet

TxIDSetUnion returns a new set with the elements of both a and b.

func (TxIDSet) Add

func (s TxIDSet) Add(a TxID) (TxIDSet, bool)

Add inserts a transaction ID into the set, returning the updated set and whether it was added.

func (TxIDSet) AddMulti

func (s TxIDSet) AddMulti(ids ...TxID) TxIDSet

AddMulti inserts multiple transaction IDs into the set, deduplicating any repeats.

func (TxIDSet) Contains

func (s TxIDSet) Contains(a TxID) bool

Contains reports whether the set contains the given transaction ID.

func (TxIDSet) IndexOf

func (s TxIDSet) IndexOf(a TxID) int

IndexOf returns the index of the given transaction ID in the set, or -1 if not found.

Directories

Path Synopsis
Package paths encodes and decodes storage paths for database objects.
Package paths encodes and decodes storage paths for database objects.

Jump to

Keyboard shortcuts

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