mirror of
https://github.com/safing/portbase
synced 2026-05-04 22:52:05 +00:00
Add GetMeta to database storage interface
This commit is contained in:
parent
3f3786b854
commit
0061572e1b
11 changed files with 170 additions and 32 deletions
|
|
@ -104,6 +104,18 @@ func (fst *FSTree) Get(key string) (record.Record, error) {
|
|||
return r, nil
|
||||
}
|
||||
|
||||
// GetMeta returns the metadata of a database record.
|
||||
func (fst *FSTree) GetMeta(key string) (*record.Meta, error) {
|
||||
// TODO: Replace with more performant variant.
|
||||
|
||||
r, err := fst.Get(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r.Meta(), nil
|
||||
}
|
||||
|
||||
// Put stores a record in the database.
|
||||
func (fst *FSTree) Put(r record.Record) (record.Record, error) {
|
||||
dstPath, err := fst.buildFilePath(r.DatabaseKey(), true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue