github.com/safing/portbase@v0.19.5/database/record/record.go (about)

     1  package record
     2  
     3  import (
     4  	"github.com/safing/portbase/database/accessor"
     5  )
     6  
     7  // Record provides an interface for uniformally handling database records.
     8  type Record interface {
     9  	SetKey(key string) // test:config
    10  	Key() string       // test:config
    11  	KeyIsSet() bool
    12  	DatabaseName() string // test
    13  	DatabaseKey() string  // config
    14  
    15  	// Metadata.
    16  	Meta() *Meta
    17  	SetMeta(meta *Meta)
    18  	CreateMeta()
    19  	UpdateMeta()
    20  
    21  	// Serialization.
    22  	Marshal(self Record, format uint8) ([]byte, error)
    23  	MarshalRecord(self Record) ([]byte, error)
    24  	GetAccessor(self Record) accessor.Accessor
    25  
    26  	// Locking.
    27  	Lock()
    28  	Unlock()
    29  
    30  	// Wrapping.
    31  	IsWrapped() bool
    32  }