secrets

package
v1.9.3-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KV

type KV struct {
	// contains filtered or unexported fields
}

KV is a simple key value secret

func ParseKV

func ParseKV(in []byte) (*KV, error)

ParseKV tries to parse a KV secret

func (*KV) Bytes

func (k *KV) Bytes() []byte

Bytes serializes

func (*KV) Del

func (k *KV) Del(key string)

Del removes a key

func (*KV) Get

func (k *KV) Get(key string) string

Get returns a single key

func (*KV) GetBody

func (k *KV) GetBody() string

GetBody returns the body

func (*KV) Keys

func (k *KV) Keys() []string

Keys returns all keys

func (*KV) MIME

func (k *KV) MIME() *secret.MIME

MIME converts this secret to a gopass MIME secret

func (*KV) Set

func (k *KV) Set(key, value string)

Set writes a single key

type Plain

type Plain struct {
	Body []byte
}

Plain is the fallback secret that only contains plain text

func ParsePlain

func ParsePlain(in []byte) *Plain

ParsePlain never fails and always returns a Plain secret

func (*Plain) Bytes

func (p *Plain) Bytes() []byte

Bytes returns the body

func (*Plain) Del

func (p *Plain) Del(_ string)

Del does nothing

func (*Plain) Get

func (p *Plain) Get(key string) string

Get returns the first line (for password) or the empty string

func (*Plain) GetBody

func (p *Plain) GetBody() string

GetBody returns everything execpt the first line

func (*Plain) Keys

func (p *Plain) Keys() []string

Keys always returns nil

func (*Plain) MIME

func (p *Plain) MIME() *secret.MIME

MIME converts this secret to a gopass MIME secret

func (*Plain) Set

func (p *Plain) Set(key, value string)

Set updates the first line (for password) or does nothing

type YAML

type YAML struct {
	// contains filtered or unexported fields
}

YAML is a YAML secret

func ParseYAML

func ParseYAML(in []byte) (*YAML, error)

ParseYAML will try to parse a YAML secret.

func (*YAML) Bytes

func (y *YAML) Bytes() []byte

Bytes serialized this secret

func (*YAML) Del

func (y *YAML) Del(key string)

Del removes a single key

func (*YAML) Get

func (y *YAML) Get(key string) string

Get returns the value of a single key

func (*YAML) GetBody

func (y *YAML) GetBody() string

GetBody returns the body

func (*YAML) Keys

func (y *YAML) Keys() []string

Keys returns all keys

func (*YAML) MIME

func (y *YAML) MIME() *secret.MIME

MIME converts this secret to a gopass MIME secret

func (*YAML) Set

func (y *YAML) Set(key, value string)

Set sets a key to a given value

Jump to

Keyboard shortcuts

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