secret

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultKMSKey represents default KMS key alias
	DefaultKMSKey = "valec"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

Secret represents key=value pair

type Secrets

type Secrets []*Secret

Secrets represents the array of Secret

func LoadFromYAML

func LoadFromYAML(filename string) (string, Secrets, error)

LoadFromYAML loads secrets from the given YAML file

func MapToList

func MapToList(secretMap map[string]string) Secrets

MapToList converts map to secret list

func (Secrets) CompareList

func (ss Secrets) CompareList(old Secrets) (added, updated, deleted Secrets)

CompareList compares two secret lists and returns the differences between them

func (Secrets) Len

func (ss Secrets) Len() int

Len returns the length of the array

func (Secrets) Less

func (ss Secrets) Less(i, j int) bool

Less returns Secrets[i] is less than Secrets[j]

func (Secrets) ListToMap

func (ss Secrets) ListToMap() map[string]string

ListToMap converts secret list to map

func (Secrets) SaveAsYAML

func (ss Secrets) SaveAsYAML(filename, kmsKey string) error

SaveAsYAML saves secrets to local secret file

func (Secrets) Swap

func (ss Secrets) Swap(i, j int)

Swap swaps Secrets[i] and Secrets[j]

type YAML added in v0.5.0

type YAML struct {
	KMSKey  string  `yaml:"kms_key"`
	Secrets Secrets `yaml:"secrets"`
}

YAML represents secret yaml structure

Jump to

Keyboard shortcuts

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