mirror

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLatest

func BuildLatest(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, key string) ([]byte, error)

BuildLatest returns `/{key}/latest`, preferring in-memory KeyState.LatestVersion. Storage is the fallback; unknown keys without versions return serr.ErrNotFound.

func BuildList

func BuildList(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, key string) ([]byte, error)

BuildList returns `/{key}/list` as newest-first text with one version per line. It builds in RAM with a version cap; unknown keys with zero versions return serr.ErrNotFound.

func BuildListFull

func BuildListFull(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, key string) ([]byte, error)

BuildListFull returns `/{key}/list/full` as a newest-first JSON array of version_full_entry objects. It streams directly into the jx encoder; unknown keys with zero versions return serr.ErrNotFound.

Types

type StateReaderInterface

type StateReaderInterface interface {
	KeyState(key string) (state.KeyStateObj, bool)
}

StateReaderInterface reads per-key state for authoritative latest version and key existence.

type VersionReaderInterface

type VersionReaderInterface interface {
	LatestVersion(ctx context.Context, key string) (core.VersionObj, bool, error)
	ListVersionsKeyset(ctx context.Context, key string, includeDeleted bool, afterSeq int64, afterVersion string, limit int) ([]core.VersionObj, error)
}

VersionReaderInterface provides latest and keyset access to versions.

Jump to

Keyboard shortcuts

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