memorystore

package
v29.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Options) (credentials.Store, error)

New creates a new in memory credential store

Types

type Config

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

func (*Config) Erase

func (e *Config) Erase(serverAddress string) error

func (*Config) Get

func (e *Config) Get(serverAddress string) (types.AuthConfig, error)

func (*Config) GetAll

func (e *Config) GetAll() (map[string]types.AuthConfig, error)

func (*Config) Store

func (e *Config) Store(authConfig types.AuthConfig) error

type Options

type Options func(*Config) error

func WithAuthConfig

func WithAuthConfig(config map[string]types.AuthConfig) Options

WithAuthConfig allows to set the initial credentials in the memory store.

func WithFallbackStore

func WithFallbackStore(store credentials.Store) Options

WithFallbackStore sets a fallback store.

Write operations will be performed on both the memory store and the fallback store.

Read operations will first check the memory store, and if the credential is not found, it will then check the fallback store.

Retrieving all credentials will return from both the memory store and the fallback store, merging the results from both stores into a single map.

Data stored in the memory store will take precedence over data in the fallback store.

Jump to

Keyboard shortcuts

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