Documentation ¶
Index ¶
- Constants
- Variables
- func FormatObjectKey(context, path string, service IService) string
- func Name(key string) string
- func ToKeys(servcies []IService) []string
- type BySecurityRating
- type Dep
- type File
- type IO
- type IService
- type Opt
- type ParameterStoreService
- func (s ParameterStoreService) Compatible(types []string) bool
- func (s ParameterStoreService) Download(file File, format string) (File, error)
- func (s ParameterStoreService) Key() string
- func (s ParameterStoreService) ObjectKey(path string) string
- func (s *ParameterStoreService) PreHook(io IO) error
- func (s ParameterStoreService) Purge(file File) error
- func (s ParameterStoreService) SecurityRating() int
- func (s ParameterStoreService) Sync(file File) (File, error)
- type S3Service
- func (s *S3Service) Compatible(types []string) bool
- func (s *S3Service) Download(file File, format string) (File, error)
- func (s *S3Service) Key() string
- func (s *S3Service) ObjectKey(path string) string
- func (s *S3Service) PreHook(io IO) error
- func (s *S3Service) Purge(file File) error
- func (s *S3Service) SecurityRating() int
- func (s *S3Service) Sync(file File) (File, error)
- type SecretsManagerService
- func (s *SecretsManagerService) Compatible(types []string) bool
- func (s *SecretsManagerService) Download(file File, format string) (File, error)
- func (s *SecretsManagerService) Key() string
- func (s *SecretsManagerService) ObjectKey(path string) string
- func (s *SecretsManagerService) PreHook(io IO) error
- func (s *SecretsManagerService) Purge(file File) error
- func (s *SecretsManagerService) SecurityRating() int
- func (s *SecretsManagerService) Sync(file File) (File, error)
Constants ¶
View Source
const ( S3BucketOption = "s3_bucket" S3KMSKeyIDDefault = "aws/s3" S3RoleOption = "iam_role" )
View Source
const ( KMSKeyIDOption = "kms_key_id" SMKMSKeyIDDefault = "aws/secretsmanager" SMSecretsDescription = "Managed by Stash" SMSecretsOption = "secrets" SMSecretsDefault = "single" SMSecretsSingle = "single" SMSecretsMultiple = "multiple" SMDelimiterOption = "group_delimiter" )
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 Services = map[string]IService{}
Services ...
Functions ¶
func FormatObjectKey ¶
FormatObjectKey ...
Types ¶
type BySecurityRating ¶
type BySecurityRating []IService
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 { // Context Context string // CatalogKey CatalogKey string // RemoteKey is the remote service key. RemoteKey string // LocalPath is the path to the local file. LocalPath string // Type describes the file type Type string // Options allow servcies to persist user preferences locally. Options map[string]string // Keys tracks which fields are stashed. Keys []string // Data contains the file contents. Data []byte // Synced is the last time the file was synced with the service. Synced time.Time }
File ...
func (*File) LookupRemoteKey ¶
LookupRemoteKey ...
func (*File) SupportsParsing ¶
type IService ¶
type IService interface { // Key uniquely identifies the service and can be entered // as a flag value by CLI users. // i.e. $ stash sync .env -s s3 Key() string // ObjectKey uniquely identifies each object stashed. // This is called to display each files remote key // in the user output. ObjectKey(path string) string // Compatible determines if the list of file types are // supported by the service. File types are the file // extensions without the leading dot. // i.e. env,json,yml Compatible(types []string) bool // SecurityRating is a number between one and three where // one inicates the most secure. SecurityRating() int // PreHook is called before Sync, Download, or Purge to // initilize the service. PreHook(io IO) error // Sync uploads file contents to the remote service. Sync(file File) (File, error) // Download gets file contents from the remote service. Download(file File, format string) (File, error) // Purge deletes file contents from the remote service. Purge(file File) error }
IService defines the methods a remote service must satisfy.
func ListCompatible ¶
ListCompatible returns the remote servcies that can hold the specified files.
type ParameterStoreService ¶
type ParameterStoreService struct {
// contains filtered or unexported fields
}
ParameterStoreService ...
func (ParameterStoreService) Compatible ¶
func (s ParameterStoreService) Compatible(types []string) bool
Compatible ...
func (ParameterStoreService) Download ¶
func (s ParameterStoreService) Download(file File, format string) (File, error)
Download ...
func (ParameterStoreService) ObjectKey ¶
func (s ParameterStoreService) ObjectKey(path string) string
ObjectKey ...
func (*ParameterStoreService) PreHook ¶
func (s *ParameterStoreService) PreHook(io IO) error
PreHook ...
func (ParameterStoreService) Purge ¶
func (s ParameterStoreService) Purge(file File) error
Purge ...
func (ParameterStoreService) SecurityRating ¶
func (s ParameterStoreService) SecurityRating() int
SecurityRating ...
type S3Service ¶
type S3Service struct {
// contains filtered or unexported fields
}
S3Service ...
type SecretsManagerService ¶
type SecretsManagerService struct {
// contains filtered or unexported fields
}
SecretsManagerService ...
func (*SecretsManagerService) Compatible ¶
func (s *SecretsManagerService) Compatible(types []string) bool
Compatible ...
func (*SecretsManagerService) Download ¶
func (s *SecretsManagerService) Download(file File, format string) (File, error)
Download ...
func (*SecretsManagerService) ObjectKey ¶
func (s *SecretsManagerService) ObjectKey(path string) string
ObjectKey ...
func (*SecretsManagerService) PreHook ¶
func (s *SecretsManagerService) PreHook(io IO) error
PreHook ...
func (*SecretsManagerService) Purge ¶
func (s *SecretsManagerService) Purge(file File) error
Purge ...
func (*SecretsManagerService) SecurityRating ¶
func (s *SecretsManagerService) SecurityRating() int
SecurityRating ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.