writer

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 55 Imported by: 2

Documentation

Overview

Package writer defines implementations of an interface for generic message writing that outputs to various third party sinks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQP added in v0.15.1

type AMQP struct {
	// contains filtered or unexported fields
}

AMQP is an output type that serves AMQP messages.

func NewAMQP added in v0.15.1

func NewAMQP(conf AMQPConfig, log log.Modular, stats metrics.Type) (*AMQP, error)

NewAMQP creates a new AMQP writer type.

func (*AMQP) CloseAsync added in v0.15.1

func (a *AMQP) CloseAsync()

CloseAsync shuts down the AMQP output and stops processing messages.

func (*AMQP) Connect added in v0.15.1

func (a *AMQP) Connect() error

Connect establishes a connection to an AMQP server.

func (*AMQP) WaitForClose added in v0.15.1

func (a *AMQP) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the AMQP output has closed down.

func (*AMQP) Write added in v0.15.1

func (a *AMQP) Write(msg types.Message) error

Write will attempt to write a message over AMQP, wait for acknowledgement, and returns an error if applicable.

type AMQPConfig added in v0.15.1

type AMQPConfig struct {
	URL             string                    `json:"url" yaml:"url"`
	Exchange        string                    `json:"exchange" yaml:"exchange"`
	ExchangeDeclare AMQPExchangeDeclareConfig `json:"exchange_declare" yaml:"exchange_declare"`
	BindingKey      string                    `json:"key" yaml:"key"`
	Persistent      bool                      `json:"persistent" yaml:"persistent"`
	Mandatory       bool                      `json:"mandatory" yaml:"mandatory"`
	Immediate       bool                      `json:"immediate" yaml:"immediate"`
	TLS             btls.Config               `json:"tls" yaml:"tls"`
}

AMQPConfig contains configuration fields for the AMQP output type.

func NewAMQPConfig added in v0.15.1

func NewAMQPConfig() AMQPConfig

NewAMQPConfig creates a new AMQPConfig with default values.

type AMQPExchangeDeclareConfig added in v0.24.0

type AMQPExchangeDeclareConfig struct {
	Enabled bool   `json:"enabled" yaml:"enabled"`
	Type    string `json:"type" yaml:"type"`
	Durable bool   `json:"durable" yaml:"durable"`
}

AMQPExchangeDeclareConfig contains fields indicating whether the target AMQP exchange needs to be declared, as well as any fields specifying how to accomplish that.

type AmazonS3 added in v0.7.5

type AmazonS3 struct {
	// contains filtered or unexported fields
}

AmazonS3 is a benthos writer.Type implementation that writes messages to an Amazon S3 bucket.

func NewAmazonS3 added in v0.7.5

func NewAmazonS3(
	conf AmazonS3Config,
	log log.Modular,
	stats metrics.Type,
) (*AmazonS3, error)

NewAmazonS3 creates a new Amazon S3 bucket writer.Type.

func (*AmazonS3) CloseAsync added in v0.7.5

func (a *AmazonS3) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*AmazonS3) Connect added in v0.7.5

func (a *AmazonS3) Connect() error

Connect attempts to establish a connection to the target S3 bucket.

func (*AmazonS3) WaitForClose added in v0.7.5

func (a *AmazonS3) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*AmazonS3) Write added in v0.7.5

func (a *AmazonS3) Write(msg types.Message) error

Write attempts to write message contents to a target S3 bucket as files.

type AmazonS3Config added in v0.7.5

type AmazonS3Config struct {
	sess.Config        `json:",inline" yaml:",inline"`
	Bucket             string `json:"bucket" yaml:"bucket"`
	ForcePathStyleURLs bool   `json:"force_path_style_urls" yaml:"force_path_style_urls"`
	Path               string `json:"path" yaml:"path"`
	ContentType        string `json:"content_type" yaml:"content_type"`
	ContentEncoding    string `json:"content_encoding" yaml:"content_encoding"`
	Timeout            string `json:"timeout" yaml:"timeout"`
}

AmazonS3Config contains configuration fields for the AmazonS3 output type.

func NewAmazonS3Config added in v0.7.5

func NewAmazonS3Config() AmazonS3Config

NewAmazonS3Config creates a new Config with default values.

type AmazonSQS added in v0.8.1

type AmazonSQS struct {
	// contains filtered or unexported fields
}

AmazonSQS is a benthos writer.Type implementation that writes messages to an Amazon SQS queue.

