cache

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSecureBackend = errors.New("no secure credential cache backend available")

Functions

func BuildKey

func BuildKey(vaultAddr, namespace, mount, role, credentialType, ttl string) string

Types

type Backend

type Backend interface {
	Name() string
	Get(key string) (string, error)
	Set(key, value string) error
	Keys() ([]string, error)
	Remove(key string) error
}

type CachedCredentials

type CachedCredentials struct {
	AccessKeyID     string  `json:"access_key_id"`
	SecretAccessKey string  `json:"secret_access_key"`
	SessionToken    string  `json:"session_token,omitempty"`
	Expiration      *string `json:"expiration,omitempty"`
}

type Entry

type Entry struct {
	Key        string
	AccessKey  string
	Expiration *time.Time
	Expired    bool
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewDefaultStore

func NewDefaultStore() (*Store, error)

func NewStore

func NewStore(backend Backend) *Store

func (*Store) Delete

func (s *Store) Delete(key string) error

func (*Store) ListEntries

func (s *Store) ListEntries() ([]Entry, error)

func (*Store) Load

func (s *Store) Load(key string) (CachedCredentials, bool, error)

func (*Store) PurgeAll

func (s *Store) PurgeAll() (int, error)

func (*Store) PurgeExpired

func (s *Store) PurgeExpired() (int, error)

func (*Store) PurgeKeys

func (s *Store) PurgeKeys(keys []string) (int, error)

func (*Store) Save

func (s *Store) Save(key string, creds CachedCredentials) error

Jump to

Keyboard shortcuts

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