key_builder

package
v1.4.10 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConsumptionKey added in v1.3.2

func ParseConsumptionKey(prefix, key []byte) (time.Time, uuid.UUID, bool)

ParseConsumptionKey parses a consumption key that starts with the provided prefix and returns the timestamp and teaID encoded in the key. It returns ok=false if the key does not match the prefix or has insufficient length.

Types

type Builder

type Builder interface {
	Version() []byte
	Records() []byte
	Record(id uuid.UUID) []byte
	RecordsByName(name string) []byte
	QR(id uuid.UUID) []byte
	TagCategories() []byte
	TagCategory(id uuid.UUID) []byte
	TagCategoryByName(name string) []byte
	Tags() []byte
	Tag(id uuid.UUID) []byte
	TagsByName(name string) []byte
	TagsByNameAndCategory(category uuid.UUID, name string) []byte
	TagsByCategory(category uuid.UUID) []byte
	TagsByTea(tea uuid.UUID) []byte
	TeasByTag(tag uuid.UUID) []byte
	TagTeaPair(tag, tea uuid.UUID) []byte
	TeaTagPair(tea, tag uuid.UUID) []byte
	Collection(id, userID uuid.UUID) []byte
	UserCollections(id uuid.UUID) []byte
	CollectionsTeas(id, teaID uuid.UUID) []byte
	RecordsByCollection(id uuid.UUID) []byte
	Users() []byte
	User(id uuid.UUID) []byte
	UserByAppleID(id string) []byte
	Device(id uuid.UUID) []byte
	DevicesByUserID(id uuid.UUID) []byte
	Notification(id uuid.UUID) []byte
	NotificationByUserID(id uuid.UUID) []byte
	ConsumptionByUserID(id uuid.UUID) []byte
	ConsumptionKey(userID uuid.UUID, ts time.Time, teaID uuid.UUID) []byte
}

Builder constructs byte-encoded keys for the FoundationDB keyspace. It centralizes key layouts to keep them consistent across the codebase. The returned slices are suitable for direct use with FDB APIs.

func NewBuilder

func NewBuilder() Builder

Jump to

Keyboard shortcuts

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