func NewAmazonSQS added in v0.8.1

func NewAmazonSQS(
	conf AmazonSQSConfig,
	log log.Modular,
	stats metrics.Type,
) (*AmazonSQS, error)

NewAmazonSQS creates a new Amazon SQS writer.Type.

func (*AmazonSQS) CloseAsync added in v0.8.1

func (a *AmazonSQS) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*AmazonSQS) Connect added in v0.8.1

func (a *AmazonSQS) Connect() error

Connect attempts to establish a connection to the target SQS queue.

func (*AmazonSQS) WaitForClose added in v0.8.1

func (a *AmazonSQS) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*AmazonSQS) Write added in v0.8.1

func (a *AmazonSQS) Write(msg types.Message) error

Write attempts to write message contents to a target SQS.

type AmazonSQSConfig added in v0.8.1

type AmazonSQSConfig struct {
	URL            string `json:"url" yaml:"url"`
	retries.Config `json:",inline" yaml:",inline"`
	// contains filtered or unexported fields
}

AmazonSQSConfig contains configuration fields for the output AmazonSQS type.

func NewAmazonSQSConfig added in v0.8.1

func NewAmazonSQSConfig() AmazonSQSConfig

NewAmazonSQSConfig creates a new Config with default values.

type Cache added in v0.35.0

type Cache struct {
	// contains filtered or unexported fields
}

Cache is a benthos writer.Type implementation that writes messages to a Cache directory.

func NewCache added in v0.35.0

func NewCache(
	conf CacheConfig,
	mgr types.Manager,
	log log.Modular,
	stats metrics.Type,
) (*Cache, error)

NewCache creates a new Cache writer.Type.

func (*Cache) CloseAsync added in v0.35.0

func (c *Cache) CloseAsync()

CloseAsync begins cleaning up resources used by this writer asynchronously.

func (*Cache) Connect added in v0.35.0

func (c *Cache) Connect() error

Connect does nothing.

func (*Cache) WaitForClose added in v0.35.0

func (c *Cache) WaitForClose(time.Duration) error

WaitForClose will block until either the writer is closed or a specified timeout occurs.

func (*Cache) Write added in v0.35.0

func (c *Cache) Write(msg types.Message) error

Write attempts to write message contents to a target Cache directory as files.

type CacheConfig added in v0.35.0

type CacheConfig struct {
	Target string `json:"target" yaml:"target"`
	Key    string `json:"key" yaml:"key"`
}

CacheConfig contains configuration fields for the Cache output type.

func NewCacheConfig added in v0.35.0

func NewCacheConfig() CacheConfig

NewCacheConfig creates a new Config with default values.

type Drop added in v1.14.0

type Drop struct {
	// contains filtered or unexported fields
}

Drop is a benthos writer.Type implementation that writes message parts to no where.

func NewDrop added in v1.14.0

func NewDrop(
	conf DropConfig,
	log log.Modular,
	stats metrics.Type,
) *Drop

NewDrop creates a new file based writer.Type.

func (*Drop) CloseAsync added in v1.14.0

func (d *Drop) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*Drop) Connect added in v1.14.0

func (d *Drop) Connect() error

Connect is a noop.

func (*Drop) WaitForClose added in v1.14.0

func (d *Drop) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*Drop) Write added in v1.14.0

func (d *Drop) Write(msg types.Message) error

Write does nothing.

type DropConfig added in v1.14.0

type DropConfig struct{}

DropConfig contains configuration fields for the drop output type.

func NewDropConfig added in v1.14.0

func NewDropConfig() DropConfig

NewDropConfig creates a new DropConfig with default values.

type DynamoDB added in v0.36.0

type DynamoDB struct {
	// contains filtered or unexported fields
}

DynamoDB is a benthos writer.Type implementation that writes messages to an Amazon SQS queue.

func NewDynamoDB added in v0.36.0

func NewDynamoDB(
	conf DynamoDBConfig,
	log log.Modular,
	stats metrics.Type,
) (*DynamoDB, error)

NewDynamoDB creates a new Amazon SQS writer.Type.

func (*DynamoDB) CloseAsync added in v0.36.0

func (d *DynamoDB) CloseAsync()

CloseAsync begins cleaning up resources used by this writer asynchronously.

func (*DynamoDB) Connect added in v0.36.0

func (d *DynamoDB) Connect() error

Connect attempts to establish a connection to the target SQS queue.

