package multilog

import "go.cryptoscope.co/margaret/multilog"

Index

Variables

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.

Source Files

multilog.go sink.go

Directories

PathSynopsis
multilog/roaring
multilog/roaring/badger
multilog/roaring/badger/cmd
multilog/roaring/badger/cmd/mbdump
multilog/roaring/fs
multilog/roaring/mkv
multilog/roaring/sqlite
multilog/roaring/test
multilog/test
multilog/test/all
Version
v0.4.3 (latest)
Published
Feb 17, 2022
Platform
linux/amd64
Imports
10 packages
Last checked
11 hours ago

Tools for package owners.