multilog

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 10 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSublogNotFound = errors.New("multilog: requested sublog not found")
	ErrSublogDeleted  = errors.New("multilog: stored sublog was deleted. please re-open")
)

Functions

func Has

func Has(mlog MultiLog, addr indexes.Addr) (bool, error)

Types

type Func

type Func func(ctx context.Context, seq int64, value interface{}, mlog MultiLog) error

Func is a processing function that consumes a stream and sets values in the multilog.

type MultiLog

type MultiLog interface {
	Get(indexes.Addr) (margaret.Log, error)
	List() ([]indexes.Addr, error)

	io.Closer

	Flush() error

	// Delete removes all entries related to that log
	Delete(indexes.Addr) error
}

MultiLog is a collection of logs, keyed by a indexes.Addr

type Sink

type Sink interface {
	luigi.Sink
	QuerySpec() margaret.QuerySpec
}

Sink is both a multilog and a luigi sink. Pouring values into it will append values to the multilog, usually by calling a user-defined processing function.

func NewSink

func NewSink(file *os.File, mlog MultiLog, f Func) Sink

NewSink makes a new Sink by wrapping a MultiLog and a processing function of type Func.

Directories

Path Synopsis
fs
mkv
all

Jump to

Keyboard shortcuts

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