func (*DynamoDB) WaitForClose added in v0.36.0

func (d *DynamoDB) WaitForClose(time.Duration) error

WaitForClose will block until either the writer is closed or a specified timeout occurs.

func (*DynamoDB) Write added in v0.36.0

func (d *DynamoDB) Write(msg types.Message) error

Write attempts to write message contents to a target SQS.

type DynamoDBConfig added in v0.36.0

type DynamoDBConfig struct {
	Table          string            `json:"table" yaml:"table"`
	StringColumns  map[string]string `json:"string_columns" yaml:"string_columns"`
	JSONMapColumns map[string]string `json:"json_map_columns" yaml:"json_map_columns"`
	TTL            string            `json:"ttl" yaml:"ttl"`
	TTLKey         string            `json:"ttl_key" yaml:"ttl_key"`
	retries.Config `json:",inline" yaml:",inline"`
	// contains filtered or unexported fields
}

DynamoDBConfig contains config fields for the DynamoDB output type.

func NewDynamoDBConfig added in v0.36.0

func NewDynamoDBConfig() DynamoDBConfig

NewDynamoDBConfig creates a DynamoDBConfig populated with default values.

type Elasticsearch added in v0.10.7

type Elasticsearch struct {
	// contains filtered or unexported fields
}

Elasticsearch is a writer type that writes messages into elasticsearch.

func NewElasticsearch added in v0.10.7

func NewElasticsearch(conf ElasticsearchConfig, log log.Modular, stats metrics.Type) (*Elasticsearch, error)

NewElasticsearch creates a new Elasticsearch writer type.

func (*Elasticsearch) CloseAsync added in v0.10.7

func (e *Elasticsearch) CloseAsync()

CloseAsync shuts down the Elasticsearch writer and stops processing messages.

func (*Elasticsearch) Connect added in v0.10.7

func (e *Elasticsearch) Connect() error

Connect attempts to establish a connection to a Elasticsearch broker.

func (*Elasticsearch) WaitForClose added in v0.10.7

func (e *Elasticsearch) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the Elasticsearch writer has closed down.

func (*Elasticsearch) Write added in v0.10.7

func (e *Elasticsearch) Write(msg types.Message) error

Write will attempt to write a message to Elasticsearch, wait for acknowledgement, and returns an error if applicable.

type ElasticsearchConfig added in v0.10.7

type ElasticsearchConfig struct {
	URLs           []string             `json:"urls" yaml:"urls"`
	Sniff          bool                 `json:"sniff" yaml:"sniff"`
	ID             string               `json:"id" yaml:"id"`
	Index          string               `json:"index" yaml:"index"`
	Pipeline       string               `json:"pipeline" yaml:"pipeline"`
	Type           string               `json:"type" yaml:"type"`
	Timeout        string               `json:"timeout" yaml:"timeout"`
	Auth           auth.BasicAuthConfig `json:"basic_auth" yaml:"basic_auth"`
	AWS            OptionalAWSConfig    `json:"aws" yaml:"aws"`
	retries.Config `json:",inline" yaml:",inline"`
}

ElasticsearchConfig contains configuration fields for the Elasticsearch output type.

func NewElasticsearchConfig added in v0.10.7

func NewElasticsearchConfig() ElasticsearchConfig

NewElasticsearchConfig creates a new ElasticsearchConfig with default values.

type Files added in v0.7.7

type Files struct {
	// contains filtered or unexported fields
}

Files is a benthos writer.Type implementation that writes message parts each to their own file.

func NewFiles added in v0.7.7

func NewFiles(
	conf FilesConfig,
	log log.Modular,
	stats metrics.Type,
) *Files

NewFiles creates a new file based writer.Type.

func (*Files) CloseAsync added in v0.7.7

func (f *Files) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*Files) Connect added in v0.7.7

func (f *Files) Connect() error

Connect is a noop.

func (*Files) WaitForClose added in v0.7.7

func (f *Files) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*Files) Write added in v0.7.7

func (f *Files) Write(msg types.Message) error

Write attempts to write message contents to a directory as files.

type FilesConfig added in v0.7.7

type FilesConfig struct {
	Path string `json:"path" yaml:"path"`
}

FilesConfig contains configuration fields for the files output type.

func NewFilesConfig added in v0.7.7

func NewFilesConfig() FilesConfig

NewFilesConfig creates a new Config with default values.

type GCPPubSub added in v0.33.0

type GCPPubSub struct {
	// contains filtered or unexported fields
}

