store

package
v0.0.0-...-9f06dfe Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountDefaultSSMAliasKeyID represents account's default SSM alias used
	// to encrypt/decrypt configuration secrets
	AccountDefaultSSMAliasKeyID = "aws/ssm"
)

Variables

View Source
var (
	// ErrConfigNotFound is returned if the specified config is not found in the
	// parameter store.
	ErrConfigNotFound = errors.New("config not found")
)

Functions

This section is empty.

Types

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func NewMemoryStoreFromMap

func NewMemoryStoreFromMap(m map[string]string) *MemoryStore

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(name ParameterName) error

func (*MemoryStore) Get

func (s *MemoryStore) Get(name ParameterName, version int) (Value, error)

func (*MemoryStore) List

func (s *MemoryStore) List(prefix string, includeValues bool) ([]Value, error)

func (*MemoryStore) ListRaw

func (s *MemoryStore) ListRaw(prefix string) ([]RawValue, error)

func (*MemoryStore) Put

func (s *MemoryStore) Put(name ParameterName, value Value) error

type Metadata

type Metadata struct {
	Key              string
	Description      string
	Secure           bool
	Version          int
	LastModifiedDate time.Time
	LastModifiedUser string
}

type NullStore

type NullStore struct{}

func NewNullStore

func NewNullStore() *NullStore

func (*NullStore) Delete

func (s *NullStore) Delete(name ParameterName) error

func (*NullStore) Get

func (s *NullStore) Get(name ParameterName, version int) (Value, error)

func (*NullStore) List

func (s *NullStore) List(prefix string, includeValues bool) ([]Value, error)

func (*NullStore) ListRaw

func (s *NullStore) ListRaw(prefix string) ([]RawValue, error)

func (*NullStore) Put

func (s *NullStore) Put(name ParameterName, value Value) error

type ParameterName

type ParameterName struct {
	ParameterPath string
	Name          string
}

ParameterName represents full name of the configuration parameter

type RawValue

type RawValue struct {
	Value string
	Key   string
}

RawValue represents value without any metadata

type SSMStore

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

SSMStore implements the Store interface for storing configurations in SSM Parameter Store

func NewSSMStore

func NewSSMStore(numRetries int) (*SSMStore, error)

NewSSMStore creates a new SSMStore

func (*SSMStore) Delete

func (s *SSMStore) Delete(name ParameterName) error

Delete removes a configuration from the parameter store. Note this removes all versions of the configuration.

func (*SSMStore) Get

func (s *SSMStore) Get(name ParameterName, version int) (Value, error)

Get reads a configuration from the parameter store at a specific version. To grab the latest version, use -1 as the version number.

func (*SSMStore) KMSKey

func (s *SSMStore) KMSKey() string

func (*SSMStore) List

func (s *SSMStore) List(prefix string, includeValues bool) ([]Value, error)

func (*SSMStore) ListRaw

func (s *SSMStore) ListRaw(prefix string) ([]RawValue, error)

ListRaw lists all configuration keys and values for a given prefix. Does not include any other meta-data. Uses faster AWS APIs with much higher rate-limits. Suitable for use in production environments.

func (*SSMStore) Put

func (s *SSMStore) Put(name ParameterName, value Value) error

Put adds a given value to a the system identified by name. If the configuration already exists, then it writes a new version.

type Store

type Store interface {
	Put(name ParameterName, value Value) error
	Get(name ParameterName, version int) (Value, error)
	List(prefix string, includeValues bool) ([]Value, error)
	ListRaw(prefix string) ([]RawValue, error)
	Delete(name ParameterName) error
}

type Value

type Value struct {
	Value *string
	Meta  Metadata
}

Value contans actual value of parameter

Jump to

Keyboard shortcuts

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