paper

package
v0.0.0-...-533735b Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder func(into interface{}) error

func NewlineDecoder

func NewlineDecoder(line string) (Decoder, error)

type Line

type Line struct {
	Key int64
	Decoder
}

type Page

type Page struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Page allow you to read and write values to a filer.

func InitPage

func InitPage(f filer, size int64) *Page

func NewPage

func NewPage(path string) (*Page, error)

NewPage creates a new page from a file.

func (*Page) Get

func (p *Page) Get(key int64, into interface{}) error

func (*Page) GetDecoder

func (p *Page) GetDecoder(key int64) (Decoder, error)

func (*Page) GetSize

func (p *Page) GetSize() int64

func (*Page) Iterate

func (p *Page) Iterate(ctx context.Context) <-chan Line

func (*Page) Put

func (p *Page) Put(v interface{}) (key int64, err error)

func (*Page) Walk

func (p *Page) Walk(fn func(key int64, decoder Decoder) error) error

Jump to

Keyboard shortcuts

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