GCPPubSub is a benthos writer.Type implementation that writes messages to a GCP Pub/Sub topic.

func NewGCPPubSub added in v0.33.0

func NewGCPPubSub(
	conf GCPPubSubConfig,
	log log.Modular,
	stats metrics.Type,
) (*GCPPubSub, error)

NewGCPPubSub creates a new GCP Cloud Pub/Sub writer.Type.

func (*GCPPubSub) CloseAsync added in v0.33.0

func (c *GCPPubSub) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*GCPPubSub) Connect added in v0.33.0

func (c *GCPPubSub) Connect() error

Connect attempts to establish a connection to the target GCP Pub/Sub topic.

func (*GCPPubSub) WaitForClose added in v0.33.0

func (c *GCPPubSub) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*GCPPubSub) Write added in v0.33.0

func (c *GCPPubSub) Write(msg types.Message) error

Write attempts to write message contents to a target topic.

type GCPPubSubConfig added in v0.33.0

type GCPPubSubConfig struct {
	ProjectID string `json:"project" yaml:"project"`
	TopicID   string `json:"topic" yaml:"topic"`
}

GCPPubSubConfig contains configuration fields for the output GCPPubSub type.

func NewGCPPubSubConfig added in v0.33.0

func NewGCPPubSubConfig() GCPPubSubConfig

NewGCPPubSubConfig creates a new Config with default values.

type HDFS added in v0.30.0

type HDFS struct {
	// contains filtered or unexported fields
}

HDFS is a benthos writer.Type implementation that writes messages to a HDFS directory.

func NewHDFS added in v0.30.0

func NewHDFS(
	conf HDFSConfig,
	log log.Modular,
	stats metrics.Type,
) *HDFS

NewHDFS creates a new HDFS writer.Type.

func (*HDFS) CloseAsync added in v0.30.0

func (h *HDFS) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*HDFS) Connect added in v0.30.0

func (h *HDFS) Connect() error

Connect attempts to establish a connection to the target HDFS host.

func (*HDFS) WaitForClose added in v0.30.0

func (h *HDFS) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*HDFS) Write added in v0.30.0

func (h *HDFS) Write(msg types.Message) error

Write attempts to write message contents to a target HDFS directory as files.

type HDFSConfig added in v0.30.0

type HDFSConfig struct {
	Hosts     []string `json:"hosts" yaml:"hosts"`
	User      string   `json:"user" yaml:"user"`
	Directory string   `json:"directory" yaml:"directory"`
	Path      string   `json:"path" yaml:"path"`
}

HDFSConfig contains configuration fields for the HDFS output type.

func NewHDFSConfig added in v0.30.0

func NewHDFSConfig() HDFSConfig

NewHDFSConfig creates a new Config with default values.

type HTTPClient added in v0.14.0

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient is an output type that sends messages as HTTP requests to a target server endpoint.

func NewHTTPClient added in v0.14.0

func NewHTTPClient(
	conf HTTPClientConfig,
	mgr types.Manager,
	log log.Modular,
	stats metrics.Type,
) (*HTTPClient, error)

NewHTTPClient creates a new HTTPClient writer type.

func (*HTTPClient) CloseAsync added in v0.14.0

func (h *HTTPClient) CloseAsync()

CloseAsync shuts down the HTTPClient output and stops processing messages.

func (*HTTPClient) Connect added in v0.14.0

func (h *HTTPClient) Connect() error

Connect does nothing.

func (*HTTPClient) WaitForClose added in v0.14.0

func (h *HTTPClient) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the HTTPClient output has closed down.

func (*HTTPClient) Write added in v0.14.0

func (h *HTTPClient) Write(msg types.Message) error

Write attempts to send a message to an HTTP server, this attempt may include retries, and if all retries fail an error is returned.

type HTTPClientConfig added in v0.14.0

type HTTPClientConfig struct {
	client.Config `json:",inline" yaml:",inline"`
}

HTTPClientConfig contains configuration fields for the HTTPClient output type.

func NewHTTPClientConfig added in v0.14.0

func NewHTTPClientConfig() HTTPClientConfig

NewHTTPClientConfig creates a new HTTPClientConfig with default values.

type Kafka

type Kafka struct {
	// contains filtered or unexported fields
}

Kafka is a writer type that writes messages into kafka.

func NewKafka

func NewKafka(conf KafkaConfig, log log.Modular, stats metrics.Type) (*Kafka, error)

