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 ¶
- type Community
- type Count
- type CountConfig
- type CountExports
- type Experimental
- type Fake
- type IntReceiver
- type IntReceiverImpl
- type Passthrough
- type PassthroughConfig
- type PassthroughExports
- type Pulse
- type PulseConfig
- type StringReceiver
- type StringReceiverComponent
- type StringReceiverConfig
- type StringReceiverExports
- type StringReceiverImpl
- type Stringer
- type StringerConfig
- type Summation
- type SummationConfig
- type SummationExports
- type SummationReceiver
- type SummationReceiverConfig
- type SummationReceiverExports
- type Tick
- type TickConfig
- type TickExports
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Community ¶ added in v1.3.0
type Community struct {
// contains filtered or unexported fields
}
Community is a test community component.
type CountConfig ¶
type CountExports ¶
type CountExports struct {
Count int `alloy:"count,attr,optional"`
}
type Experimental ¶
type Experimental struct {
// contains filtered or unexported fields
}
Experimental is a test component that is marked as experimental. Used to verify stability level checking.
type Fake ¶
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 ¶
Run implements component.Component. f.RunFunc will be invoked if it is non-nil, otherwise a default implementation is used.
type IntReceiver ¶ added in v1.7.0
type IntReceiver interface {
ReceiveInt(int)
}
type IntReceiverImpl ¶ added in v1.7.0
type IntReceiverImpl struct {
// contains filtered or unexported fields
}
func (IntReceiverImpl) ReceiveInt ¶ added in v1.7.0
func (r IntReceiverImpl) ReceiveInt(i int)
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 `alloy:"input,attr"`
Lag time.Duration `alloy:"lag,attr,optional"`
}
PassthroughConfig configures the testcomponents.passthrough component.
type PassthroughExports ¶
type PassthroughExports struct {
Output string `alloy:"output,attr,optional"`
}
PassthroughExports describes exported fields for the testcomponents.passthrough component.
type PulseConfig ¶ added in v1.7.0
type PulseConfig struct {
Frequency time.Duration `alloy:"frequency,attr"`
Max int `alloy:"max,attr"`
ForwardTo []IntReceiver `alloy:"forward_to,attr,optional"`
}
type StringReceiver ¶ added in v1.7.0
type StringReceiver interface {
Receive(string)
}
type StringReceiverComponent ¶ added in v1.7.0
type StringReceiverComponent struct {
// contains filtered or unexported fields
}
func NewStringReceiverComp ¶ added in v1.7.0
func NewStringReceiverComp(o component.Options, cfg StringReceiverConfig) (*StringReceiverComponent, error)
NewStringReceiver creates a new string_receiver component.
func (*StringReceiverComponent) DebugInfo ¶ added in v1.7.0
func (s *StringReceiverComponent) DebugInfo() interface{}
Return the receiver as debug info instead of export to avoid evaluation loop.
type StringReceiverConfig ¶ added in v1.7.0
type StringReceiverConfig struct {
}
type StringReceiverExports ¶ added in v1.7.0
type StringReceiverExports struct {
Receiver StringReceiver `alloy:"receiver,attr"`
}
type StringReceiverImpl ¶ added in v1.7.0
type StringReceiverImpl struct {
// contains filtered or unexported fields
}
func (StringReceiverImpl) Receive ¶ added in v1.7.0
func (r StringReceiverImpl) Receive(s string)
type Stringer ¶ added in v1.7.0
type Stringer struct {
// contains filtered or unexported fields
}
func NewStringer ¶ added in v1.7.0
func NewStringer(o component.Options, cfg StringerConfig) (*Stringer, error)
type StringerConfig ¶ added in v1.7.0
type StringerConfig struct {
InputString *string `alloy:"input_string,attr,optional"`
InputInt *int `alloy:"input_int,attr,optional"`
InputFloat *float64 `alloy:"input_float,attr,optional"`
InputBool *bool `alloy:"input_bool,attr,optional"`
InputMap *map[string]any `alloy:"input_map,attr,optional"`
InputArray *[]any `alloy:"input_array,attr,optional"`
ForwardTo []StringReceiver `alloy:"forward_to,attr"`
}
type Summation ¶
type Summation struct {
// contains filtered or unexported fields
}
func NewSummation ¶
func NewSummation(o component.Options, cfg SummationConfig) (*Summation, error)
NewSummation creates a new summation component.
type SummationConfig ¶
type SummationConfig struct {
Input int `alloy:"input,attr"`
}
type SummationExports ¶
type SummationReceiver ¶ added in v1.7.0
type SummationReceiver struct {
// contains filtered or unexported fields
}
func NewSummationReceiver ¶ added in v1.7.0
func NewSummationReceiver(o component.Options, cfg SummationReceiverConfig) (*SummationReceiver, error)
NewSummationReceiver creates a new summation component.
func (*SummationReceiver) DebugInfo ¶ added in v1.7.0
func (s *SummationReceiver) DebugInfo() interface{}
Return the sum as debug info instead of export to avoid evaluation loop.
type SummationReceiverConfig ¶ added in v1.7.0
type SummationReceiverConfig struct {
}
type SummationReceiverExports ¶ added in v1.7.0
type SummationReceiverExports struct {
Receiver IntReceiver `alloy:"receiver,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 ¶
TickConfig configures the testcomponents.tick component.
type TickExports ¶
TickExports describes exported fields for the testcomponents.tick component.