Documentation
¶
Index ¶
- Constants
- Variables
- func BuildBox(name string, mp *orderedmap.Map) string
- func Erase(filename string) error
- func Exists(db *bolt.DB, name string, obj object) error
- func FmtExpires(expires string) (string, error)
- func MustExist(db *bolt.DB, obj object, allowDir ...bool) cobra.PositionalArgs
- func MustExistLs(db *bolt.DB, obj object) cobra.PositionalArgs
- func MustNotExist(db *bolt.DB, obj object, allowDir ...bool) cobra.PositionalArgs
- func NormalizeName(name string, allowDir ...bool) string
- func SelectEditor() string
- func SetContext(t testing.TB) *bolt.DB
- func SupportedManagers() cobra.PositionalArgs
- func WatchFile(filename string, done chan struct{}, errCh chan error)
- func WriteClipboard(cmd *cobra.Command, d time.Duration, field, content string) error
- type RunEFunc
Constants ¶
const ( // Card object Card object = iota // Entry object Entry // File object File // TOTP object TOTP )
Variables ¶
var ( // ErrInvalidLength is returned when generating a password/passphrase and the length passed is < 1. ErrInvalidLength = errors.New("invalid length") // ErrInvalidName is returned when a name is required and received "" or contains "//". ErrInvalidName = errors.New("invalid name") // ErrInvalidPath is returned when a path is required and received "". ErrInvalidPath = errors.New("invalid path") )
Functions ¶
func BuildBox ¶
func BuildBox(name string, mp *orderedmap.Map) string
BuildBox constructs a responsive box used to display records information.
┌──── Sample ────┐ │ Key │ Value │ └────────────────┘
func Exists ¶
Exists checks if name or one of its folders is already being used.
Returns an error if a match was found.
func FmtExpires ¶
FmtExpires returns expires formatted.
func MustExist ¶
func MustExist(db *bolt.DB, obj object, allowDir ...bool) cobra.PositionalArgs
MustExist returns an error if a record does not exist or if the name is invalid.
func MustExistLs ¶
func MustExistLs(db *bolt.DB, obj object) cobra.PositionalArgs
MustExistLs is like MustExist but it doesn't fail if there are no arguments or if the user is using the filter flag.
func MustNotExist ¶
func MustNotExist(db *bolt.DB, obj object, allowDir ...bool) cobra.PositionalArgs
MustNotExist returns an error if the record exists or if the name is invalid.
func NormalizeName ¶
NormalizeName sanitizes the user input name.
func SelectEditor ¶
func SelectEditor() string
SelectEditor returns the editor to use, if none is found it returns vim.
func SetContext ¶
SetContext sets up the testing environment.
It uses t.Cleanup() to close the database connection after the test and all its subtests are completed.
func SupportedManagers ¶ added in v1.0.0
func SupportedManagers() cobra.PositionalArgs
SupportedManagers validates if the password manager used to import/export records is supported.
func WatchFile ¶
WatchFile looks for the file initial state and loops until the first modification.
Preferred over fsnotify since this last returns false events with recently created files.
func WriteClipboard ¶ added in v0.2.2
WriteClipboard writes the content to the clipboard and deletes it after "t" if "t" is higher than 0 or if there is a default timeout set in the configuration. Otherwise it does nothing.
Types ¶
Directories
¶
Path | Synopsis |
---|---|
Package tfa handles two-factor authentication codes.
|
Package tfa handles two-factor authentication codes. |