Documentation
¶
Index ¶
Constants ¶
const ( // TypeBenthos is used to select a Benthos producer. TypeBenthos = "BENTHOS" // TypePOST is used to select an HTTP POST client. TypePOST = "POST" // TypeNull is used to disable event production. TypeNull = "NULL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BenthosComponent ¶
type BenthosComponent struct{}
BenthosComponent is a component for creating a Benthos producer.
func NewBenthosComponent ¶
func NewBenthosComponent() *BenthosComponent
NewBenthosComponent generates a ProducerBenthosComponent and populates it with defaults
func (*BenthosComponent) New ¶
func (*BenthosComponent) New(ctx context.Context, conf *BenthosConfig) (Producer, error)
New constructs a benthos producer.
func (*BenthosComponent) Settings ¶
func (*BenthosComponent) Settings() *BenthosConfig
Settings returns the default configuration.
type BenthosConfig ¶
type BenthosConfig struct {
YAML string `description:"The YAML or JSON text of a Benthos configuration."`
}
BenthosConfig adapts the Benthos configuration system to this one.
type Component ¶ added in v0.2.0
type Component struct { Benthos *BenthosComponent POST *POSTComponent Null *NullComponent }
Component is the top level producer component.
func NewComponent ¶ added in v0.2.0
func NewComponent() *Component
NewComponent populates a ProducerComponent with defaults.
type Config ¶ added in v0.2.0
type Config struct { Type string `default:"The type of producer. The choices are BENTHOS and POST."` Benthos *BenthosConfig POST *POSTConfig Null *NullConfig }
Config wraps all producer related configuration.
type NullComponent ¶ added in v0.3.0
type NullComponent struct{}
NullComponent is a component for creating an HTTP POST producer.
func NewNullComponent ¶ added in v0.3.0
func NewNullComponent() *NullComponent
NewNullComponent populates a NullComponentt with defaults.
func (*NullComponent) New ¶ added in v0.3.0
func (c *NullComponent) New(ctx context.Context, conf *NullConfig) (Producer, error)
New constructs a benthos configuration.
func (*NullComponent) Settings ¶ added in v0.3.0
func (c *NullComponent) Settings() *NullConfig
Settings returns the default configuration.
type NullConfig ¶ added in v0.3.0
type NullConfig struct{}
NullConfig contains settings for the Null producer.
func (*NullConfig) Name ¶ added in v0.3.0
func (*NullConfig) Name() string
Name of the configuration section.
type POSTComponent ¶
type POSTComponent struct {
HTTP *httpclient.Component
}
POSTComponent is a component for creating an HTTP POST producer.
func NewPOSTComponent ¶
func NewPOSTComponent() *POSTComponent
NewPOSTComponent populates a ProducerPOSTComponent with defaults.
func (*POSTComponent) New ¶
func (c *POSTComponent) New(ctx context.Context, conf *POSTConfig) (Producer, error)
New constructs a benthos configuration.
func (*POSTComponent) Settings ¶
func (c *POSTComponent) Settings() *POSTConfig
Settings returns the default configuration.
type POSTConfig ¶
type POSTConfig struct { Endpoint string `description:"The URL to POST."` HTTPClient *httpclient.Config }
POSTConfig contains settings for the HTTP POST producer.
type Producer ¶
type Producer interface { // Produce ships the event to the destination and returns the final // version of the data sent. Produce(ctx context.Context, event interface{}) (interface{}, error) }
Producer is the interface used for sending all events to a destination.