secrets

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 3 Imported by: 0

README

secrets

Secrets for cli

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) (string, error)

Get provides the proxy to Storage.Get of initialized package storage

func IsNotFound added in v0.2.0

func IsNotFound(err error) bool

func IsNotInitialized added in v0.2.0

func IsNotInitialized(err error) bool

func MustGet added in v0.2.0

func MustGet(name string) string

Must get provides the proxy to Storage.Get of initialized package storage, it panics if secret is not found

Types

type EncEnvStorage added in v0.2.0

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

EncryptedEnvironmentStorage stores secrets in environment variables

func InitEncEnvStorage added in v0.2.0

func InitEncEnvStorage(master, prefix string, uppercase bool) (*EncEnvStorage, error)

InitEncryptedMemoryStorage creates new environment storage and sets it as package storage

func MustInitEncEnvStorage added in v0.2.0

func MustInitEncEnvStorage(master, prefix string, uppercase bool) *EncEnvStorage

creates MustInitMemoryStorage new environment storage and sets it as package storage

func NewEncEnvStorage added in v0.2.0

func NewEncEnvStorage(master, prefix string, uppercase bool) (*EncEnvStorage, error)

NewEncryptedEnvironment Storage creates new environment storage

func (*EncEnvStorage) Get added in v0.2.0

func (ees *EncEnvStorage) Get(name string) (string, error)

Get reads secret from storage

func (*EncEnvStorage) Prepare added in v0.2.0

func (ees *EncEnvStorage) Prepare(name, secret string) (string, string, error)

Prepare secret value name and encrypted value

func (*EncEnvStorage) Set added in v0.2.0

func (ees *EncEnvStorage) Set(name, secret string) error

Set the secret value

type EnvStorage added in v0.2.0

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

EnvStorage stores secrets in environment variables

func InitEnvStorage added in v0.2.0

func InitEnvStorage(prefix string, uppercase bool) *EnvStorage

InitMemoryStorage creates new environment storage and sets it as package storage

func NewEnvStorage added in v0.2.0

func NewEnvStorage(prefix string, uppercase bool) *EnvStorage

NewMemoryStorage creates new environment storage

func (*EnvStorage) Get added in v0.2.0

func (es *EnvStorage) Get(name string) (string, error)

Get reads secret from storage

func (*EnvStorage) Set added in v0.2.0

func (es *EnvStorage) Set(name, secret string) error

Set sets the secret value in memory storage

type MemoryStorage

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

MemoryStorage does not persist secrets data

func InitMemoryStorage

func InitMemoryStorage() *MemoryStorage

InitMemoryStorage creates new memory storage and sets it as package storage

func NewMemoryStorage added in v0.2.0

func NewMemoryStorage() *MemoryStorage

NewMemoryStorage creates new memory storage

func (*MemoryStorage) Get

func (ms *MemoryStorage) Get(name string) (string, error)

Get reads secret from storage

func (*MemoryStorage) Set

func (ms *MemoryStorage) Set(name, secret string)

Set sets the secret value in memory storage

type SecretNotFound

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

func (*SecretNotFound) Error

func (e *SecretNotFound) Error() string

type Storage

type Storage interface {
	Get(name string) (string, error)
}

Storage provides the interface for reading secrets

type StorageIsNotInitialized

type StorageIsNotInitialized struct{}

func (*StorageIsNotInitialized) Error

func (e *StorageIsNotInitialized) Error() string

Directories

Path Synopsis
cmd
secrets command

Jump to

Keyboard shortcuts

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