Documentation
¶
Overview ¶
Package testcomponents contains components useful for testing. They are not intended to be exposed by end users and so this package should only be imported in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Count ¶ added in v0.37.0
type Count struct {
// contains filtered or unexported fields
}
type CountConfig ¶ added in v0.37.0
type CountConfig struct {
Frequency time.Duration `river:"frequency,attr"`
Max int `river:"max,attr"`
}
type CountExports ¶ added in v0.37.0
type CountExports struct {
Count int `river:"count,attr,optional"`
}
type Fake ¶ added in v0.36.0
type Fake struct {
RunFunc func(ctx context.Context) error
UpdateFunc func(args component.Arguments) error
}
Fake is a fake component instance which invokes fields when its methods are called. Fake does not register itself as a component and must be provided in a custom registry.
The zero value is ready for use.
func (*Fake) Run ¶ added in v0.36.0
func (f *Fake) Run(ctx context.Context) error
Run implements component.Component. f.RunFunc will be invoked if it is non-nil, otherwise a default implementation is used.
func (*Fake) Update ¶ added in v0.36.0
func (f *Fake) Update(args component.Arguments) error
Update implements component.Component. f.UpdateFunc will be invoked if it is non-nil, otherwise a default implementation is used.
type Passthrough ¶
type Passthrough struct {
// contains filtered or unexported fields
}
Passthrough implements the testcomponents.passthrough component, where it always emits its input as an output.
func NewPassthrough ¶
func NewPassthrough(o component.Options, cfg PassthroughConfig) (*Passthrough, error)
NewPassthrough creates a new passthrough component.
func (*Passthrough) DebugInfo ¶
func (t *Passthrough) DebugInfo() interface{}
DebugInfo implements DebugComponent.
type PassthroughConfig ¶
type PassthroughConfig struct {
Input string `river:"input,attr"`
Lag time.Duration `river:"lag,attr,optional"`
}
PassthroughConfig configures the testcomponents.passthrough component.
type PassthroughExports ¶
type PassthroughExports struct {
Output string `river:"output,attr,optional"`
}
PassthroughExports describes exported fields for the testcomponents.passthrough component.
type Summation ¶ added in v0.37.0
type Summation struct {
// contains filtered or unexported fields
}
func NewSummation ¶ added in v0.37.0
func NewSummation(o component.Options, cfg SummationConfig) (*Summation, error)
NewSummation creates a new summation component.
type SummationConfig ¶ added in v0.37.0
type SummationConfig struct {
Input int `river:"input,attr"`
}
type SummationExports ¶ added in v0.37.0
type SummationExports struct {
Sum int `river:"sum,attr"`
LastAdded int `river:"last_added,attr"`
}
type Tick ¶
type Tick struct {
// contains filtered or unexported fields
}
Tick implements the testcomponents.tick component, where the wallclock time will be emitted on a given frequency.
type TickConfig ¶
type TickConfig struct {
Frequency time.Duration `river:"frequency,attr"`
}
TickConfig configures the testcomponents.tick component.
type TickExports ¶
type TickExports struct {
Time time.Time `river:"tick_time,attr,optional"`
}
TickExports describes exported fields for the testcomponents.tick component.