NewKafka creates a new Kafka writer type.

func (*Kafka) CloseAsync

func (k *Kafka) CloseAsync()

CloseAsync shuts down the Kafka writer and stops processing messages.

func (*Kafka) Connect

func (k *Kafka) Connect() error

Connect attempts to establish a connection to a Kafka broker.

func (*Kafka) WaitForClose

func (k *Kafka) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the Kafka writer has closed down.

func (*Kafka) Write

func (k *Kafka) Write(msg types.Message) error

Write will attempt to write a message to Kafka, wait for acknowledgement, and returns an error if applicable.

type KafkaConfig

type KafkaConfig struct {
	Addresses            []string    `json:"addresses" yaml:"addresses"`
	ClientID             string      `json:"client_id" yaml:"client_id"`
	Key                  string      `json:"key" yaml:"key"`
	RoundRobinPartitions bool        `json:"round_robin_partitions" yaml:"round_robin_partitions"`
	Topic                string      `json:"topic" yaml:"topic"`
	Compression          string      `json:"compression" yaml:"compression"`
	MaxMsgBytes          int         `json:"max_msg_bytes" yaml:"max_msg_bytes"`
	Timeout              string      `json:"timeout" yaml:"timeout"`
	AckReplicas          bool        `json:"ack_replicas" yaml:"ack_replicas"`
	TargetVersion        string      `json:"target_version" yaml:"target_version"`
	TLS                  btls.Config `json:"tls" yaml:"tls"`
}

KafkaConfig contains configuration fields for the Kafka output type.

func NewKafkaConfig

func NewKafkaConfig() KafkaConfig

NewKafkaConfig creates a new KafkaConfig with default values.

type Kinesis added in v0.26.0

type Kinesis struct {
	// contains filtered or unexported fields
}

Kinesis is a benthos writer.Type implementation that writes messages to an Amazon Kinesis stream.

func NewKinesis added in v0.26.0

func NewKinesis(
	conf KinesisConfig,
	log log.Modular,
	stats metrics.Type,
) (*Kinesis, error)

NewKinesis creates a new Amazon Kinesis writer.Type.

func (*Kinesis) CloseAsync added in v0.26.0

func (a *Kinesis) CloseAsync()

CloseAsync begins cleaning up resources used by this reader asynchronously.

func (*Kinesis) Connect added in v0.26.0

func (a *Kinesis) Connect() error

Connect creates a new Kinesis client and ensures that the target Kinesis stream exists.

func (*Kinesis) WaitForClose added in v0.26.0

func (a *Kinesis) WaitForClose(time.Duration) error

WaitForClose will block until either the reader is closed or a specified timeout occurs.

func (*Kinesis) Write added in v0.26.0

func (a *Kinesis) Write(msg types.Message) error

Write attempts to write message contents to a target Kinesis stream in batches of 500. If throttling is detected, failed messages are retried according to the configurable backoff settings.

type KinesisConfig added in v0.26.0

type KinesisConfig struct {
	Stream         string `json:"stream" yaml:"stream"`
	HashKey        string `json:"hash_key" yaml:"hash_key"`
	PartitionKey   string `json:"partition_key" yaml:"partition_key"`
	retries.Config `json:",inline" yaml:",inline"`
	// contains filtered or unexported fields
}

KinesisConfig contains configuration fields for the Kinesis output type.

func NewKinesisConfig added in v0.26.0

func NewKinesisConfig() KinesisConfig

NewKinesisConfig creates a new Config with default values.

type MQTT added in v0.8.7

type MQTT struct {
	// contains filtered or unexported fields
}

MQTT is an output type that serves MQTT messages.

func NewMQTT added in v0.8.7

func NewMQTT(
	conf MQTTConfig,
	log log.Modular,
	stats metrics.Type,
) (*MQTT, error)

NewMQTT creates a new MQTT output type.

func (*MQTT) CloseAsync added in v0.8.7

func (m *MQTT) CloseAsync()

CloseAsync shuts down the MQTT output and stops processing messages.

func (*MQTT) Connect added in v0.8.7

func (m *MQTT) Connect() error

Connect establishes a connection to an MQTT server.

func (*MQTT) WaitForClose added in v0.8.7

func (m *MQTT) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the MQTT output has closed down.

func (*MQTT) Write added in v0.8.7

func (m *MQTT) Write(msg types.Message) error

Write attempts to write a message by pushing it to an MQTT broker.

