Documentation ¶
Overview ¶
Package app can do various conversions
Package app common objects ¶
Package app handles informational requests ¶
Package app can insert ¶
Package app can get stats ¶
Package app can list entries ¶
Package app can move entries ¶
Package app can generate passwords ¶
Package app handles rekeying a database ¶
Package app can remove an entry ¶
Package app can show/clip an entry
Package app handles TOTP tokens.
Index ¶
- Variables
- func Conv(cmd CommandOptions) error
- func Die(msg string)
- func GeneratePassword(cmd CommandOptions) error
- func Info(w io.Writer, command string, args []string) (bool, error)
- func Insert(cmd UserInputOptions, mode InsertMode) error
- func JSON(cmd CommandOptions) error
- func List(cmd CommandOptions) error
- func Move(cmd CommandOptions) error
- func ReKey(cmd UserInputOptions) error
- func Remove(cmd CommandOptions) error
- func ShowClip(cmd CommandOptions, isShow bool) error
- type CommandOptions
- type DefaultCommand
- func (a *DefaultCommand) Args() []string
- func (a *DefaultCommand) Confirm(prompt string) bool
- func (a *DefaultCommand) Input(interactive bool) ([]byte, error)
- func (a *DefaultCommand) IsPipe() bool
- func (a DefaultCommand) Password() (string, error)
- func (a DefaultCommand) ReadLine() (string, error)
- func (a *DefaultCommand) SetArgs(args ...string)
- func (a *DefaultCommand) Transaction() *backend.Transaction
- func (a *DefaultCommand) Writer() io.Writer
- type InsertMode
- type Mode
- type TOTPArguments
- type TOTPOptions
- type UserInputOptions
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoTOTP is used when TOTP is requested BUT is disabled ErrNoTOTP = errors.New("totp is disabled") // ErrUnknownTOTPMode indicates an unknown totp argument type ErrUnknownTOTPMode = errors.New("unknown totp mode") )
Functions ¶
func GeneratePassword ¶ added in v1.3.1
func GeneratePassword(cmd CommandOptions) error
GeneratePassword generates a password
func Insert ¶
func Insert(cmd UserInputOptions, mode InsertMode) error
Insert will execute an insert
func ShowClip ¶
func ShowClip(cmd CommandOptions, isShow bool) error
ShowClip will handle showing/clipping an entry
Types ¶
type CommandOptions ¶
type CommandOptions interface { Confirm(string) bool Args() []string Transaction() *backend.Transaction Writer() io.Writer }
CommandOptions define how commands operate as an application
type DefaultCommand ¶
type DefaultCommand struct {
// contains filtered or unexported fields
}
DefaultCommand is the default CLI app type for actual execution
func NewDefaultCommand ¶
func NewDefaultCommand(args []string) (*DefaultCommand, error)
NewDefaultCommand creates a new app command
func (*DefaultCommand) Args ¶
func (a *DefaultCommand) Args() []string
Args will get the args passed to the application
func (*DefaultCommand) Confirm ¶
func (a *DefaultCommand) Confirm(prompt string) bool
Confirm will confirm with the user (dying if something abnormal happens)
func (*DefaultCommand) Input ¶
func (a *DefaultCommand) Input(interactive bool) ([]byte, error)
Input will read user input
func (*DefaultCommand) IsPipe ¶
func (a *DefaultCommand) IsPipe() bool
IsPipe will indicate if we're receiving pipe input
func (DefaultCommand) Password ¶ added in v1.3.0
func (a DefaultCommand) Password() (string, error)
Password is how a keyer gets the user's password for rekey
func (DefaultCommand) ReadLine ¶ added in v1.3.0
func (a DefaultCommand) ReadLine() (string, error)
ReadLine handles a single stdin read
func (*DefaultCommand) SetArgs ¶
func (a *DefaultCommand) SetArgs(args ...string)
SetArgs allow updating the command args
func (*DefaultCommand) Transaction ¶
func (a *DefaultCommand) Transaction() *backend.Transaction
Transaction will return the backend transaction
type InsertMode ¶
type InsertMode uint
InsertMode changes how inserts are handled
const ( // SingleLineInsert is a single line entry SingleLineInsert InsertMode = iota // MultiLineInsert is a multiline insert MultiLineInsert // TOTPInsert is a singleline but from TOTP subcommands TOTPInsert )
type Mode ¶
type Mode int
Mode is the operating mode for TOTP operations
const ( // UnknownTOTPMode is an unknown command UnknownTOTPMode Mode = iota // InsertTOTPMode is inserting a new totp token InsertTOTPMode // ShowTOTPMode will show the token ShowTOTPMode // ClipTOTPMode will copy to clipboard ClipTOTPMode // MinimalTOTPMode will display minimal information to display the token MinimalTOTPMode // ListTOTPMode lists the available tokens ListTOTPMode // OnceTOTPMode will only show the token once and exit OnceTOTPMode )
type TOTPArguments ¶
TOTPArguments are the parsed TOTP call arguments
func NewTOTPArguments ¶
func NewTOTPArguments(args []string, tokenType string) (*TOTPArguments, error)
NewTOTPArguments will parse the input arguments
func (*TOTPArguments) Do ¶
func (args *TOTPArguments) Do(opts TOTPOptions) error
Do will perform the TOTP operation
type TOTPOptions ¶
type TOTPOptions struct { Clear func() CanTOTP func() bool IsInteractive func() bool // contains filtered or unexported fields }
TOTPOptions are TOTP call options
func NewDefaultTOTPOptions ¶
func NewDefaultTOTPOptions(app CommandOptions) TOTPOptions
NewDefaultTOTPOptions gets the default option set
type UserInputOptions ¶ added in v1.3.0
type UserInputOptions interface { CommandOptions IsPipe() bool Input(bool) ([]byte, error) }
UserInputOptions handle user inputs (e.g. password entry)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package commands defines available commands within the app
|
Package commands defines available commands within the app |
Package completions generations shell completions
|
Package completions generations shell completions |
Package help manages usage information
|
Package help manages usage information |