packages

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package packages provides domain-specific, field-level caching for Package resources. PackageCache embeds cache.ObjectCache and adds typed Set* / Get* helpers for each resolved spec field (version, packageRepository, stateRepo, kappDiff, enabled), plus a checksum field that the service layer writes separately after package content is fetched and verified — not part of PublishResolved, which only projects the resolved spec (version, enabled, packageRepository) right after resolution succeeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageCache

type PackageCache struct {
	*bocache.ObjectCache
}

PackageCache provides domain-specific, field-level caching for Package resources.

func NewPackageCache

func NewPackageCache(c *cache.Cache) *PackageCache

NewPackageCache constructs a new PackageCache with the provided cache.Cache.

func (*PackageCache) GetChecksum

func (p *PackageCache) GetChecksum(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*PackageCache) GetKappDiff

func (p *PackageCache) GetKappDiff(ctx context.Context, nn types.NamespacedName, gen int64) (bool, bool, error)

func (*PackageCache) GetPackageRepository

func (p *PackageCache) GetPackageRepository(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)

func (*PackageCache) GetStateRepo

func (p *PackageCache) GetStateRepo(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)

func (*PackageCache) GetVersion

func (p *PackageCache) GetVersion(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*PackageCache) PublishResolved

PublishResolved writes the resolved package contract as a generation-scoped, field-level projection. All writes are best-effort: failures cost queryability, never correctness. Returns the first error encountered for optional logging; callers should not fail reconciliation on it.

func (*PackageCache) SetChecksum

func (p *PackageCache) SetChecksum(ctx context.Context, nn types.NamespacedName, gen int64, checksum string) error

func (*PackageCache) SetKappDiff

func (p *PackageCache) SetKappDiff(ctx context.Context, nn types.NamespacedName, gen int64, enabled bool) error

func (*PackageCache) SetPackageRepository

func (p *PackageCache) SetPackageRepository(ctx context.Context, nn types.NamespacedName, gen int64, repo any) error

func (*PackageCache) SetStateRepo

func (p *PackageCache) SetStateRepo(ctx context.Context, nn types.NamespacedName, gen int64, stateRepo any) error

func (*PackageCache) SetVersion

func (p *PackageCache) SetVersion(ctx context.Context, nn types.NamespacedName, gen int64, version string) error

Jump to

Keyboard shortcuts

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