Documentation
¶
Overview ¶
Package cache provides a per-pipeline caching decorator for secret providers.
Index ¶
- type CachedProvider
- func (c *CachedProvider) Close() error
- func (c *CachedProvider) GetSecret(ctx context.Context, path, key string, version int) (string, error)
- func (c *CachedProvider) GetSecretsBatch(ctx context.Context, requests []integrations.SecretRequest) (map[string]string, error)
- func (c *CachedProvider) Stats() (hits, misses int64, size int)
- func (c *CachedProvider) TestConnection(ctx context.Context) error
- func (c *CachedProvider) Type() model.IntegrationType
- type ProviderPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedProvider ¶
type CachedProvider struct {
// contains filtered or unexported fields
}
CachedProvider wraps a Provider with per-pipeline caching. This cache is scoped to a single pipeline execution and is cleared when Close() is called.
func NewCachedProvider ¶
func NewCachedProvider(provider integrations.Provider, pipelineID int64) *CachedProvider
NewCachedProvider creates a new cached provider wrapper.
func (*CachedProvider) Close ¶
func (c *CachedProvider) Close() error
Close clears the cache and closes the underlying provider.
func (*CachedProvider) GetSecret ¶
func (c *CachedProvider) GetSecret(ctx context.Context, path, key string, version int) (string, error)
GetSecret retrieves a secret, using the cache if available.
func (*CachedProvider) GetSecretsBatch ¶
func (c *CachedProvider) GetSecretsBatch(ctx context.Context, requests []integrations.SecretRequest) (map[string]string, error)
GetSecretsBatch retrieves multiple secrets, using the cache where available.
func (*CachedProvider) Stats ¶
func (c *CachedProvider) Stats() (hits, misses int64, size int)
Stats returns cache statistics.
func (*CachedProvider) TestConnection ¶
func (c *CachedProvider) TestConnection(ctx context.Context) error
TestConnection delegates to the underlying provider.
func (*CachedProvider) Type ¶
func (c *CachedProvider) Type() model.IntegrationType
Type returns the underlying provider's type.
type ProviderPool ¶
type ProviderPool struct {
// contains filtered or unexported fields
}
ProviderPool manages cached providers per pipeline.
func NewProviderPool ¶
func NewProviderPool(factory integrations.ProviderFactory) *ProviderPool
NewProviderPool creates a new provider pool.
func (*ProviderPool) GetProvider ¶
func (p *ProviderPool) GetProvider(ctx context.Context, integration *model.Integration, pipelineID int64) (*CachedProvider, error)
GetProvider returns a cached provider for the given integration and pipeline. Creates a new provider if one doesn't exist.
func (*ProviderPool) ReleasePipeline ¶
func (p *ProviderPool) ReleasePipeline(pipelineID int64)
ReleasePipeline closes and removes all providers for a pipeline.