gopass: github.com/justwatchcom/gopass/pkg/store/root Index | Files

package root

import "github.com/justwatchcom/gopass/pkg/store/root"

Index

Package Files

errors.go fsck.go git.go gpg.go init.go list.go mount.go move.go read.go recipients.go store.go templates.go write.go

type AlreadyMountedError Uses

type AlreadyMountedError string

AlreadyMountedError is an error that is returned when a store is already mounted on a given mount point

func (AlreadyMountedError) Error Uses

func (a AlreadyMountedError) Error() string

type NotInitializedError Uses

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

NotInitializedError is an error that is returned when a not initialized store should be mounted

func (NotInitializedError) Alias Uses

func (n NotInitializedError) Alias() string

Alias returns the store alias this error was generated for

func (NotInitializedError) Error Uses

func (n NotInitializedError) Error() string

func (NotInitializedError) Path Uses

func (n NotInitializedError) Path() string

Path returns the store path this error was generated for

type Store Uses

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

Store is the public facing password store

func New Uses

func New(ctx context.Context, cfg *config.Config) (*Store, error)

New creates a new store

func (*Store) AddMount Uses

func (r *Store) AddMount(ctx context.Context, alias, path string, keys ...string) error

AddMount adds a new mount

func (*Store) AddRecipient Uses

func (r *Store) AddRecipient(ctx context.Context, store, rec string) error

AddRecipient adds a single recipient to the given store

func (*Store) Alias Uses

func (r *Store) Alias() string

Alias always returns an empty string

func (*Store) Copy Uses

func (r *Store) Copy(ctx context.Context, from, to string) error

Copy will copy one entry to another location. Multi-store copies are supported. Each entry has to be decoded and encoded for the destination to make sure it's encrypted for the right set of recipients.

func (*Store) Crypto Uses

func (r *Store) Crypto(ctx context.Context, name string) backend.Crypto

Crypto returns the crypto backend

func (*Store) Delete Uses

func (r *Store) Delete(ctx context.Context, name string) error

Delete will remove an single entry from the store

func (*Store) Exists Uses

func (r *Store) Exists(ctx context.Context, name string) bool

Exists checks the existence of a single entry

func (*Store) Format Uses

func (r *Store) Format(ctx context.Context, maxDepth int) (string, error)

Format will pretty print all entries in this store and all substores

func (*Store) Fsck Uses

func (s *Store) Fsck(ctx context.Context, path string) error

Fsck checks all stores/entries matching the given prefix

func (*Store) Get Uses

func (r *Store) Get(ctx context.Context, name string) (store.Secret, error)

Get returns the plaintext of a single key

func (*Store) GetContext Uses

func (r *Store) GetContext(ctx context.Context, name string) (store.Secret, context.Context, error)

GetContext returns the plaintext and the context of a single key

func (*Store) GetRevision Uses

func (r *Store) GetRevision(ctx context.Context, name, revision string) (store.Secret, error)

GetRevision will try to retrieve the given revision from the sync backend

func (*Store) GetSubStore Uses

func (r *Store) GetSubStore(name string) (store.Store, error)

GetSubStore returns an exact match for a mount point or an error if this mount point does not exist

func (*Store) GetTemplate Uses

func (r *Store) GetTemplate(ctx context.Context, name string) ([]byte, error)

GetTemplate will return the content of the named template

func (*Store) GitAddRemote Uses

func (r *Store) GitAddRemote(ctx context.Context, name, remote, url string) error

GitAddRemote adds a git remote

func (*Store) GitInit Uses

func (r *Store) GitInit(ctx context.Context, name, userName, userEmail string) error

GitInit initializes the git repo

func (*Store) GitInitConfig Uses

func (r *Store) GitInitConfig(ctx context.Context, name, userName, userEmail string) error

GitInitConfig initializes the git repos local config

func (*Store) GitPull Uses

func (r *Store) GitPull(ctx context.Context, name, origin, remote string) error

GitPull performs a git pull

func (*Store) GitPush Uses

func (r *Store) GitPush(ctx context.Context, name, origin, remote string) error

GitPush performs a git push

func (*Store) GitRemoveRemote Uses

func (r *Store) GitRemoveRemote(ctx context.Context, name, remote string) error

GitRemoveRemote removes a git remote

func (*Store) GitVersion Uses

func (r *Store) GitVersion(ctx context.Context) semver.Version

GitVersion returns git version information

func (*Store) HasTemplate Uses

func (r *Store) HasTemplate(ctx context.Context, name string) bool

HasTemplate returns true if the template exists

func (*Store) ImportMissingPublicKeys Uses

