pack

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultInterval  = 1 * time.Minute
	DefaultMinSize   = 60 * memory.MiB
	DefaultMaxSize   = 62 * memory.MiB
	DefaultMaxBlocks = 100 * 1000
	MaxBlockSize     = 1 * memory.MiB
)
View Source
const (
	Unpacked = Status(db.UnpackedStatus)
	Packing  = Status(db.PackingStatus)
	Packed   = Status(db.PackedStatus)
)

Variables

View Source
var Error = errs.Class("pack")

Error is the error class for pack chore.

Functions

This section is empty.

Types

type Chore

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

func NewChore

func NewChore(db *db.DB, packs *Store) *Chore

func (*Chore) Close

func (chore *Chore) Close() error

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context)

func (*Chore) TriggerWait

func (chore *Chore) TriggerWait()

func (*Chore) WithInterval

func (chore *Chore) WithInterval(interval time.Duration) *Chore

func (*Chore) WithPackSize

func (chore *Chore) WithPackSize(minSize, maxSize, maxBlocks int) *Chore

type Status

type Status int

type Store

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

func NewStore

func NewStore(project *uplink.Project, bucket string) *Store

func (*Store) ReadBlock

func (store *Store) ReadBlock(ctx context.Context, packObject string, packOffset, size int) (data []byte, err error)

func (*Store) WritePack

func (store *Store) WritePack(ctx context.Context, blocks map[string][]byte) (packObjectKey string, cidOffs map[string]int, err error)

Jump to

Keyboard shortcuts

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