envvars

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleWriter

type ConsoleWriter interface {
	Info(msg ...interface{})
	Warn(msg ...interface{})
	Error(msg ...interface{})
	Debug(msg ...interface{})
}

type Encrypter

type Encrypter interface {
	Encrypt(text string) (string, error)
	Decrypt(ciphertext string) (string, error)
}

type EnvvarsBackender

type EnvvarsBackender interface {
	Getenv(key string) string
	Environ() []string
}

type EnvvarsStore

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

EnvvarsStore is a store for credentials

func NewEnvvarsStore

func NewEnvvarsStore(opts ...OptionsFunc) *EnvvarsStore

NewEnvvarsStore creates a new mocked store for credentials

func (*EnvvarsStore) All

func (s *EnvvarsStore) All() ([]*credentials.Credential, error)

All returns all credentials

func (*EnvvarsStore) Get

Get returns a auth for the credential id

func (*EnvvarsStore) Options

func (s *EnvvarsStore) Options(opts ...OptionsFunc)

Options provides the options to envvars credentials store

func (*EnvvarsStore) Store

func (s *EnvvarsStore) Store(id string, credential *credentials.Credential) error

Store stores a credential

type OptionsFunc

type OptionsFunc func(opts *EnvvarsStore)

OptionsFunc defines the signature for an option function to set envvars credentials store

func WithBackend

func WithBackend(backend EnvvarsBackender) OptionsFunc

WithBackend sets the writer to envvars credentials store

func WithConsole

func WithConsole(console ConsoleWriter) OptionsFunc

WithConsole sets the writer to envvars credentials store

func WithEncryption

func WithEncryption(e Encrypter) OptionsFunc

func WithFormater

func WithFormater(formater repository.Formater) OptionsFunc

WithFormater sets the formater to envvars credentials store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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