Documentation ¶
Index ¶
- Variables
- type Node
- type Secret
- func (s *Secret) Format(oldKey, newKey, fmtType string) error
- func (s *Secret) Get(key string) string
- func (s *Secret) Has(key string) bool
- func (s *Secret) JSON() string
- func (s Secret) MarshalJSON() ([]byte, error)
- func (s *Secret) Password(key string, length int)
- func (s *Secret) RSAKey(bits int) error
- func (s *Secret) SSHKey(bits int) error
- func (s *Secret) Set(key, value string)
- func (s *Secret) UnmarshalJSON(b []byte) error
- func (s *Secret) YAML() string
- type Vault
- func (v *Vault) Copy(oldpath, newpath string) error
- func (v *Vault) Delete(path string) error
- func (v *Vault) List(path string) (paths []string, err error)
- func (v *Vault) Move(oldpath, newpath string) error
- func (v *Vault) Read(path string) (secret *Secret, err error)
- func (v *Vault) Tree(path string, ansify bool) (tree.Node, error)
- func (v *Vault) Write(path string, s *Secret) error
Constants ¶
This section is empty.
Variables ¶
var NotFound error
Functions ¶
This section is empty.
Types ¶
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
A Secret contains a set of key/value pairs that store anything you want, including passwords, RSAKey keys, usernames, etc.
func (*Secret) JSON ¶
JSON converts a Secret to its JSON representation and returns it as a string. Returns an empty string if there were any errors.
func (Secret) MarshalJSON ¶ added in v0.0.3
func (*Secret) RSAKey ¶
RSAKey generates a new public/private keypair, and stores it in the secret, under the 'public' and 'private' keys.
func (*Secret) SSHKey ¶
SSHKey generates a new public/private keypair, and stores it in the secret, under the 'public' and 'private' keys.
func (*Secret) UnmarshalJSON ¶ added in v0.0.3
type Vault ¶
A Vault represents a means for interacting with a remote Vault instance (unsealed and pre-authenticated) to read and write secrets.
func NewVault ¶
NewVault creates a new Vault object. If an empty token is specified, the current user's token is read from ~/.vault-token.
func (*Vault) List ¶ added in v0.0.3
List returns the set of (relative) paths that are directly underneath the given path. Intermediate path nodes are suffixed with a single "/", whereas leaf nodes (the secrets themselves) are not.
func (*Vault) Read ¶
Read checks the Vault for a Secret at the specified path, and returns it. If there is nothing at that path, a nil *Secret will be returned, with no error.