Documentation
¶
Overview ¶
Package gitrepository provides domain-specific, field-level caching for GitRepository resources. GitRepositoryCache embeds cache.ObjectCache and adds typed Set* / Get* helpers for each resolved spec field (provider, hookUrl, repository, webhooks), plus PublishResolved, which projects a *gitrepositoryResolution.ResolvedGitRepository into those fields — hookUrl and webhooks only when resolution actually populated them.
Index ¶
- type GitRepositoryCache
- func (g *GitRepositoryCache) GetHookURL(ctx context.Context, nn types.NamespacedName, gen int64, name string) (string, bool, error)
- func (g *GitRepositoryCache) GetProvider(ctx context.Context, nn types.NamespacedName, gen int64, name string) (string, bool, error)
- func (g *GitRepositoryCache) GetRepository(ctx context.Context, nn types.NamespacedName, gen int64, name string, into any) (bool, error)
- func (g *GitRepositoryCache) GetWebhooks(ctx context.Context, nn types.NamespacedName, gen int64, name string, into any) (bool, error)
- func (g *GitRepositoryCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, ...) error
- func (g *GitRepositoryCache) SetHookURL(ctx context.Context, nn types.NamespacedName, gen int64, name string, ...) error
- func (g *GitRepositoryCache) SetProvider(ctx context.Context, nn types.NamespacedName, gen int64, name string, ...) error
- func (g *GitRepositoryCache) SetRepository(ctx context.Context, nn types.NamespacedName, gen int64, name string, repo any) error
- func (g *GitRepositoryCache) SetWebhooks(ctx context.Context, nn types.NamespacedName, gen int64, name string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitRepositoryCache ¶
type GitRepositoryCache struct {
*bocache.ObjectCache
}
GitRepositoryCache provides domain-specific, field-level caching for GitRepository resources.
func NewGitRepositoryCache ¶
func NewGitRepositoryCache(c *cache.Cache) *GitRepositoryCache
NewGitRepositoryCache constructs a new GitRepositoryCache with the provided cache.Cache.
func (*GitRepositoryCache) GetHookURL ¶
func (g *GitRepositoryCache) GetHookURL(ctx context.Context, nn types.NamespacedName, gen int64, name string) (string, bool, error)
func (*GitRepositoryCache) GetProvider ¶
func (g *GitRepositoryCache) GetProvider(ctx context.Context, nn types.NamespacedName, gen int64, name string) (string, bool, error)
func (*GitRepositoryCache) GetRepository ¶
func (g *GitRepositoryCache) GetRepository(ctx context.Context, nn types.NamespacedName, gen int64, name string, into any) (bool, error)
func (*GitRepositoryCache) GetWebhooks ¶
func (g *GitRepositoryCache) GetWebhooks(ctx context.Context, nn types.NamespacedName, gen int64, name string, into any) (bool, error)
func (*GitRepositoryCache) PublishResolved ¶
func (g *GitRepositoryCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, r *gitrepositoryResolution.ResolvedGitRepository) error
PublishResolved writes the resolved repository 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 (*GitRepositoryCache) SetHookURL ¶
func (g *GitRepositoryCache) SetHookURL(ctx context.Context, nn types.NamespacedName, gen int64, name string, url string) error
func (*GitRepositoryCache) SetProvider ¶
func (g *GitRepositoryCache) SetProvider(ctx context.Context, nn types.NamespacedName, gen int64, name string, provider string) error
func (*GitRepositoryCache) SetRepository ¶
func (g *GitRepositoryCache) SetRepository(ctx context.Context, nn types.NamespacedName, gen int64, name string, repo any) error
func (*GitRepositoryCache) SetWebhooks ¶
func (g *GitRepositoryCache) SetWebhooks(ctx context.Context, nn types.NamespacedName, gen int64, name string, webhooks any) error