store

package
v0.0.0-...-11c6e4e Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block []byte

func NewBlock

func NewBlock(capacity uint64, prevNo uint64, nextNo uint64) (b Block)

func (Block) Read

func (b Block) Read() (prev uint64, next uint64, p []byte)

func (Block) Write

func (b Block) Write(p []byte)

type BlockMeta

type BlockMeta map[string]string

type BlockNo

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

func (*BlockNo) Next

func (bn *BlockNo) Next(n uint64) (beg uint64, end uint64)

func (*BlockNo) Set

func (bn *BlockNo) Set(n uint64)

func (*BlockNo) Value

func (bn *BlockNo) Value() (v uint64)

type Blocks

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

func OpenBlocks

func OpenBlocks(options BlocksOpenOptions) (bs *Blocks, err error)

func (*Blocks) Close

func (bs *Blocks) Close()

func (*Blocks) Entries

func (bs *Blocks) Entries(offset uint64, length uint64) (entries EntryList, err error)

func (*Blocks) Id

func (bs *Blocks) Id() (id string)

func (*Blocks) Read

func (bs *Blocks) Read(blockNo uint64) (entry *Entry, has bool, err error)

func (*Blocks) Tail

func (bs *Blocks) Tail(ctx context.Context, offset uint64, interval time.Duration) (entries <-chan EntryList, errors <-chan error, stop func(), err error)

func (*Blocks) UpdateCacheSize

func (bs *Blocks) UpdateCacheSize(size uint64)

func (*Blocks) Write

func (bs *Blocks) Write(p []byte) (entryBeginBlockNo uint64, entryEndBlockNo uint64, err error)

type BlocksOpenOptions

type BlocksOpenOptions struct {
	Path                string
	BlockCapacity       uint64
	MaxCachedMemorySize uint64
	Meta                map[string]string
}

type Entry

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

func (*Entry) BlockNo

func (e *Entry) BlockNo() (beg uint64, end uint64)

func (*Entry) String

func (e *Entry) String() (p string)

func (*Entry) Value

func (e *Entry) Value() (p []byte)

type EntryList

type EntryList []*Entry

func (*EntryList) Append

func (p *EntryList) Append(e *Entry)

func (EntryList) Last

func (p EntryList) Last() (entry *Entry)

func (EntryList) Len

func (p EntryList) Len() int

func (EntryList) Less

func (p EntryList) Less(i, j int) bool

func (EntryList) String

func (p EntryList) String() string

func (EntryList) Swap

func (p EntryList) Swap(i, j int)

Jump to

Keyboard shortcuts

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