cache

package
v5.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package cache provides a per-pipeline caching decorator for secret providers.

Index

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

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) Close

func (p *ProviderPool) Close()

Close closes all providers in the 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.

Jump to

Keyboard shortcuts

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