secrets

package
v0.0.0-...-93b26d4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option ...

func WithQuery

func WithQuery(q string) Option

WithQuery ...

func WithSort

func WithSort(sort string) Option

WithSort ...

func WithSortDirection

func WithSortDirection(d SortDirection) Option

WithSortDirection ...

type Options

type Options struct {
	Query         string
	Sort          string
	SortDirection SortDirection
}

Options ...

type Secret

type Secret struct {
	ID   string `json:"id"`
	Type Type   `json:"type"`

	Name string `json:"name"`

	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`

	URL   string `json:"url,omitempty"`
	Notes string `json:"notes,omitempty"`

	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

Secret to keep.

func NewPassword

func NewPassword(name string, username string, password string, url string) *Secret

NewPassword creates a new password secret.

type Secrets

type Secrets struct {
	*vault.Vault
}

Secrets vault.

func New

func New(vlt *vault.Vault) *Secrets

New secrets vault.

func (*Secrets) Get

func (v *Secrets) Get(id string) (*Secret, error)

Get a secret.

func (*Secrets) List

func (v *Secrets) List(opt ...Option) ([]*Secret, error)

List ...

func (*Secrets) Save

func (v *Secrets) Save(secret *Secret) (*Secret, bool, error)

Save a secret. Returns true if secret was updated.

type SortDirection

type SortDirection string

SortDirection direction for sorting.

const (
	// Ascending direction.
	Ascending SortDirection = "asc"
	// Descending direction.
	Descending SortDirection = "desc"
)

type Type

type Type string

Type types for secret.

const (
	UnknownType  Type = ""
	PasswordType Type = "password"
	NoteType     Type = "note"
)

Types for Secret.

Jump to

Keyboard shortcuts

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