...

Package guts_cli

import "go.etcd.io/bbolt/internal/guts_cli"
Overview
Index

Overview ▾

Index ▾

Constants
Variables
func GetRootPage(path string) (root Pgid, activeMeta Pgid, err error)
func WritePage(path string, pageBuf []byte) error
type BranchPageElement
    func (n *BranchPageElement) Key() []byte
    func (n *BranchPageElement) PgId() Pgid
type Bucket
    func LoadBucket(buf []byte) *Bucket
    func (b *Bucket) InlinePage(v []byte) *Page
    func (b *Bucket) RootPage() Pgid
    func (b *Bucket) String() string
type LeafPageElement
    func (n *LeafPageElement) Bucket() *Bucket
    func (n *LeafPageElement) IsBucketEntry() bool
    func (n *LeafPageElement) Key() []byte
    func (n *LeafPageElement) Value() []byte
type Meta
    func LoadPageMeta(buf []byte) *Meta
    func (m *Meta) Print(w io.Writer)
    func (m *Meta) RootBucket() *Bucket
    func (m *Meta) Txid() uint64
type Page
    func LoadPage(buf []byte) *Page
    func ReadPage(path string, pageID uint64) (*Page, []byte, error)
    func (p *Page) BranchPageElement(index uint16) *BranchPageElement
    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
    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
type Pgid
    func ReadPageAndHWMSize(path string) (uint64, Pgid, error)

Package files

guts_cli.go

Constants

PageHeaderSize represents the size of the bolt.Page header.

const PageHeaderSize = 16

Variables

var (
    // ErrCorrupt is returned when a checking a data file finds errors.
    ErrCorrupt = errors.New("invalid value")
)

func GetRootPage

func GetRootPage(path string) (root Pgid, activeMeta Pgid, err error)

GetRootPage returns the root-page (according to the most recent transaction).

func WritePage

func WritePage(path string, pageBuf []byte) error

type BranchPageElement

DO NOT EDIT. Copied from the "bolt" package.

type BranchPageElement struct {
    // contains filtered or unexported fields
}

func (*BranchPageElement) Key

func (n *BranchPageElement) Key() []byte

DO NOT EDIT. Copied from the "bolt" package.

func (*BranchPageElement) PgId

func (n *BranchPageElement) PgId() Pgid

type Bucket

DO NOT EDIT. Copied from the "bolt" package.

type Bucket struct {
    // contains filtered or unexported fields
}

func LoadBucket

func LoadBucket(buf []byte) *Bucket

func (*Bucket) InlinePage

func (b *Bucket) InlinePage(v []byte) *Page

func (*Bucket) RootPage

func (b *Bucket) RootPage() Pgid

func (*Bucket) String

func (b *Bucket) String() string

type LeafPageElement

DO NOT EDIT. Copied from the "bolt" package.

type LeafPageElement struct {
    // contains filtered or unexported fields
}

func (*LeafPageElement) Bucket

func (n *LeafPageElement) Bucket() *Bucket

func (*LeafPageElement) IsBucketEntry

func (n *LeafPageElement) IsBucketEntry() bool

func (*LeafPageElement) Key

func (n *LeafPageElement) Key() []byte

DO NOT EDIT. Copied from the "bolt" package.

func (*LeafPageElement) Value

func (n *LeafPageElement) Value() []byte

DO NOT EDIT. Copied from the "bolt" package.

type Meta

DO NOT EDIT. Copied from the "bolt" package.

type Meta struct {
    // contains filtered or unexported fields
}

func LoadPageMeta

func LoadPageMeta(buf []byte) *Meta

func (*Meta) Print

func (m *Meta) Print(w io.Writer)

func (*Meta) RootBucket

func (m *Meta) RootBucket() *Bucket

func (*Meta) Txid

func (m *Meta) Txid() uint64

type Page

DO NOT EDIT. Copied from the "bolt" package.

type Page struct {
    // contains filtered or unexported fields
}

func LoadPage

func LoadPage(buf []byte) *Page

func ReadPage

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 (*Page) BranchPageElement

func (p *Page) BranchPageElement(index uint16) *BranchPageElement

DO NOT EDIT. Copied from the "bolt" package.

func (*Page) Count

func (p *Page) Count() uint16

func (*Page) FreelistPageCount

func (p *Page) FreelistPageCount() int

func (*Page) FreelistPagePages

func (p *Page) FreelistPagePages() []Pgid

func (*Page) Id

func (p *Page) Id() Pgid

func (*Page) LeafPageElement

func (p *Page) LeafPageElement(index uint16) *LeafPageElement

DO NOT EDIT. Copied from the "bolt" package.

func (*Page) Overflow

func (p *Page) Overflow() uint32

func (*Page) SetCount

func (p *Page) SetCount(target uint16)

func (*Page) SetId

func (p *Page) SetId(target Pgid)

func (*Page) SetOverflow

func (p *Page) SetOverflow(target uint32)

func (*Page) String

func (p *Page) String() string

func (*Page) Type

func (p *Page) Type() string

TODO(ptabor): Make the page-types an enum.

type Pgid

DO NOT EDIT. Copied from the "bolt" package.

type Pgid uint64

func ReadPageAndHWMSize

func ReadPageAndHWMSize(path string) (uint64, Pgid, error)

ReadPageAndHWMSize reads Page size and HWM (id of the last+1 Page). This is not transactionally safe.