Documentation ¶
Overview ¶
Package backend handles kdbx interactions
Package backend handles kdbx interactions ¶
Package backend handles kdbx interactions ¶
Package backend handles querying a store
Index ¶
- func Base(s string) string
- func Directory(s string) string
- func IsDirectory(path string) bool
- func NewPath(segments ...string) string
- func NewSuffix(name string) string
- type ActionMode
- type Context
- type Hook
- type HookMode
- type JSON
- type QueryEntity
- type QueryMode
- type QueryOptions
- type Transaction
- func (t *Transaction) Get(path string, mode ValueMode) (*QueryEntity, error)
- func (t *Transaction) Insert(path, val string) error
- func (t *Transaction) MatchPath(path string) ([]QueryEntity, error)
- func (t *Transaction) Move(src QueryEntity, dst string) error
- func (t *Transaction) QueryCallback(args QueryOptions) ([]QueryEntity, error)
- func (t *Transaction) Remove(entity *QueryEntity) error
- func (t *Transaction) RemoveAll(entities []QueryEntity) error
- type ValueMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDirectory ¶
IsDirectory will indicate if a path looks like a group/directory
Types ¶
type ActionMode ¶
type ActionMode string
ActionMode represents activities performed via transactions
const ( // MoveAction represents changes via moves, like the Move command MoveAction ActionMode = "mv" // InsertAction represents changes via inserts, like the Insert command InsertAction ActionMode = "insert" // RemoveAction represents changes via deletions, like Remove or globbed remove commands RemoveAction ActionMode = "rm" )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context handles operating on the underlying database
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook represents a runnable user-defined hook
type QueryEntity ¶
QueryEntity is the result of a query
func (QueryEntity) Directory ¶
func (e QueryEntity) Directory() string
Directory gets the offset location of the entry without the 'name'
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 // SuffixMode will look for an entity ending in a specific value SuffixMode // PrefixMode allows for entities starting with a specific value PrefixMode )
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) (*QueryEntity, error)
Get will request a singular entity
func (*Transaction) Insert ¶
func (t *Transaction) Insert(path, val string) error
Insert is a move to the same location
func (*Transaction) MatchPath ¶
func (t *Transaction) MatchPath(path string) ([]QueryEntity, error)
MatchPath will try to match 1 or more elements (more elements when globbing)
func (*Transaction) Move ¶
func (t *Transaction) Move(src QueryEntity, dst string) error
Move will move a src object to a dst location
func (*Transaction) QueryCallback ¶
func (t *Transaction) QueryCallback(args QueryOptions) ([]QueryEntity, error)
QueryCallback will retrieve a query based on setting
func (*Transaction) Remove ¶
func (t *Transaction) Remove(entity *QueryEntity) error
Remove will remove a single entity
func (*Transaction) RemoveAll ¶
func (t *Transaction) RemoveAll(entities []QueryEntity) error
RemoveAll handles removing elements