Documentation
¶
Index ¶
- Constants
- Variables
- func Open(path string) (*File, []byte, Meta, error)
- func OpenBlobs(path string) (*File, []Blob, Meta, error)
- type Blob
- type BlobClass
- type File
- type Meta
- type RecordID
- type RecordPage
- func DecodeIndexPage(page []byte, expectedPageID uint64) (*RecordPage, error)
- func DecodeRecordPage(page []byte, expectedPageID uint64) (*RecordPage, error)
- func NewIndexPageAt(pageID, generation, lsn uint64) *RecordPage
- func NewRecordPage(pageID uint64) *RecordPage
- func NewRecordPageAt(pageID, generation, lsn uint64) *RecordPage
- func (p *RecordPage) Delete(id RecordID) error
- func (p *RecordPage) FreeBytes() int
- func (p *RecordPage) Generation() uint64
- func (p *RecordPage) Get(id RecordID) ([]byte, error)
- func (p *RecordPage) Insert(record []byte) (RecordID, error)
- func (p *RecordPage) LSN() uint64
- func (p *RecordPage) MarshalBinary() ([]byte, error)
- func (p *RecordPage) PageID() uint64
- func (p *RecordPage) Update(id RecordID, record []byte) error
Constants ¶
View Source
const (
PageSize = 16 * 1024
)
Variables ¶
View Source
var ( ErrCorrupt = errors.New("meldbase storage: corrupt database") ErrLocked = errors.New("meldbase storage: database is locked") )
Functions ¶
Types ¶
type RecordID ¶
RecordID never aliases a reused slot: deleting a record advances the slot's generation before that slot can be allocated again.
type RecordPage ¶
type RecordPage struct {
// contains filtered or unexported fields
}
RecordPage is a slotted 16 KiB document page. Its binary form packs record bodies from the header upward and the fixed-size slot directory downward.
func DecodeIndexPage ¶
func DecodeIndexPage(page []byte, expectedPageID uint64) (*RecordPage, error)
func DecodeRecordPage ¶
func DecodeRecordPage(page []byte, expectedPageID uint64) (*RecordPage, error)
func NewIndexPageAt ¶
func NewIndexPageAt(pageID, generation, lsn uint64) *RecordPage
func NewRecordPage ¶
func NewRecordPage(pageID uint64) *RecordPage
func NewRecordPageAt ¶
func NewRecordPageAt(pageID, generation, lsn uint64) *RecordPage
func (*RecordPage) Delete ¶
func (p *RecordPage) Delete(id RecordID) error
func (*RecordPage) FreeBytes ¶
func (p *RecordPage) FreeBytes() int
func (*RecordPage) Generation ¶
func (p *RecordPage) Generation() uint64
func (*RecordPage) LSN ¶
func (p *RecordPage) LSN() uint64
func (*RecordPage) MarshalBinary ¶
func (p *RecordPage) MarshalBinary() ([]byte, error)
func (*RecordPage) PageID ¶
func (p *RecordPage) PageID() uint64
Click to show internal directories.
Click to hide internal directories.