db

package
v0.0.0-...-3ddf8cf Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process func(value []byte) error

type Runner

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

Runner provides streaming operations on badger.DB.

func NewRunner

func NewRunner(path string, parallel int) *Runner

func (*Runner) Process

func (r *Runner) Process(ctx context.Context, process Process, errs chan<- error) (*sync.WaitGroup, error)

Process runs process on each Value in the database. process must be thread-safe as it may be called simultaneously by multiple threads.

Returns a WaitGroup which finishes after the last Value from the DB has been processed.

func (*Runner) ProcessIDs

func (r *Runner) ProcessIDs(ctx context.Context, process Process, ids <-chan uint32, errs chan<- error) (*sync.WaitGroup, error)

ProcessIDs runs process on each id's corresponding value. process must be thread-safe as it may be called simultaneously by multiple threads.

Returns a WaitGroup which finishes after the last id has been processed.

func (*Runner) Write

func (r *Runner) Write() protos.Sink

Write writes all protos to the Runner's DB.

Jump to

Keyboard shortcuts

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