mirror of
https://github.com/safing/portbase
synced 2025-04-23 10:49:09 +00:00
29 lines
600 B
Go
29 lines
600 B
Go
package record
|
|
|
|
import (
|
|
"github.com/safing/portbase/database/accessor"
|
|
)
|
|
|
|
// Record provides an interface for uniformally handling database records.
|
|
type Record interface {
|
|
Key() string // test:config
|
|
KeyIsSet() bool
|
|
DatabaseName() string // test
|
|
DatabaseKey() string // config
|
|
|
|
SetKey(key string) // test:config
|
|
MoveTo(key string) // test:config
|
|
Meta() *Meta
|
|
SetMeta(meta *Meta)
|
|
CreateMeta()
|
|
UpdateMeta()
|
|
|
|
Marshal(self Record, format uint8) ([]byte, error)
|
|
MarshalRecord(self Record) ([]byte, error)
|
|
GetAccessor(self Record) accessor.Accessor
|
|
|
|
Lock()
|
|
Unlock()
|
|
|
|
IsWrapped() bool
|
|
}
|