Documentation ¶
Index ¶
- Constants
- Variables
- func FormatObjectKey(context, path string, store IStore) string
- func Name(key string) string
- func ToKeys(stores []IStore) []string
- type BySecurityRating
- type File
- type IStore
- type ParameterStore
- func (s ParameterStore) Compatible(types []string) bool
- func (s ParameterStore) Download(file File) (File, error)
- func (s ParameterStore) Key() string
- func (s ParameterStore) ObjectKey(path string) string
- func (s ParameterStore) Purge(file File) error
- func (s ParameterStore) SecurityRating() int
- func (s ParameterStore) Sync(file File) (File, error)
- type S3Store
- func (s S3Store) Compatible(types []string) bool
- func (s S3Store) Download(file File) (File, error)
- func (s S3Store) Key() string
- func (s S3Store) ObjectKey(path string) string
- func (s S3Store) Purge(file File) error
- func (s S3Store) SecurityRating() int
- func (s S3Store) Sync(file File) (File, error)
- type SecretsManagerStore
- func (s *SecretsManagerStore) Compatible(types []string) bool
- func (s *SecretsManagerStore) Download(file File) (File, error)
- func (s *SecretsManagerStore) Key() string
- func (s *SecretsManagerStore) ObjectKey(path string) string
- func (s *SecretsManagerStore) Purge(file File) error
- func (s *SecretsManagerStore) SecurityRating() int
- func (s *SecretsManagerStore) Sync(file File) (File, error)
Constants ¶
View Source
const ( S3BucketOption = "s3_bucket" S3KMSKeyIDDefault = "aws/s3" )
View Source
const ( KMSKeyIDOption = "kms_key_id" SMKMSKeyIDDefault = "aws/secretsmanager" SMSecretsOption = "secrets" SMSecretsDefault = "single" SMSecretsSingle = "single" SMSecretsMultiple = "multiple" )
View Source
const ( SecurityRatingLow = 3 SecurityRatingMedium = 2 SecurityRatingHigh = 1 )
View Source
const (
PSKMSKeyIDDefault = "aws/ssm"
)
Variables ¶
View Source
var SMSecretsOptions = []string{ SMSecretsSingle, SMSecretsMultiple, }
View Source
var Stores = map[string]IStore{}
Stores ...
Functions ¶
func FormatObjectKey ¶
FormatObjectKey ...
Types ¶
type BySecurityRating ¶
type BySecurityRating []IStore
func (BySecurityRating) Len ¶
func (s BySecurityRating) Len() int
func (BySecurityRating) Less ¶
func (s BySecurityRating) Less(i, j int) bool
func (BySecurityRating) Swap ¶
func (s BySecurityRating) Swap(i, j int)
type File ¶
type File struct { // CatalogKey CatalogKey string // RemoteKey is the remote location key. RemoteKey string // Type describes the file type Type string // Options allow stores to persist user preferences locally. Options map[string]string // Keys allows remotes to track which fields are stored remotely. Keys []string // Data contains the file contents. Data []byte // Synced is the last time the file matched the remote store. Synced time.Time }
File ...
func (*File) EnsureOption ¶
func (*File) SupportsParsing ¶
type IStore ¶
type IStore interface { // Key uniquely identifies the store and can be entered // as a flag value by CLI users. // >> $ xstore push .env -s s3 Key() string // ObjectKey uniquely identifies each object stored // remotely. ObjectKey(path string) string // Compatible determines if the list of file types are // supported by the storage solution. File types are the // file extensions without the leading dot. // >> (env/json/yml) Compatible(types []string) bool // SecurityRating is a number between one and three where // one inicates the most secure. SecurityRating() int // Sync pushes file contents to the remote store. Sync(file File) (File, error) // Download pulls file contents from the remote store. Download(file File) (File, error) // Purge deletes file contents from the remote store. Purge(file File) error }
IStore defines the methods a remote store must satisfy.
func ListCompatible ¶
ListCompatible returns the remote store keys that can store the specified files.
type ParameterStore ¶
type ParameterStore struct {
// contains filtered or unexported fields
}
ParameterStore ...
func (ParameterStore) Compatible ¶
func (s ParameterStore) Compatible(types []string) bool
Compatible ...
func (ParameterStore) Download ¶
func (s ParameterStore) Download(file File) (File, error)
Download ...
func (ParameterStore) ObjectKey ¶
func (s ParameterStore) ObjectKey(path string) string
ObjectKey ...
func (ParameterStore) SecurityRating ¶
func (s ParameterStore) SecurityRating() int
SecurityRating ...
type SecretsManagerStore ¶
type SecretsManagerStore struct {
// contains filtered or unexported fields
}
SecretsManagerStore ...
func (*SecretsManagerStore) Compatible ¶
func (s *SecretsManagerStore) Compatible(types []string) bool
Compatible ...
func (*SecretsManagerStore) Download ¶
func (s *SecretsManagerStore) Download(file File) (File, error)
Download ...
func (*SecretsManagerStore) ObjectKey ¶
func (s *SecretsManagerStore) ObjectKey(path string) string
ObjectKey ...
func (*SecretsManagerStore) SecurityRating ¶
func (s *SecretsManagerStore) SecurityRating() int
SecurityRating ...
Click to show internal directories.
Click to hide internal directories.