Documentation ¶
Index ¶
- type Secret
- func (s *Secret) Body() string
- func (s *Secret) Bytes() ([]byte, error)
- func (s *Secret) Data() map[string]interface{}
- func (s *Secret) DeleteKey(key string) error
- func (s *Secret) Equal(other *Secret) bool
- func (s *Secret) Password() string
- func (s *Secret) SetBody(b string) error
- func (s *Secret) SetPassword(pw string)
- func (s *Secret) SetValue(key, value string) error
- func (s *Secret) String() string
- func (s *Secret) Value(key string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Secret ¶
Secret is a decoded secret
func Parse ¶
Parse decodes an secret. It will always return a valid secret. If decoding the body to YAML is may return an error which can be ignored.
func (*Secret) Body ¶
Body returns the body of a secret. If the body was valid YAML it returns an empty string
func (*Secret) Data ¶ added in v1.5.0
Data returns the data of a secret. Unless the body was valid YAML, it returns an map
func (*Secret) SetPassword ¶
SetPassword sets a new password (i.e. the first line)
func (*Secret) SetValue ¶
SetValue sets a key to a given value. Will fail if an non-empty body exists
Click to show internal directories.
Click to hide internal directories.