target

package
v0.0.0-...-e9b145e Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPArgs

type AMQPArgs struct {
	Enable       bool     `json:"enable"`
	URL          xnet.URL `json:"url"`
	Exchange     string   `json:"exchange"`
	RoutingKey   string   `json:"routingKey"`
	ExchangeType string   `json:"exchangeType"`
	DeliveryMode uint8    `json:"deliveryMode"`
	Mandatory    bool     `json:"mandatory"`
	Immediate    bool     `json:"immediate"`
	Durable      bool     `json:"durable"`
	Internal     bool     `json:"internal"`
	NoWait       bool     `json:"noWait"`
	AutoDeleted  bool     `json:"autoDeleted"`
}

AMQPArgs - AMQP target arguments.

func (*AMQPArgs) Validate

func (a *AMQPArgs) Validate() error

Validate AMQP arguments

type AMQPTarget

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

AMQPTarget - AMQP target

func NewAMQPTarget

func NewAMQPTarget(id string, args AMQPArgs) (*AMQPTarget, error)

NewAMQPTarget - creates new AMQP target.

func (*AMQPTarget) Close

func (target *AMQPTarget) Close() error

Close - does nothing and available for interface compatibility.

func (*AMQPTarget) ID

func (target *AMQPTarget) ID() event.TargetID

ID - returns TargetID.

func (*AMQPTarget) Send

func (target *AMQPTarget) Send(eventData event.Event) error

Send - sends event to AMQP.

type ElasticsearchArgs

type ElasticsearchArgs struct {
	Enable bool     `json:"enable"`
	Format string   `json:"format"`
	URL    xnet.URL `json:"url"`
	Index  string   `json:"index"`
}

ElasticsearchArgs - Elasticsearch target arguments.

func (ElasticsearchArgs) Validate

func (a ElasticsearchArgs) Validate() error

Validate ElasticsearchArgs fields

type ElasticsearchTarget

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

ElasticsearchTarget - Elasticsearch target.

func NewElasticsearchTarget

func NewElasticsearchTarget(id string, args ElasticsearchArgs) (*ElasticsearchTarget, error)

NewElasticsearchTarget - creates new Elasticsearch target.

func (*ElasticsearchTarget) Close

func (target *ElasticsearchTarget) Close() error

Close - does nothing and available for interface compatibility.

func (*ElasticsearchTarget) ID

func (target *ElasticsearchTarget) ID() event.TargetID

ID - returns target ID.

func (*ElasticsearchTarget) Send

func (target *ElasticsearchTarget) Send(eventData event.Event) error

Send - sends event to Elasticsearch.

type HTTPClientTarget

type HTTPClientTarget struct {
	DoneCh chan struct{}
	// contains filtered or unexported fields
}

HTTPClientTarget - HTTP client target.

func NewHTTPClientTarget

func NewHTTPClientTarget(host xnet.Host, w http.ResponseWriter) (*HTTPClientTarget, error)

NewHTTPClientTarget - creates new HTTP client target.

func (*HTTPClientTarget) Close

func (target *HTTPClientTarget) Close() error

Close - closes underneath goroutine.

func (HTTPClientTarget) ID

func (target HTTPClientTarget) ID() event.TargetID

ID - returns target ID.

func (*HTTPClientTarget) Send

func (target *HTTPClientTarget) Send(eventData event.Event) error

Send - sends event to HTTP client.

type KafkaArgs

type KafkaArgs struct {
	Enable  bool        `json:"enable"`
	Brokers []xnet.Host `json:"brokers"`
	Topic   string      `json:"topic"`
	TLS     struct {
		Enable     bool               `json:"enable"`
		SkipVerify bool               `json:"skipVerify"`
		ClientAuth tls.ClientAuthType `json:"clientAuth"`
	} `json:"tls"`
	SASL struct {
		Enable   bool   `json:"enable"`
		User     string `json:"username"`
		Password string `json:"password"`
	} `json:"sasl"`
}

KafkaArgs - Kafka target arguments.

func (KafkaArgs) Validate

func (k KafkaArgs) Validate() error

Validate KafkaArgs fields

type KafkaTarget

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

KafkaTarget - Kafka target.

func NewKafkaTarget

func NewKafkaTarget(id string, args KafkaArgs) (*KafkaTarget, error)

NewKafkaTarget - creates new Kafka target with auth credentials.

