source

package
v0.0.0-...-56027fb Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed     = errors.New("source is closed")
	ErrNilElement = errors.New("nil element")
)
View Source
var (
	ErrInvalidMode = errors.New("invalid mode")
)

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Build() (Source, error)

	WithOption(Option) Builder
}

func NewBuilder

func NewBuilder() Builder

type Mode

type Mode int
const (
	Local Mode = iota
	Remote
)

func (Mode) String

func (m Mode) String() string

type Option

type Option interface {
	fmt.Stringer

	Mode() Mode
	BufferSize() int

	WithMode(Mode) Option

	Check() error
}

func NewOption

func NewOption() Option

type Source

type Source interface {
	common.Closer

	Emit(element.Element) error

	HasNext() bool
	Next()
	Current() element.Element
}

Jump to

Keyboard shortcuts

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