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 ¶
- type PackageCache
- func (p *PackageCache) GetChecksum(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)
- func (p *PackageCache) GetKappDiff(ctx context.Context, nn types.NamespacedName, gen int64) (bool, bool, error)
- func (p *PackageCache) GetPackageRepository(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (p *PackageCache) GetStateRepo(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (p *PackageCache) GetVersion(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)
- func (p *PackageCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, ...) error
- func (p *PackageCache) SetChecksum(ctx context.Context, nn types.NamespacedName, gen int64, checksum string) error
- func (p *PackageCache) SetKappDiff(ctx context.Context, nn types.NamespacedName, gen int64, enabled bool) error
- func (p *PackageCache) SetPackageRepository(ctx context.Context, nn types.NamespacedName, gen int64, repo any) error
- func (p *PackageCache) SetStateRepo(ctx context.Context, nn types.NamespacedName, gen int64, stateRepo any) error
- func (p *PackageCache) SetVersion(ctx context.Context, nn types.NamespacedName, gen int64, version string) error
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 ¶
func (p *PackageCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, r *packagesResolution.ResolvedPackage) error
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