func (*KafkaTarget) Close

func (target *KafkaTarget) Close() error

Close - closes underneath kafka connection.

func (*KafkaTarget) ID

func (target *KafkaTarget) ID() event.TargetID

ID - returns target ID.

func (*KafkaTarget) Send

func (target *KafkaTarget) Send(eventData event.Event) error

Send - sends event to Kafka.

type MQTTArgs

type MQTTArgs struct {
	Enable               bool           `json:"enable"`
	Broker               xnet.URL       `json:"broker"`
	Topic                string         `json:"topic"`
	QoS                  byte           `json:"qos"`
	ClientID             string         `json:"clientId"`
	User                 string         `json:"username"`
	Password             string         `json:"password"`
	MaxReconnectInterval time.Duration  `json:"reconnectInterval"`
	KeepAlive            time.Duration  `json:"keepAliveInterval"`
	RootCAs              *x509.CertPool `json:"-"`
}

MQTTArgs - MQTT target arguments.

func (MQTTArgs) Validate

func (m MQTTArgs) Validate() error

Validate MQTTArgs fields

type MQTTTarget

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

MQTTTarget - MQTT target.

func NewMQTTTarget

func NewMQTTTarget(id string, args MQTTArgs) (*MQTTTarget, error)

NewMQTTTarget - creates new MQTT target.

func (*MQTTTarget) Close

func (target *MQTTTarget) Close() error

Close - does nothing and available for interface compatibility.

func (*MQTTTarget) ID

func (target *MQTTTarget) ID() event.TargetID

ID - returns target ID.

func (*MQTTTarget) Send

func (target *MQTTTarget) Send(eventData event.Event) error

Send - sends event to MQTT.

type MySQLArgs

type MySQLArgs struct {
	Enable   bool     `json:"enable"`
	Format   string   `json:"format"`
	DSN      string   `json:"dsnString"`
	Table    string   `json:"table"`
	Host     xnet.URL `json:"host"`
	Port     string   `json:"port"`
	User     string   `json:"user"`
	Password string   `json:"password"`
	Database string   `json:"database"`
}

MySQLArgs - MySQL target arguments.

func (MySQLArgs) Validate

func (m MySQLArgs) Validate() error

Validate MySQLArgs fields

type MySQLTarget

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

MySQLTarget - MySQL target.

func NewMySQLTarget

func NewMySQLTarget(id string, args MySQLArgs) (*MySQLTarget, error)

NewMySQLTarget - creates new MySQL target.

func (*MySQLTarget) Close

func (target *MySQLTarget) Close() error

Close - closes underneath connections to MySQL database.

func (*MySQLTarget) ID

func (target *MySQLTarget) ID() event.TargetID

ID - returns target ID.

func (*MySQLTarget) Send

func (target *MySQLTarget) Send(eventData event.Event) error

Send - sends event to MySQL.

type NATSArgs

type NATSArgs struct {
	Enable       bool      `json:"enable"`
	Address      xnet.Host `json:"address"`
	Subject      string    `json:"subject"`
	Username     string    `json:"username"`
	Password     string    `json:"password"`
	Token        string    `json:"token"`
	Secure       bool      `json:"secure"`
	PingInterval int64     `json:"pingInterval"`
	Streaming    struct {
		Enable             bool   `json:"enable"`
		ClusterID          string `json:"clusterID"`
		ClientID           string `json:"clientID"`
		Async              bool   `json:"async"`
		MaxPubAcksInflight int    `json:"maxPubAcksInflight"`
	} `json:"streaming"`
}

NATSArgs - NATS target arguments.

func (NATSArgs) Validate

func (n NATSArgs) Validate() error

Validate NATSArgs fields

type NATSTarget

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

NATSTarget - NATS target.

func NewNATSTarget

func NewNATSTarget(id string, args NATSArgs) (*NATSTarget, error)

NewNATSTarget - creates new NATS target.

func (*NATSTarget) Close

func (target *NATSTarget) Close() (err error)

Close - closes underneath connections to NATS server.

func (*NATSTarget) ID

func (target *NATSTarget) ID() event.TargetID

ID - returns target ID.

func (*NATSTarget) Send

func (target *NATSTarget) Send(eventData event.Event) (err error)

Send - sends event to NATS.

type NSQArgs

