secrets

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 2 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

Types

type EnvironmentStorage

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

EnvironmentStorage stores secrets in environment variables

func InitEnvironmentStorage

func InitEnvironmentStorage(prefix string, uppercase bool) *EnvironmentStorage

InitMemoryStorage creates new environment storage and sets it as package storage

func (*EnvironmentStorage) Get

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

Get reads secret from storage

func (*EnvironmentStorage) Set

func (es *EnvironmentStorage) 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 (*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

Jump to

Keyboard shortcuts

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