Documentation
¶
Index ¶
- func IsConnErr(err error) bool
- func IsConnRefusedErr(err error) bool
- type AMQPArgs
- type AMQPTarget
- type ElasticsearchArgs
- type ElasticsearchTarget
- type HTTPClientTarget
- type KafkaArgs
- type KafkaTarget
- type MQTTArgs
- type MQTTTarget
- type MySQLArgs
- type MySQLTarget
- type NATSArgs
- type NATSTarget
- type NSQArgs
- type NSQTarget
- type PostgreSQLArgs
- type PostgreSQLTarget
- type QueueStore
- type RedisArgs
- type RedisTarget
- type Store
- type WebhookArgs
- type WebhookTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConnRefusedErr ¶
IsConnRefusedErr - To check fot "connection refused" error.
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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
AMQPArgs - AMQP target arguments.
type AMQPTarget ¶
type AMQPTarget struct {
// contains filtered or unexported fields
}
AMQPTarget - AMQP target
func NewAMQPTarget ¶
func NewAMQPTarget(id string, args AMQPArgs, doneCh <-chan struct{}) (*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) Save ¶
func (target *AMQPTarget) Save(eventData event.Event) error
Save - saves the events to the store which will be replayed when the amqp connection is active.
func (*AMQPTarget) Send ¶
func (target *AMQPTarget) Send(eventKey string) 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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
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, doneCh <-chan struct{}) (*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) Save ¶
func (target *ElasticsearchTarget) Save(eventData event.Event) error
Save - saves the events to the store if queuestore is configured, which will be replayed when the elasticsearch connection is active.
func (*ElasticsearchTarget) Send ¶
func (target *ElasticsearchTarget) Send(eventKey string) error
Send - reads an event from store and sends it 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) Save ¶
func (target *HTTPClientTarget) Save(eventData event.Event) error
Save - sends event to HTTP client.
func (*HTTPClientTarget) Send ¶
func (target *HTTPClientTarget) Send(eventKey string) error
Send - interface compatible method does no-op.
type KafkaArgs ¶
type KafkaArgs struct { Enable bool `json:"enable"` Brokers []xnet.Host `json:"brokers"` Topic string `json:"topic"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` 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.
type KafkaTarget ¶
type KafkaTarget struct {
// contains filtered or unexported fields
}
KafkaTarget - Kafka target.
func NewKafkaTarget ¶
func NewKafkaTarget(id string, args KafkaArgs, doneCh <-chan struct{}) (*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) Save ¶
func (target *KafkaTarget) Save(eventData event.Event) error
Save - saves the events to the store which will be replayed when the Kafka connection is active.
func (*KafkaTarget) Send ¶
func (target *KafkaTarget) Send(eventKey string) error
Send - reads an event from store and sends it to Kafka.
type MQTTArgs ¶
type MQTTArgs struct { Enable bool `json:"enable"` Broker xnet.URL `json:"broker"` Topic string `json:"topic"` QoS byte `json:"qos"` User string `json:"username"` Password string `json:"password"` MaxReconnectInterval time.Duration `json:"reconnectInterval"` KeepAlive time.Duration `json:"keepAliveInterval"` RootCAs *x509.CertPool `json:"-"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
MQTTArgs - MQTT target arguments.
type MQTTTarget ¶
type MQTTTarget struct {
// contains filtered or unexported fields
}
MQTTTarget - MQTT target.
func NewMQTTTarget ¶
func NewMQTTTarget(id string, args MQTTArgs, doneCh <-chan struct{}) (*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) Save ¶
func (target *MQTTTarget) Save(eventData event.Event) error
Save - saves the events to the store if queuestore is configured, which will be replayed when the mqtt connection is active.
func (*MQTTTarget) Send ¶
func (target *MQTTTarget) Send(eventKey string) error
Send - reads an event from store and sends it 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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
MySQLArgs - MySQL target arguments.
type MySQLTarget ¶
type MySQLTarget struct {
// contains filtered or unexported fields
}
MySQLTarget - MySQL target.
func NewMySQLTarget ¶
func NewMySQLTarget(id string, args MySQLArgs, doneCh <-chan struct{}) (*MySQLTarget, error)
NewMySQLTarget - creates new MySQL target.
func (*MySQLTarget) Close ¶
func (target *MySQLTarget) Close() error
Close - closes underneath connections to MySQL database.
func (*MySQLTarget) Save ¶
func (target *MySQLTarget) Save(eventData event.Event) error
Save - saves the events to the store which will be replayed when the SQL connection is active.
func (*MySQLTarget) Send ¶
func (target *MySQLTarget) Send(eventKey string) error
Send - reads an event from store and sends it 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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` Streaming struct { Enable bool `json:"enable"` ClusterID string `json:"clusterID"` Async bool `json:"async"` MaxPubAcksInflight int `json:"maxPubAcksInflight"` } `json:"streaming"` }
NATSArgs - NATS target arguments.
type NATSTarget ¶
type NATSTarget struct {
// contains filtered or unexported fields
}
NATSTarget - NATS target.
func NewNATSTarget ¶
func NewNATSTarget(id string, args NATSArgs, doneCh <-chan struct{}) (*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) Save ¶
func (target *NATSTarget) Save(eventData event.Event) error
Save - saves the events to the store which will be replayed when the Nats connection is active.
func (*NATSTarget) Send ¶
func (target *NATSTarget) Send(eventKey string) 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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
NSQArgs - NSQ target arguments.
type NSQTarget ¶
type NSQTarget struct {
// contains filtered or unexported fields
}
NSQTarget - NSQ target.
func NewNSQTarget ¶
NewNSQTarget - creates new NSQ target.
type PostgreSQLArgs ¶
type PostgreSQLArgs struct { Enable bool `json:"enable"` Format string `json:"format"` ConnectionString string `json:"connectionString"` Table string `json:"table"` Host xnet.Host `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 QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
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, doneCh <-chan struct{}) (*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) Save ¶
func (target *PostgreSQLTarget) Save(eventData event.Event) error
Save - saves the events to the store if questore is configured, which will be replayed when the PostgreSQL connection is active.
func (*PostgreSQLTarget) Send ¶
func (target *PostgreSQLTarget) Send(eventKey string) error
Send - reads an event from store and sends it to PostgreSQL.
type QueueStore ¶
QueueStore - Filestore for persisting events.
func NewQueueStore ¶
func NewQueueStore(directory string, limit uint64) *QueueStore
NewQueueStore - Creates an instance for QueueStore.
func (*QueueStore) Del ¶
func (store *QueueStore) Del(key string) error
Del - Deletes an entry from the store.
func (*QueueStore) Get ¶
func (store *QueueStore) Get(key string) (event.Event, error)
Get - gets a event from the store.
func (*QueueStore) List ¶
func (store *QueueStore) List() []string
List - lists all files from the directory.
func (*QueueStore) Open ¶
func (store *QueueStore) Open() error
Open - Creates the directory if not present.
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"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
RedisArgs - Redis target arguments.
type RedisTarget ¶
type RedisTarget struct {
// contains filtered or unexported fields
}
RedisTarget - Redis target.
func NewRedisTarget ¶
func NewRedisTarget(id string, args RedisArgs, doneCh <-chan struct{}) (*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) Save ¶
func (target *RedisTarget) Save(eventData event.Event) error
Save - saves the events to the store if questore is configured, which will be replayed when the redis connection is active.
func (*RedisTarget) Send ¶
func (target *RedisTarget) Send(eventKey string) error
Send - reads an event from store and sends it to redis.
type Store ¶
type Store interface { Put(event event.Event) error Get(key string) (event.Event, error) List() []string Del(key string) error Open() error }
Store - To persist the events.
type WebhookArgs ¶
type WebhookArgs struct { Enable bool `json:"enable"` Endpoint xnet.URL `json:"endpoint"` RootCAs *x509.CertPool `json:"-"` QueueDir string `json:"queueDir"` QueueLimit uint64 `json:"queueLimit"` }
WebhookArgs - Webhook target arguments.
type WebhookTarget ¶
type WebhookTarget struct {
// contains filtered or unexported fields
}
WebhookTarget - Webhook target.
func NewWebhookTarget ¶
func NewWebhookTarget(id string, args WebhookArgs, doneCh <-chan struct{}) *WebhookTarget
NewWebhookTarget - creates new Webhook target.
func (*WebhookTarget) Close ¶
func (target *WebhookTarget) Close() error
Close - does nothing and available for interface compatibility.
func (*WebhookTarget) Save ¶
func (target *WebhookTarget) Save(eventData event.Event) error
Save - saves the events to the store if queuestore is configured, which will be replayed when the wenhook connection is active.
func (*WebhookTarget) Send ¶
func (target *WebhookTarget) Send(eventKey string) error
Send - reads an event from store and sends it to webhook.