cmd

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorApp  = "app"
	ErrorUser = "user"
)

Error types

Variables

View Source
var PromptuiStdin io.ReadCloser = os.Stdin

Input stream for usage with promptui; this can be overridden by tests

View Source
var PromptuiStdout io.WriteCloser = os.Stdout

Output stream for usage with promptui; this can be overridden by tests

Functions

func AddKey added in v0.3.0

func AddKey(info *infofile.InfoFile, masterKey []byte, gpgKey string) (keyId string, errMessage string, err error)

AddKey adds a key to an info file If the GPG Key is empty, will prompt for a passphrase

func GetMasterKey added in v0.2.0

func GetMasterKey(info *infofile.InfoFile) (masterKey []byte, keyId string, errMessage string, err error)

GetMasterKey gets the master key, either unwrapping it with a passphrase or with GPG

func NewAddCmd added in v0.5.0

func NewAddCmd() *cobra.Command

NewAddCmd is for "prvt add"

func NewExecError added in v0.5.0

func NewExecError(errType string, errMessage string, errData error) error

func NewInfoFile added in v0.3.0

func NewInfoFile(gpgKey string) (info *infofile.InfoFile, errMessage string, err error)

NewInfoFile generates a new info file with a brand-new master key, wrapped either with a passphrase-derived key, or with GPG

func NewLsCmd added in v0.5.0

func NewLsCmd() *cobra.Command

NewLsCmd is for "prvt ls"

func NewRepoCmd added in v0.5.0

func NewRepoCmd() *cobra.Command

NewRepoCmd is for "prvt repo"

func NewRepoInfoCmd added in v0.5.1

func NewRepoInfoCmd() *cobra.Command

NewRepoInfoCmd is for "prvt repo info"

func NewRepoInitCmd added in v0.5.0

func NewRepoInitCmd() *cobra.Command

NewRepoInitCmd is for "prvt repo init"

func NewRepoKeyAddCmd added in v0.5.0

func NewRepoKeyAddCmd() *cobra.Command

NewRepoKeyAddCmd is for "prvt repo key add"

func NewRepoKeyCmd added in v0.5.0

func NewRepoKeyCmd() *cobra.Command

NewRepoKeyCmd is for "prvt repo key"

func NewRepoKeyLsCmd added in v0.5.0

func NewRepoKeyLsCmd() *cobra.Command

NewRepoKeyLsCmd is for "prvt repo key ls"

func NewRepoKeyRmCmd added in v0.5.0

func NewRepoKeyRmCmd() *cobra.Command

NewRepoKeyRmCmd is for "prvt repo key rm"

func NewRepoKeyTestCmd added in v0.5.0

func NewRepoKeyTestCmd() *cobra.Command

NewRepoKeyTestCmd is for "prvt repo key test"

func NewRepoUpgradeCmd added in v0.5.0

func NewRepoUpgradeCmd() *cobra.Command

NewRepoUpgradeCmd is for "prvt repo upgrade"

func NewRmCmd added in v0.5.0

func NewRmCmd() *cobra.Command

NewRmCmd is for "prvt rm"

func NewRootCmd added in v0.5.0

func NewRootCmd() *cobra.Command

NewRootCmd returns the root command

func NewServeCmd added in v0.5.0

func NewServeCmd() *cobra.Command

NewServeCmd is for "prvt serve"

func NewVersionCmd added in v0.5.0

func NewVersionCmd() *cobra.Command

NewVersionCmd is for "prvt version"

func PromptPassphrase added in v0.2.0

func PromptPassphrase() (string, error)

PromptPassphrase prompts the user for a passphrase

func UpgradeInfoFile added in v0.3.0

func UpgradeInfoFile(info *infofile.InfoFile) (errMessage string, err error)

UpgradeInfoFile upgrades an info file to the latest version

Types

type ExecError added in v0.5.0

type ExecError struct {
	Type    string
	Message string
	Data    error
}

ExecError is a custom error object that implements the error interface

func (ExecError) Error added in v0.5.0

func (e ExecError) Error() string

func (ExecError) StatusCode added in v0.5.0

func (e ExecError) StatusCode() int

Jump to

Keyboard shortcuts

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