type MQTTConfig added in v0.8.7

type MQTTConfig struct {
	URLs     []string `json:"urls" yaml:"urls"`
	QoS      uint8    `json:"qos" yaml:"qos"`
	Topic    string   `json:"topic" yaml:"topic"`
	ClientID string   `json:"client_id" yaml:"client_id"`
}

MQTTConfig contains configuration fields for the MQTT output type.

func NewMQTTConfig added in v0.8.7

func NewMQTTConfig() MQTTConfig

NewMQTTConfig creates a new MQTTConfig with default values.

type NATS added in v0.31.2

type NATS struct {
	// contains filtered or unexported fields
}

NATS is an output type that serves NATS messages.

func (*NATS) CloseAsync added in v0.31.2

func (n *NATS) CloseAsync()

CloseAsync shuts down the MQTT output and stops processing messages.

func (*NATS) Connect added in v0.31.2

func (n *NATS) Connect() error

Connect attempts to establish a connection to NATS servers.

func (*NATS) WaitForClose added in v0.31.2

func (n *NATS) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the NATS output has closed down.

func (*NATS) Write added in v0.31.2

func (n *NATS) Write(msg types.Message) error

Write attempts to write a message.

type NATSConfig added in v0.31.2

type NATSConfig struct {
	URLs    []string `json:"urls" yaml:"urls"`
	Subject string   `json:"subject" yaml:"subject"`
}

NATSConfig contains configuration fields for the NATS output type.

func NewNATSConfig added in v0.31.2

func NewNATSConfig() NATSConfig

NewNATSConfig creates a new NATSConfig with default values.

type NATSStream added in v0.32.0

type NATSStream struct {
	// contains filtered or unexported fields
}

NATSStream is an output type that serves NATS messages.

func NewNATSStream added in v0.32.0

func NewNATSStream(conf NATSStreamConfig, log log.Modular, stats metrics.Type) (*NATSStream, error)

NewNATSStream creates a new NATS Stream output type.

func (*NATSStream) CloseAsync added in v0.32.0

func (n *NATSStream) CloseAsync()

CloseAsync shuts down the MQTT output and stops processing messages.

func (*NATSStream) Connect added in v0.32.0

func (n *NATSStream) Connect() error

Connect attempts to establish a connection to NATS servers.

func (*NATSStream) WaitForClose added in v0.32.0

func (n *NATSStream) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the NATS output has closed down.

func (*NATSStream) Write added in v0.32.0

func (n *NATSStream) Write(msg types.Message) error

Write attempts to write a message.

type NATSStreamConfig added in v0.32.0

type NATSStreamConfig struct {
	URLs      []string `json:"urls" yaml:"urls"`
	ClusterID string   `json:"cluster_id" yaml:"cluster_id"`
	ClientID  string   `json:"client_id" yaml:"client_id"`
	Subject   string   `json:"subject" yaml:"subject"`
}

NATSStreamConfig contains configuration fields for the NATSStream output type.

func NewNATSStreamConfig added in v0.32.0

func NewNATSStreamConfig() NATSStreamConfig

NewNATSStreamConfig creates a new NATSStreamConfig with default values.

type NSQ added in v0.32.0

type NSQ struct {
	// contains filtered or unexported fields
}

NSQ is an output type that serves NSQ messages.

func NewNSQ added in v0.32.0

func NewNSQ(conf NSQConfig, log log.Modular, stats metrics.Type) (*NSQ, error)

NewNSQ creates a new NSQ output type.

func (*NSQ) CloseAsync added in v0.32.0

func (n *NSQ) CloseAsync()

CloseAsync shuts down the NSQ output and stops processing messages.

func (*NSQ) Connect added in v0.32.0

func (n *NSQ) Connect() error

Connect attempts to establish a connection to NSQ servers.

func (*NSQ) WaitForClose added in v0.32.0

func (n *NSQ) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the NSQ output has closed down.

func (*NSQ) Write added in v0.32.0

func (n *NSQ) Write(msg types.Message) error

Write attempts to write a message.

type NSQConfig added in v0.32.0

type NSQConfig struct {
	Address   string `json:"nsqd_tcp_address" yaml:"nsqd_tcp_address"`
	Topic     string `json:"topic" yaml:"topic"`
	UserAgent string `json:"user_agent" yaml:"user_agent"`
}

NSQConfig contains configuration fields for the NSQ output type.

func NewNSQConfig added in v0.32.0

