source

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeSet

type ChangeSet struct {
	Data      []byte    // binary data
	Checksum  string    // md5 sum
	Format    string    // type of the data
	Source    string    // name of the data source
	Timestamp time.Time // time stamp
}

ChangeSet represents a set of changes from a source

func (*ChangeSet) Sum

func (c *ChangeSet) Sum() string

Sum returns the md5 checksum of the ChangeSet data

type Option

type Option func(o *Options)

func WithEncoder

func WithEncoder(e encoder.Encoder) Option

WithEncoder sets the source encoder

type Options

type Options struct {
	// Encoder
	Encoder encoder.Encoder
	// for alternative data
	Context context.Context
}

func NewOptions

func NewOptions(opts ...Option) *Options

type Source

type Source interface {
	Read() (*ChangeSet, error) // read from source, to change set
	Watch() (Watcher, error)   // watch the source change
	String() string            // return the name of the data source
}

Source is configure the data source from which the data loader retrieves the raw binary data.

type Watcher added in v0.4.34

type Watcher interface {
	Next() (*ChangeSet, error) // Method returns the changed data set when the data source changes
	Stop() error               // Method stops the data source change monitor
}

Watcher is the data source change monitor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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