store

package
v0.0.0-...-b3c6427 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address uint64
const NilAddress Address = 0

func (Address) UInt64

func (a Address) UInt64() uint64

type BlockType

type BlockType byte
const BTreeInternalNodeBlockType BlockType = 2
const BTreeLeafBlockType BlockType = 3
const BTreeMetaBlockType BlockType = 1
const SequentialDataBlockType BlockType = 5
const SequentialMetaBlockType BlockType = 4

type Memory

type Memory interface {
	Allocate(size int, t BlockType) (Address, []byte, error)
	Free(Address) error
	GetBlock(addr Address) ([]byte, BlockType, error)
	Touch(Address) error
}

type Store

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

func Open

func Open(dir string, maxSize int) (*Store, error)

func (*Store) Allocate

func (s *Store) Allocate(size int, t BlockType) (Address, []byte, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Free

func (s *Store) Free(Address) error

func (*Store) GetBlock

func (s *Store) GetBlock(addr Address) ([]byte, BlockType, error)

func (*Store) GetRootAddress

func (s *Store) GetRootAddress() Address

func (*Store) PrivateMMap

func (s *Store) PrivateMMap() (*Store, error)

func (*Store) SetRootAddress

func (s *Store) SetRootAddress(a Address) error

func (*Store) Touch

func (s *Store) Touch(addr Address) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL