PageHeaderSize represents the size of the bolt.Page header.
const PageHeaderSize = 16
var ( // ErrCorrupt is returned when a checking a data file finds errors. ErrCorrupt = errors.New("invalid value") )
func GetRootPage(path string) (root Pgid, activeMeta Pgid, err error)
GetRootPage returns the root-page (according to the most recent transaction).
func WritePage(path string, pageBuf []byte) error
DO NOT EDIT. Copied from the "bolt" package.
type BranchPageElement struct {
// contains filtered or unexported fields
}
func (n *BranchPageElement) Key() []byte
DO NOT EDIT. Copied from the "bolt" package.
func (n *BranchPageElement) PgId() Pgid
DO NOT EDIT. Copied from the "bolt" package.
type Bucket struct {
// contains filtered or unexported fields
}
func LoadBucket(buf []byte) *Bucket
func (b *Bucket) InlinePage(v []byte) *Page
func (b *Bucket) RootPage() Pgid
func (b *Bucket) String() string
DO NOT EDIT. Copied from the "bolt" package.
type LeafPageElement struct {
// contains filtered or unexported fields
}
func (n *LeafPageElement) Bucket() *Bucket
func (n *LeafPageElement) IsBucketEntry() bool
func (n *LeafPageElement) Key() []byte
DO NOT EDIT. Copied from the "bolt" package.
func (n *LeafPageElement) Value() []byte
DO NOT EDIT. Copied from the "bolt" package.
DO NOT EDIT. Copied from the "bolt" package.
type Meta struct {
// contains filtered or unexported fields
}
func LoadPageMeta(buf []byte) *Meta
func (m *Meta) Print(w io.Writer)
func (m *Meta) RootBucket() *Bucket
func (m *Meta) Txid() uint64
DO NOT EDIT. Copied from the "bolt" package.
type Page struct {
// contains filtered or unexported fields
}
func LoadPage(buf []byte) *Page
func ReadPage(path string, pageID uint64) (*Page, []byte, error)
ReadPage reads Page info & full Page data from a path. This is not transactionally safe.
func (p *Page) BranchPageElement(index uint16) *BranchPageElement
DO NOT EDIT. Copied from the "bolt" package.
func (p *Page) Count() uint16
func (p *Page) FreelistPageCount() int
func (p *Page) FreelistPagePages() []Pgid
func (p *Page) Id() Pgid
func (p *Page) LeafPageElement(index uint16) *LeafPageElement
DO NOT EDIT. Copied from the "bolt" package.
func (p *Page) Overflow() uint32
func (p *Page) SetCount(target uint16)
func (p *Page) SetId(target Pgid)
func (p *Page) SetOverflow(target uint32)
func (p *Page) String() string
func (p *Page) Type() string
TODO(ptabor): Make the page-types an enum.
DO NOT EDIT. Copied from the "bolt" package.
type Pgid uint64
func ReadPageAndHWMSize(path string) (uint64, Pgid, error)
ReadPageAndHWMSize reads Page size and HWM (id of the last+1 Page). This is not transactionally safe.