Documentation
¶
Overview ¶
Package cache provides secret caching functionality using the system keyring. Secrets are cached with a configurable TTL to reduce API calls to providers.
Index ¶
- Constants
- func GenerateCacheKey(providerID string, kind string, config map[string]interface{}) string
- type Cache
- func (c *Cache) CleanExpired() error
- func (c *Cache) Clear() error
- func (c *Cache) ClearProvider(cacheKey string) error
- func (c *Cache) Get(cacheKey string) (map[string]string, bool)
- func (c *Cache) GetTTL() time.Duration
- func (c *Cache) IsAvailable() bool
- func (c *Cache) Set(cacheKey string, secrets map[string]string) error
- func (c *Cache) Stats() (total int, valid int, expired int)
- type CacheStore
- type CachedSecrets
- type Option
Constants ¶
View Source
const ( // KeyringService is the service name used for keyring storage KeyringService = "sstart-cache" // DefaultTTL is the default cache TTL (5 minutes) DefaultTTL = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides caching functionality for secrets
func (*Cache) CleanExpired ¶
CleanExpired removes all expired cache entries
func (*Cache) ClearProvider ¶
ClearProvider removes cached secrets for a specific provider
func (*Cache) IsAvailable ¶
IsAvailable returns whether the cache backend (keyring) is available
type CacheStore ¶
type CacheStore struct {
Providers map[string]*CachedSecrets `json:"providers"`
}
CacheStore represents the entire cache storage
Click to show internal directories.
Click to hide internal directories.