func NewNSQConfig() NSQConfig

NewNSQConfig creates a new NSQConfig with default values.

type Nanomsg added in v0.32.0

type Nanomsg struct {
	// contains filtered or unexported fields
}

Nanomsg is an output type that serves Nanomsg messages.

func NewNanomsg added in v0.32.0

func NewNanomsg(conf NanomsgConfig, log log.Modular, stats metrics.Type) (*Nanomsg, error)

NewNanomsg creates a new Nanomsg output type.

func (*Nanomsg) CloseAsync added in v0.32.0

func (s *Nanomsg) CloseAsync()

CloseAsync shuts down the Nanomsg output and stops processing messages.

func (*Nanomsg) Connect added in v0.32.0

func (s *Nanomsg) Connect() error

Connect establishes a connection to a nanomsg socket.

func (*Nanomsg) WaitForClose added in v0.32.0

func (s *Nanomsg) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the Nanomsg output has closed down.

func (*Nanomsg) Write added in v0.32.0

func (s *Nanomsg) Write(msg types.Message) error

Write attempts to write a message by pushing it to a nanomsg socket.

type NanomsgConfig added in v0.32.0

type NanomsgConfig struct {
	URLs        []string `json:"urls" yaml:"urls"`
	Bind        bool     `json:"bind" yaml:"bind"`
	SocketType  string   `json:"socket_type" yaml:"socket_type"`
	PollTimeout string   `json:"poll_timeout" yaml:"poll_timeout"`
}

NanomsgConfig contains configuration fields for the Nanomsg output type.

func NewNanomsgConfig added in v0.32.0

func NewNanomsgConfig() NanomsgConfig

NewNanomsgConfig creates a new NanomsgConfig with default values.

type OptionalAWSConfig added in v0.36.1

type OptionalAWSConfig struct {
	Enabled     bool `json:"enabled" yaml:"enabled"`
	sess.Config `json:",inline" yaml:",inline"`
}

OptionalAWSConfig contains config fields for AWS authentication with an enable flag.

type RedisList

type RedisList struct {
	// contains filtered or unexported fields
}

RedisList is an output type that serves RedisList messages.

func NewRedisList

func NewRedisList(
	conf RedisListConfig,
	log log.Modular,
	stats metrics.Type,
) (*RedisList, error)

NewRedisList creates a new RedisList output type.

func (*RedisList) CloseAsync

func (r *RedisList) CloseAsync()

CloseAsync shuts down the RedisList output and stops processing messages.

func (*RedisList) Connect

func (r *RedisList) Connect() error

Connect establishes a connection to an RedisList server.

func (*RedisList) WaitForClose

func (r *RedisList) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the RedisList output has closed down.

func (*RedisList) Write

func (r *RedisList) Write(msg types.Message) error

Write attempts to write a message by pushing it to the end of a Redis list.

type RedisListConfig

type RedisListConfig struct {
	URL string `json:"url" yaml:"url"`
	Key string `json:"key" yaml:"key"`
}

RedisListConfig contains configuration fields for the RedisList output type.

func NewRedisListConfig

func NewRedisListConfig() RedisListConfig

NewRedisListConfig creates a new RedisListConfig with default values.

type RedisPubSub added in v0.26.1

type RedisPubSub struct {
	// contains filtered or unexported fields
}

RedisPubSub is an output type that serves RedisPubSub messages.

func NewRedisPubSub added in v0.26.1

func NewRedisPubSub(
	conf RedisPubSubConfig,
	log log.Modular,
	stats metrics.Type,
) (*RedisPubSub, error)

NewRedisPubSub creates a new RedisPubSub output type.

func (*RedisPubSub) CloseAsync added in v0.26.1

func (r *RedisPubSub) CloseAsync()

CloseAsync shuts down the RedisPubSub output and stops processing messages.

func (*RedisPubSub) Connect added in v0.26.1

func (r *RedisPubSub) Connect() error

Connect establishes a connection to an RedisPubSub server.

func (*RedisPubSub) WaitForClose added in v0.26.1

func (r *RedisPubSub) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the RedisPubSub output has closed down.

func (*RedisPubSub) Write added in v0.26.1

func (r *RedisPubSub) Write(msg types.Message) error

Write attempts to write a message by pushing it to the end of a Redis list.

type RedisPubSubConfig added in v0.26.1

type RedisPubSubConfig struct {
	URL     string `json:"url" yaml:"url"`
	Channel string `json:"channel" yaml:"channel"`
}