func (r *Store) ImportMissingPublicKeys(ctx context.Context) error

ImportMissingPublicKeys import missing public keys in any substore

func (*Store) Init Uses

func (r *Store) Init(ctx context.Context, alias, path string, ids ...string) error

Init tries to initialize a new password store location matching the object

func (*Store) Initialized Uses

func (r *Store) Initialized(ctx context.Context) (bool, error)

Initialized checks on disk if .gpg-id was generated and thus returns true.

func (*Store) IsDir Uses

func (r *Store) IsDir(ctx context.Context, name string) bool

IsDir checks if a given key is actually a folder

func (*Store) List Uses

func (r *Store) List(ctx context.Context, maxDepth int) ([]string, error)

List will return a flattened list of all tree entries

func (*Store) ListRecipients Uses

func (r *Store) ListRecipients(ctx context.Context, store string) []string

ListRecipients lists all recipients for the given store

func (*Store) ListRevisions Uses

func (r *Store) ListRevisions(ctx context.Context, name string) ([]backend.Revision, error)

ListRevisions will list all revisions for the named entity

func (*Store) LookupTemplate Uses

func (r *Store) LookupTemplate(ctx context.Context, name string) (string, []byte, bool)

LookupTemplate will lookup and return a template

func (*Store) MountPoint Uses

func (r *Store) MountPoint(name string) string

MountPoint returns the most-specific mount point for the given key

func (*Store) MountPoints Uses

func (r *Store) MountPoints() []string

MountPoints returns a sorted list of mount points. It encodes the logic that the longer a mount point the more specific it is. This allows to "shadow" a shorter mount point by a longer one.

func (*Store) Mounts Uses

func (r *Store) Mounts() map[string]string

Mounts returns a map of mounts with their paths

func (*Store) Move Uses

func (r *Store) Move(ctx context.Context, from, to string) error

Move will move one entry from one location to another. Cross-store moves are supported. Moving an entry will decode it from the old location, encode it for the destination store with the right set of recipients and remove it from the old location afterwards.

func (*Store) Path Uses

func (r *Store) Path() string

Path returns the store path

func (*Store) Prune Uses

func (r *Store) Prune(ctx context.Context, tree string) error

Prune will remove a subtree from the Store

func (*Store) RCS Uses

func (r *Store) RCS(ctx context.Context, name string) backend.RCS

RCS returns the sync backend

func (*Store) RecipientsTree Uses

func (r *Store) RecipientsTree(ctx context.Context, pretty bool) (tree.Tree, error)

RecipientsTree returns a tree view of all stores' recipients

func (*Store) RemoveMount Uses

func (r *Store) RemoveMount(ctx context.Context, alias string) error

RemoveMount removes and existing mount

func (*Store) RemoveRecipient Uses

func (r *Store) RemoveRecipient(ctx context.Context, store, rec string) error

RemoveRecipient removes a single recipient from the given store

func (*Store) RemoveTemplate Uses

func (r *Store) RemoveTemplate(ctx context.Context, name string) error

RemoveTemplate will delete the named template if it exists

func (*Store) SaveRecipients Uses

func (r *Store) SaveRecipients(ctx context.Context) error

SaveRecipients persists the recipients to disk. Only useful if persist keys is enabled

func (*Store) Set Uses

func (r *Store) Set(ctx context.Context, name string, sec store.Secret) error

Set encodes and write the ciphertext of one entry to disk

func (*Store) SetContext Uses

func (r *Store) SetContext(ctx context.Context, name string, sec store.Secret) (context.Context, error)

SetContext encodes and write the ciphertext of one entry to disk and propagate the context

func (*Store) SetTemplate Uses

func (r *Store) SetTemplate(ctx context.Context, name string, content []byte) error

SetTemplate will (over)write the content to the template file

func (*Store) Storage Uses

func (r *Store) Storage(ctx context.Context, name string) backend.Storage

Storage returns the storage backend for the given mount point

func (*Store) String Uses

func (r *Store) String() string

func (*Store) TemplateTree Uses

func (r *Store) TemplateTree(ctx context.Context) (tree.Tree, error)

TemplateTree returns a tree of all templates

func (*Store) Tree Uses

func (r *Store) Tree(ctx context.Context) (tree.Tree, error)

Tree returns the tree representation of the entries

func (*Store) URL Uses

func (r *Store) URL() string

URL returns the store URL

func (*Store) WithConfig Uses

func (r *Store) WithConfig(ctx context.Context, name string) context.Context

WithConfig populates the context with the substore config

Package root imports 20 packages (graph). Updated 2019-09-22. Refresh now. Tools for package owners.