Documentation
¶
Index ¶
- func Unparse(d *Document, key [32]byte) ([]byte, error)
- type Association
- type AutoType
- type Binary
- type BinaryReference
- type BinaryReferenceValue
- type CustomData
- type DeletedObject
- type Document
- type Entry
- type Group
- type Item
- type MemoryProtection
- type Meta
- type PathNotFound
- type Root
- type String
- type Times
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Association ¶
type AutoType ¶
type AutoType struct {
Enabled wrappers.Bool
DataTransferObfuscation int
Association *Association `xml:",omitempty"`
}
type BinaryReference ¶
type BinaryReference struct {
Key string
Reference BinaryReferenceValue `xml:"Value"`
}
type BinaryReferenceValue ¶
type BinaryReferenceValue struct {
ID int `xml:"Ref,attr"`
}
type CustomData ¶
type CustomData struct {
Inner string `xml:",innerxml"`
}
type DeletedObject ¶
type Document ¶
func NewDocument ¶
func NewDocument() *Document
func (*Document) FindPath ¶
FindPath returns the path to an item with the given UUID if it exists, and a bool indicating wether the UUID was found.
func (*Document) GetItem ¶
GetItem returns a group or an item specified by a path of UUIDs. The document is traversed, at each level choosing the group with UUID at the current index, until the end of the path is reached. The last UUID may be that of an item. For an empty path the function will return the top-level groups (which is just one group for most KeePass files)
func (*Document) UpdateEntry ¶
type Entry ¶
type Entry struct {
XMLName xml.Name `xml:"Entry"`
UUID string
IconID int
ForegroundColor string
BackgroundColor string
OverrideURL string
Tags string
Times Times
Strings []String `xml:"String"`
BinaryRefs []BinaryReference `xml:"Binary"`
AutoType AutoType
// History must be pointer to slice in order for omitempty to work for nested elements
History *[]Entry `xml:"History>Entry,omitempty"`
}
func (*Entry) DeleteField ¶
UpdateField deletes the field with the given key, if it exists Returns true if a change was made, false otherwise
func (*Entry) UpdateField ¶
UpdateField updates the field with the given key to the given value, if it exists Returns true if a change was made, false otherwise
type Group ¶
type Group struct {
XMLName xml.Name `xml:"Group"`
UUID string
Name string
Notes string
IconID int
Times Times
IsExpanded wrappers.Bool
DefaultAutoTypeSequence string
EnableAutoType wrappers.Bool
EnableSearching wrappers.Bool
LastTopVisibleEntry string
Entries []Entry `xml:"Entry"`
Groups []Group `xml:"Group"`
}
func (*Group) UpdateEntry ¶
type MemoryProtection ¶
type Meta ¶
type Meta struct {
XMLName xml.Name `xml:"Meta"`
Generator string
HeaderHash string
DatabaseName string
DatabaseNameChanged time.Time
DatabaseDescription string
DatabaseDescriptionChanged time.Time
DefaultUserName string
DefaultUserNameChanged time.Time
MaintenanceHistoryDays int
Color string
MasterKeyChanged time.Time
MasterKeyChangeRec int
MasterKeyChangeForce int
MemoryProtection MemoryProtection
RecycleBinEnabled wrappers.Bool
RecycleBinUUID string
RecycleBinChanged time.Time
EntryTemplatesGroup string
EntryTemplatesGroupChanged time.Time
HistoryMaxItems int
HistoryMaxSize int
LastSelectedGroup string
LastTopVisibleGroup string
Binaries []Binary `xml:"Binaries>Binary"`
CustomData CustomData
}
type PathNotFound ¶
type PathNotFound error
type Root ¶
type Root struct {
XMLName xml.Name `xml:"Root"`
Groups []Group `xml:"Group"`
DeletedObjects []DeletedObject `xml:"DeletedObjects>DeletedObject"`
}