dataapi

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCatalog

func BuildCatalog(st StateReaderInterface, linkObj link.Obj) api.CatalogObj

BuildCatalog maps the state key snapshot into the catalog schema without storage reads. Each key URL points to its release list.

func BuildReleaseDetail

func BuildReleaseDetail(ctx context.Context, store DetailReaderInterface, st StateReaderInterface, key string, version string, linkObj link.Obj) (api.ReleaseDetailObj, bool, error)

BuildReleaseDetail builds version release_detail from metadata, detection, artifacts, and source. found=false means the version is absent; storage errors pass through unchanged.

func BuildReleaseList

func BuildReleaseList(ctx context.Context, store VersionReaderInterface, st StateReaderInterface, key string, afterCursor string, pageSize int, linkObj link.Obj) (api.ReleaseListObj, error)

BuildReleaseList builds a lightweight newest-first release list with keyset pagination and no OFFSET. It requests pageSize+1 rows to detect the next page; unknown empty first pages return not found.

func OpenArtifact

func OpenArtifact(ctx context.Context, store ArtifactReaderInterface, overlayObj *overlay.Obj, keyObj core.ArtifactKeyObj) (artifactio.OpenObj, error)

OpenArtifact opens the raw universal archive for streaming, reusing an artifact key already resolved by the archive route so a full GET does not re-query GetArtifact.

Types

type ArtifactBuilderInterface

type ArtifactBuilderInterface = storage.ArtifactBuilderInterface

ArtifactBuilderInterface and HotFileObj are storage aliases for artifact builders and disk streaming.

type ArtifactReaderInterface

type ArtifactReaderInterface interface {
	GetVersion(ctx context.Context, key string, version string) (core.VersionObj, bool, error)
	GetDetection(ctx context.Context, key string, version string) (core.DetectionObj, bool, error)
	RewriteSet(ctx context.Context, key string, version string) ([]core.HashObj, error)
	GetArtifact(ctx context.Context, keyObj core.ArtifactKeyObj) (core.ArtifactObj, bool, error)
	EnsureArtifactFile(ctx context.Context, keyObj core.ArtifactKeyObj, builderObj ArtifactBuilderInterface) (*HotFileObj, error)
	ReadTree(ctx context.Context, treeHashObj core.HashObj) ([]core.TreeEntryObj, error)
	ReadBlob(ctx context.Context, hashObj core.HashObj) ([]byte, error)
}

ArtifactReaderInterface materializes and locates canonical archives. ReadTree and ReadBlob are also used by overlay builders; GetArtifact and EnsureArtifactFile satisfy artifactio.StoreInterface.

type DetailReaderInterface

type DetailReaderInterface interface {
	GetVersion(ctx context.Context, key string, version string) (core.VersionObj, bool, error)
	GetDetection(ctx context.Context, key string, version string) (core.DetectionObj, bool, error)
	ListArtifacts(ctx context.Context, key string, version string) ([]core.ArtifactObj, error)
}

DetailReaderInterface reads release-detail data: version, detection, and artifacts.

type HotFileObj

type HotFileObj = storage.HotFileObj

ArtifactBuilderInterface and HotFileObj are storage aliases for artifact builders and disk streaming.

type StateReaderInterface

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

StateReaderInterface is the minimal state surface for data APIs.

type VersionReaderInterface

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

VersionReaderInterface provides keyset access for paginated release lists.

Jump to

Keyboard shortcuts

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