Documentation
¶
Index ¶
- func BuildLatest(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, ...) ([]byte, error)
- func BuildList(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, ...) ([]byte, error)
- func BuildListFull(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, ...) ([]byte, error)
- type StateReaderInterface
- type VersionReaderInterface
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.