silo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadingNextInput     = errors.New("error while reading next input")
	ErrPersistingData       = errors.New("error while persisting data")
	ErrReadingPersistedData = errors.New("error while reading persisted data")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Store(key DataNode, value DataNode) error
	Snapshot() Snapshot
	Close() error
}

type BackendInMemory

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

func NewBackendInMemory

func NewBackendInMemory() *BackendInMemory

func (*BackendInMemory) Close

func (b *BackendInMemory) Close() error

func (*BackendInMemory) Next

func (b *BackendInMemory) Next() (DataNode, bool, error)

func (*BackendInMemory) PullAll

func (b *BackendInMemory) PullAll(node DataNode) ([]DataNode, error)

func (*BackendInMemory) Snapshot

func (b *BackendInMemory) Snapshot() Snapshot

func (*BackendInMemory) Store

func (b *BackendInMemory) Store(key DataNode, value DataNode) error

type ConfigScanAliasIsNotIncludedError added in v0.2.0

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

func (*ConfigScanAliasIsNotIncludedError) Error added in v0.2.0

type DataLink struct {
	E1 DataNode
	E2 DataNode
}

type DataNode

type DataNode struct {
	Key  string
	Data any
}

func DecodeDataNode

func DecodeDataNode(data []byte) (DataNode, error)

func (DataNode) Binary

func (n DataNode) Binary() ([]byte, error)

func (DataNode) String

func (n DataNode) String() string

type DataRow

type DataRow map[string]any

type DataRowReader

type DataRowReader interface {
	ReadDataRow() (DataRow, error)
	Close() error
}

type DataRowReaderInMemory

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

func NewDataRowReaderInMemory

func NewDataRowReaderInMemory(rows []DataRow) *DataRowReaderInMemory

func (*DataRowReaderInMemory) Close

func (r *DataRowReaderInMemory) Close() error

func (*DataRowReaderInMemory) ReadDataRow

func (r *DataRowReaderInMemory) ReadDataRow() (DataRow, error)

type Driver

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

func NewDriver

func NewDriver(backend Backend, writer DumpWriter, options ...Option) *Driver

func (*Driver) Dump

func (d *Driver) Dump(observers ...DumpObserver) error

func (*Driver) Scan

func (d *Driver) Scan(input DataRowReader, observers ...ScanObserver) error

type DumpObserver added in v0.2.0

type DumpObserver interface {
	Entity(status Status, counts map[string]int)
}

type DumpToStdout

type DumpToStdout struct{}

func NewDumpToStdout

func NewDumpToStdout() *DumpToStdout

func (*DumpToStdout) Close

func (d *DumpToStdout) Close() error

func (*DumpToStdout) Write

func (d *DumpToStdout) Write(node DataNode, uuid string) error

type DumpWriter

type DumpWriter interface {
	Write(node DataNode, uuid string) error
	Close() error
}

type Entity

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

func NewEntity

func NewEntity(include []string, nodes ...DataNode) Entity

func (Entity) Append

func (s Entity) Append(node DataNode) bool

func (Entity) Finalize

func (s Entity) Finalize() (Status, map[string]int)

func (Entity) UUID

func (s Entity) UUID() string

type Option added in v0.2.0

type Option interface {
	// contains filtered or unexported methods
}

func Alias added in v0.2.0

func Alias(key, alias string) Option

func Include added in v0.2.0

func Include(key string) Option

func WithAliases added in v0.2.0

func WithAliases(aliases map[string]string) Option

func WithKeys added in v0.2.0

func WithKeys(keys []string) Option

type ScanObserver

type ScanObserver interface {
	IngestedRow(row DataRow)
	IngestedLink(link DataLink)
}

type Snapshot

type Snapshot interface {
	Next() (DataNode, bool, error)
	PullAll(node DataNode) ([]DataNode, error)
	Close() error
}

type Status added in v0.2.0

type Status string
const (
	StatusEntityComplete     Status = "complete"
	StatusEntityConsistent   Status = "consistent"
	StatusEntityInconsistent Status = "inconsistent"
	StatusEntityEmpty        Status = "empty"
)

Jump to

Keyboard shortcuts

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