Documentation ¶
Index ¶
Constants ¶
const (
// Version specifies the number for the version subcommand
Version = "24.2"
)
Variables ¶
var CloseDatabase = closeDatabase
CloseDatabase opens the database before running a subcommand.
var Command = exec.Command
Command returns the Cmd struct to execute the named program
var GeneratePassword = password.Generate
GeneratePassword is the package shortcut for password.Generator.Generate.
var GenerateQrCode = qrterminal.Generate
GenerateQrCode creates a QR Code and writes it out to io.Writer.
var GenerateTotpCode = totp.GenerateCode
GenerateTotpCode creates a TOTP token using the current time.
var OpenDatabase = openDatabase
OpenDatabase opens the database before running a subcommand.
var Remove = os.Remove
Remove removes the named file or (empty) directory.
var Stat = os.Stat
Stat returns a FileInfo describing the named file.
Functions ¶
func NewRootCommand ¶
NewRootCommand creates the parent of all subcommands.
Types ¶
type Context ¶
type Context struct { TempFile *os.File PermanentPath string Database *sql.DB NoWriteBack bool DryRun bool DatabaseMigrated bool OutOrStdout *io.Writer }
Context is state that is preserved during PreRun / Run / PostRun.
type PasswordType ¶
type PasswordType string
PasswordType is an enum of possible password types.
const ( // PasswordTypePlain is a password sent to a server as-is. PasswordTypePlain PasswordType = "plain" // PasswordTypeTotp is a TOTP shared secret. PasswordTypeTotp PasswordType = "totp" )
func (*PasswordType) Set ¶
func (t *PasswordType) Set(v string) error
Set sets the value of `t` from `v`.
func (*PasswordType) String ¶
func (t *PasswordType) String() string
func (*PasswordType) Type ¶
func (t *PasswordType) Type() string
Type returns the type of `t` as a string.
type XMLMachine ¶
type XMLMachine struct { XMLName xml.Name `xml:"node"` Label string `xml:"label,attr"` Services []XMLService `xml:"node"` }
XMLMachine is the 1st <node> element from cpm's XML database.
type XMLMachines ¶
type XMLMachines struct { XMLName xml.Name `xml:"root"` Machines []XMLMachine `xml:"node"` }
XMLMachines is the <root> element from cpm's XML database.
type XMLPassword ¶
type XMLPassword struct { XMLName xml.Name `xml:"node"` Label string `xml:"label,attr"` Totp string `xml:"totp,attr"` }
XMLPassword is the 4th <node> element from cpm's XML database.