serviceunit

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package serviceunit provides domain-specific, field-level caching for ServiceUnit resources. ServiceUnitCache embeds cache.ObjectCache and adds typed Set* / Get* helpers for each resolved spec field (type, image, buildRef, containerPort, size, appType, stackType), plus PublishResolved, which projects a *serviceunitResolution.ResolvedServiceUnit into those fields. image and buildRef are type-discriminated: a ServiceUnit is either type: static (image) or type: build (buildRef), and PublishResolved caches exactly one of the pair based on the resolved spec's Type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceUnitCache

type ServiceUnitCache struct {
	*bocache.ObjectCache
}

ServiceUnitCache provides domain-specific, field-level caching for ServiceUnit resources.

func NewServiceUnitCache

func NewServiceUnitCache(c *cache.Cache) *ServiceUnitCache

NewServiceUnitCache constructs a new ServiceUnitCache with the provided cache.Cache.

func (*ServiceUnitCache) GetAppType

func (s *ServiceUnitCache) GetAppType(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*ServiceUnitCache) GetBuildRef

func (s *ServiceUnitCache) GetBuildRef(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)

func (*ServiceUnitCache) GetContainerPort

func (s *ServiceUnitCache) GetContainerPort(ctx context.Context, nn types.NamespacedName, gen int64) (int, bool, error)

func (*ServiceUnitCache) GetImage

func (s *ServiceUnitCache) GetImage(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*ServiceUnitCache) GetSize

func (s *ServiceUnitCache) GetSize(ctx context.Context, nn types.NamespacedName, gen int64) (int, bool, error)

func (*ServiceUnitCache) GetStackType

func (s *ServiceUnitCache) GetStackType(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*ServiceUnitCache) GetType

func (s *ServiceUnitCache) GetType(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)

func (*ServiceUnitCache) PublishResolved

PublishResolved writes the resolved service unit contract as a generation-scoped, field-level projection. The image/buildRef pair is type-discriminated: exactly one is published per the unit's type. 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 (*ServiceUnitCache) SetAppType

func (s *ServiceUnitCache) SetAppType(ctx context.Context, nn types.NamespacedName, gen int64, appType string) error

func (*ServiceUnitCache) SetBuildRef

func (s *ServiceUnitCache) SetBuildRef(ctx context.Context, nn types.NamespacedName, gen int64, buildRef any) error

func (*ServiceUnitCache) SetContainerPort

func (s *ServiceUnitCache) SetContainerPort(ctx context.Context, nn types.NamespacedName, gen int64, port int) error

func (*ServiceUnitCache) SetImage

func (s *ServiceUnitCache) SetImage(ctx context.Context, nn types.NamespacedName, gen int64, image string) error

func (*ServiceUnitCache) SetSize

func (s *ServiceUnitCache) SetSize(ctx context.Context, nn types.NamespacedName, gen int64, size int) error

func (*ServiceUnitCache) SetStackType

func (s *ServiceUnitCache) SetStackType(ctx context.Context, nn types.NamespacedName, gen int64, stackType string) error

func (*ServiceUnitCache) SetType

func (s *ServiceUnitCache) SetType(ctx context.Context, nn types.NamespacedName, gen int64, typ string) error

Jump to

Keyboard shortcuts

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