coretest

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestInputFormat

func NewTestInputFormat(core.Context) (core.InputFormat, error)

NewTestInputFormat creates a new test input format.

func NewTestOutputFormat

func NewTestOutputFormat(ctx core.Context) (core.OutputFormat, error)

NewTestOutputFormat creates a new test output format.

func NewTestOutputFormatNoErr

func NewTestOutputFormatNoErr(ctx core.Context) core.OutputFormat

NewTestOutputFormatNoErr creates a new test output format and returns it as a single value so errors don't have to be tested.

func NewTestSource

func NewTestSource(core.Context) (core.Source, error)

NewTestSource creates a new test source.

Types

type TestDoubleInputModifier

type TestDoubleInputModifier struct {
	OptCloseErr error
}

TestDoubleInputModifier doubles the input stream.

func (*TestDoubleInputModifier) Wrap

Wrap wraps.

type TestDoubleOutputModifier

type TestDoubleOutputModifier struct {
	OptCloseErr error
}

TestDoubleOutputModifier doubles the output stream.

func (*TestDoubleOutputModifier) Wrap

Wrap wraps.

type TestErrInputModifier

type TestErrInputModifier struct {
	Err error
}

TestErrInputModifier is a test input modifier that returns an error on wrap.

func (*TestErrInputModifier) Wrap

Wrap returns an error.

type TestErrOutputModifier

type TestErrOutputModifier struct {
	Err error
}

TestErrOutputModifier is a test output modifier that returns an error on wrap.

func (*TestErrOutputModifier) Wrap

Wrap retuns an error.

type TestSink

type TestSink struct {
	OptCloseErr error
	// contains filtered or unexported fields
}

TestSink is a test sink of bytes.

func (*TestSink) Close

func (s *TestSink) Close() error

Close closes the sink.

func (*TestSink) Data

func (s *TestSink) Data() []byte

Data returns the data from the sink.

func (*TestSink) Init

func (*TestSink) Init(core.Context)

Init initializes the sink.

func (*TestSink) Write

func (s *TestSink) Write(p []byte) (int, error)

Write writes data to the sink.

type TestSinkInt

type TestSinkInt struct {
	OptCloseErr error
	// contains filtered or unexported fields
}

TestSinkInt is a test sink of ints.

func (*TestSinkInt) Close

func (s *TestSinkInt) Close() error

Close closes the sink.

func (*TestSinkInt) Data

func (s *TestSinkInt) Data() []int

Data returns the data from the sink.

func (*TestSinkInt) Init

func (*TestSinkInt) Init(core.Context)

Init initializes the sink.

func (*TestSinkInt) Write

func (s *TestSinkInt) Write(p []byte) (int, error)

Write writes data to the sink.

type TestSource

type TestSource struct {
	Data []core.InputReader
	// contains filtered or unexported fields
}

TestSource is a test source.

func NewTestSourceData

func NewTestSourceData(data []core.InputReader) *TestSource

NewTestSourceData creates a new test source prefilled with a certain set of data.

func (*TestSource) Init

func (s *TestSource) Init(ctx core.Context)

Init initializes the test source.

func (*TestSource) Streams

func (s *TestSource) Streams() <-chan core.InputReader

Streams returns a channel of source streams.

Jump to

Keyboard shortcuts

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