Documentation
¶
Overview ¶
Package kdbx handles kdbx interactions
Package kdbx handles kdbx interactions ¶
Package kdbx handles querying a store
Index ¶
- Constants
- Variables
- func Base(s string) string
- func Directory(s string) string
- func Glob(criteria, path string) (bool, error)
- func IsDirectory(path string) bool
- func IsLeafAttribute(path, attr string) bool
- func NewPath(segments ...string) string
- func NewSuffix(name string) string
- type Context
- type Entity
- type EntityValues
- type QueryMode
- type QueryOptions
- type QuerySeq2
- type Transaction
- func (t *Transaction) Get(path string, mode ValueMode) (*Entity, error)
- func (t *Transaction) Insert(path string, val EntityValues) error
- func (t *Transaction) MatchPath(path string) ([]Entity, error)
- func (t *Transaction) Move(src *Entity, dst string) error
- func (t *Transaction) QueryCallback(args QueryOptions) (QuerySeq2, error)
- func (t *Transaction) ReKey(pass, keyFile string) error
- func (t *Transaction) Remove(entity *Entity) error
- func (t *Transaction) RemoveAll(entities []Entity) error
- type ValueMode
Constants ¶
const ( // OTPField is the totp storage attribute OTPField = "otp" // NotesField is the multiline notes key NotesField = "Notes" // URLField is a non-secret (in terms of input) entry field URLField = "URL" )
Variables ¶
var ( // AllowedFields are the same of allowed names for storing in a kdbx entry AllowedFields = []string{NotesField, OTPField, "Password", URLField} )
Functions ¶
func IsDirectory ¶
IsDirectory will indicate if a path looks like a group/directory
func IsLeafAttribute ¶
IsLeafAttribute indicates if a path is leaved with a certain name
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context handles operating on the underlying database
type Entity ¶
type Entity struct {
Values EntityValues
Path string
}
Entity are database objects from results and transactional changes
type EntityValues ¶
EntityValues are what is stored, from an entity, into kdbx backing store
type QueryMode ¶
type QueryMode int
QueryMode indicates HOW an entity will be found
const ( // ListMode indicates ALL entities will be listed ListMode QueryMode // FindMode indicates a _contains_ search for an entity FindMode // ExactMode means an entity must MATCH the string exactly ExactMode // GlobMode indicates use a glob/match to find results GlobMode )
type QueryOptions ¶
QueryOptions indicates how to find entities
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction handles the overall operation of the transaction
func Load ¶
func Load(file string) (*Transaction, error)
Load will load a kdbx file for transactions
func NewTransaction ¶
func NewTransaction() (*Transaction, error)
NewTransaction will use the underlying environment data store location
func (*Transaction) Get ¶
func (t *Transaction) Get(path string, mode ValueMode) (*Entity, error)
Get will request a singular entity
func (*Transaction) Insert ¶
func (t *Transaction) Insert(path string, val EntityValues) error
Insert is a move to the same location
func (*Transaction) MatchPath ¶
func (t *Transaction) MatchPath(path string) ([]Entity, error)
MatchPath will try to match 1 or more elements (more elements when globbing)
func (*Transaction) Move ¶
func (t *Transaction) Move(src *Entity, dst string) error
Move will move a src object to a dst location
func (*Transaction) QueryCallback ¶
func (t *Transaction) QueryCallback(args QueryOptions) (QuerySeq2, error)
QueryCallback will retrieve a query based on setting
func (*Transaction) ReKey ¶
func (t *Transaction) ReKey(pass, keyFile string) error
ReKey will change the credentials on a database
func (*Transaction) Remove ¶
func (t *Transaction) Remove(entity *Entity) error
Remove will remove a single entity
func (*Transaction) RemoveAll ¶
func (t *Transaction) RemoveAll(entities []Entity) error
RemoveAll handles removing elements