RedisPubSubConfig contains configuration fields for the RedisPubSub output type.

func NewRedisPubSubConfig added in v0.26.1

func NewRedisPubSubConfig() RedisPubSubConfig

NewRedisPubSubConfig creates a new RedisPubSubConfig with default values.

type RedisStreams added in v0.26.1

type RedisStreams struct {
	// contains filtered or unexported fields
}

RedisStreams is an output type that serves RedisStreams messages.

func NewRedisStreams added in v0.26.1

func NewRedisStreams(
	conf RedisStreamsConfig,
	log log.Modular,
	stats metrics.Type,
) (*RedisStreams, error)

NewRedisStreams creates a new RedisStreams output type.

func (*RedisStreams) CloseAsync added in v0.26.1

func (r *RedisStreams) CloseAsync()

CloseAsync shuts down the RedisStreams output and stops processing messages.

func (*RedisStreams) Connect added in v0.26.1

func (r *RedisStreams) Connect() error

Connect establishes a connection to an RedisStreams server.

func (*RedisStreams) WaitForClose added in v0.26.1

func (r *RedisStreams) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the RedisStreams output has closed down.

func (*RedisStreams) Write added in v0.26.1

func (r *RedisStreams) Write(msg types.Message) error

Write attempts to write a message by pushing it to the end of a Redis list.

type RedisStreamsConfig added in v0.26.1

type RedisStreamsConfig struct {
	URL          string `json:"url" yaml:"url"`
	Stream       string `json:"stream" yaml:"stream"`
	BodyKey      string `json:"body_key" yaml:"body_key"`
	MaxLenApprox int64  `json:"max_length" yaml:"max_length"`
}

RedisStreamsConfig contains configuration fields for the RedisStreams output type.

func NewRedisStreamsConfig added in v0.26.1

func NewRedisStreamsConfig() RedisStreamsConfig

NewRedisStreamsConfig creates a new RedisStreamsConfig with default values.

type Type

type Type interface {
	// Connect attempts to establish a connection to the sink, if unsuccessful
	// returns an error. If the attempt is successful (or not necessary) returns
	// nil.
	Connect() error

	// Write should block until either the message is sent (and acknowledged) to
	// a sink, or a transport specific error has occurred, or the Type is
	// closed.
	Write(msg types.Message) error

	types.Closable
}

Type is a type that writes Benthos messages to a third party sink. If the protocol supports a form of acknowledgement then it will be returned by the call to Write.

func NewNATS added in v0.31.2

func NewNATS(conf NATSConfig, log log.Modular, stats metrics.Type) (Type, error)

NewNATS creates a new NATS output type.

type Websocket added in v0.13.2

type Websocket struct {
	// contains filtered or unexported fields
}

Websocket is an output type that serves Websocket messages.

func NewWebsocket added in v0.13.2

func NewWebsocket(
	conf WebsocketConfig,
	log log.Modular,
	stats metrics.Type,
) (*Websocket, error)

NewWebsocket creates a new Websocket output type.

func (*Websocket) CloseAsync added in v0.13.2

func (w *Websocket) CloseAsync()

CloseAsync shuts down the Websocket output and stops processing messages.

func (*Websocket) Connect added in v0.13.2

func (w *Websocket) Connect() error

Connect establishes a connection to an Websocket server.

func (*Websocket) WaitForClose added in v0.13.2

func (w *Websocket) WaitForClose(timeout time.Duration) error

WaitForClose blocks until the Websocket output has closed down.

func (*Websocket) Write added in v0.13.2

func (w *Websocket) Write(msg types.Message) error

Write attempts to write a message by pushing it to an Websocket broker.

type WebsocketConfig added in v0.13.2

type WebsocketConfig struct {
	URL         string `json:"url" yaml:"url"`
	auth.Config `json:",inline" yaml:",inline"`
}

WebsocketConfig contains configuration fields for the Websocket output type.

func NewWebsocketConfig added in v0.13.2

func NewWebsocketConfig() WebsocketConfig

NewWebsocketConfig creates a new WebsocketConfig with default values.

type ZMQ4Config added in v0.9.0

type ZMQ4Config struct{}

ZMQ4Config empty stub for when ZMQ4 is not compiled.

func NewZMQ4Config added in v0.9.0

func NewZMQ4Config() *ZMQ4Config

NewZMQ4Config returns nil.

Jump to

Keyboard shortcuts

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