type NSQArgs struct {
	Enable      bool      `json:"enable"`
	NSQDAddress xnet.Host `json:"nsqdAddress"`
	Topic       string    `json:"topic"`
	TLS         struct {
		Enable     bool `json:"enable"`
		SkipVerify bool `json:"skipVerify"`
	} `json:"tls"`
}

NSQArgs - NSQ target arguments.

func (NSQArgs) Validate

func (n NSQArgs) Validate() error

Validate NSQArgs fields

type NSQTarget

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

NSQTarget - NSQ target.

func NewNSQTarget

func NewNSQTarget(id string, args NSQArgs) (*NSQTarget, error)

NewNSQTarget - creates new NSQ target.

func (*NSQTarget) Close

func (target *NSQTarget) Close() (err error)

Close - closes underneath connections to NSQD server.

func (*NSQTarget) ID

func (target *NSQTarget) ID() event.TargetID

ID - returns target ID.

func (*NSQTarget) Send

func (target *NSQTarget) Send(eventData event.Event) (err error)

Send - sends event to NSQD.

type PostgreSQLArgs

type PostgreSQLArgs struct {
	Enable           bool     `json:"enable"`
	Format           string   `json:"format"`
	ConnectionString string   `json:"connectionString"`
	Table            string   `json:"table"`
	Host             xnet.URL `json:"host"`     // default: localhost
	Port             string   `json:"port"`     // default: 5432
	User             string   `json:"user"`     // default: user running minio
	Password         string   `json:"password"` // default: no password
	Database         string   `json:"database"` // default: same as user
}

PostgreSQLArgs - PostgreSQL target arguments.

func (PostgreSQLArgs) Validate

func (p PostgreSQLArgs) Validate() error

Validate PostgreSQLArgs fields

type PostgreSQLTarget

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

PostgreSQLTarget - PostgreSQL target.

func NewPostgreSQLTarget

func NewPostgreSQLTarget(id string, args PostgreSQLArgs) (*PostgreSQLTarget, error)

NewPostgreSQLTarget - creates new PostgreSQL target.

func (*PostgreSQLTarget) Close

func (target *PostgreSQLTarget) Close() error

Close - closes underneath connections to PostgreSQL database.

func (*PostgreSQLTarget) ID

func (target *PostgreSQLTarget) ID() event.TargetID

ID - returns target ID.

func (*PostgreSQLTarget) Send

func (target *PostgreSQLTarget) Send(eventData event.Event) error

Send - sends event to PostgreSQL.

type RedisArgs

type RedisArgs struct {
	Enable   bool      `json:"enable"`
	Format   string    `json:"format"`
	Addr     xnet.Host `json:"address"`
	Password string    `json:"password"`
	Key      string    `json:"key"`
}

RedisArgs - Redis target arguments.

func (RedisArgs) Validate

func (r RedisArgs) Validate() error

Validate RedisArgs fields

type RedisTarget

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

RedisTarget - Redis target.

func NewRedisTarget

func NewRedisTarget(id string, args RedisArgs) (*RedisTarget, error)

NewRedisTarget - creates new Redis target.

func (*RedisTarget) Close

func (target *RedisTarget) Close() error

Close - does nothing and available for interface compatibility.

func (*RedisTarget) ID

func (target *RedisTarget) ID() event.TargetID

ID - returns target ID.

func (*RedisTarget) Send

func (target *RedisTarget) Send(eventData event.Event) error

Send - sends event to Redis.

type WebhookArgs

type WebhookArgs struct {
	Enable   bool           `json:"enable"`
	Endpoint xnet.URL       `json:"endpoint"`
	RootCAs  *x509.CertPool `json:"-"`
}

WebhookArgs - Webhook target arguments.

func (WebhookArgs) Validate

func (w WebhookArgs) Validate() error

Validate WebhookArgs fields

type WebhookTarget

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

WebhookTarget - Webhook target.

func NewWebhookTarget

func NewWebhookTarget(id string, args WebhookArgs) *WebhookTarget

NewWebhookTarget - creates new Webhook target.

func (*WebhookTarget) Close

func (target *WebhookTarget) Close() error

Close - does nothing and available for interface compatibility.

func (WebhookTarget) ID

func (target WebhookTarget) ID() event.TargetID

ID - returns target ID.

func (*WebhookTarget) Send

func (target *WebhookTarget) Send(eventData event.Event) error

Send - sends event to Webhook.

Jump to

Keyboard shortcuts

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