From c33bae057f2f3dcbdcf712a560fb5af5409b968f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 11 Oct 2019 19:07:09 -0700 Subject: [PATCH] Fix build issues with event target logger --- pkg/event/target/elasticsearch.go | 2 +- pkg/event/target/kafka.go | 2 +- pkg/event/target/mqtt.go | 4 ++-- pkg/event/target/mysql.go | 2 +- pkg/event/target/nats.go | 2 +- pkg/event/target/nsq.go | 2 +- pkg/event/target/postgresql.go | 2 +- pkg/event/target/store.go | 4 ++-- pkg/event/target/webhook.go | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/event/target/elasticsearch.go b/pkg/event/target/elasticsearch.go index 7b028c0e8..d66c99df2 100644 --- a/pkg/event/target/elasticsearch.go +++ b/pkg/event/target/elasticsearch.go @@ -221,7 +221,7 @@ func newClient(args ElasticsearchArgs) (*elastic.Client, error) { } // NewElasticsearchTarget - creates new Elasticsearch target. -func NewElasticsearchTarget(id string, args ElasticsearchArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*ElasticsearchTarget, error) { +func NewElasticsearchTarget(id string, args ElasticsearchArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*ElasticsearchTarget, error) { var client *elastic.Client var err error diff --git a/pkg/event/target/kafka.go b/pkg/event/target/kafka.go index 697eccadd..d729754b4 100644 --- a/pkg/event/target/kafka.go +++ b/pkg/event/target/kafka.go @@ -192,7 +192,7 @@ func (k KafkaArgs) pingBrokers() bool { } // NewKafkaTarget - creates new Kafka target with auth credentials. -func NewKafkaTarget(id string, args KafkaArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*KafkaTarget, error) { +func NewKafkaTarget(id string, args KafkaArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*KafkaTarget, error) { config := sarama.NewConfig() config.Net.SASL.User = args.SASL.User diff --git a/pkg/event/target/mqtt.go b/pkg/event/target/mqtt.go index 7e1cf9417..fd238c779 100644 --- a/pkg/event/target/mqtt.go +++ b/pkg/event/target/mqtt.go @@ -88,7 +88,7 @@ type MQTTTarget struct { args MQTTArgs client mqtt.Client store Store - loggerOnce func(ctx context.Context, err error, id interface{}) + loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{}) } // ID - returns target ID. @@ -162,7 +162,7 @@ func (target *MQTTTarget) Close() error { } // NewMQTTTarget - creates new MQTT target. -func NewMQTTTarget(id string, args MQTTArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*MQTTTarget, error) { +func NewMQTTTarget(id string, args MQTTArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*MQTTTarget, error) { options := mqtt.NewClientOptions(). SetClientID(""). SetCleanSession(true). diff --git a/pkg/event/target/mysql.go b/pkg/event/target/mysql.go index 4e626ccbc..0b1994f7f 100644 --- a/pkg/event/target/mysql.go +++ b/pkg/event/target/mysql.go @@ -312,7 +312,7 @@ func (target *MySQLTarget) executeStmts() error { } // NewMySQLTarget - creates new MySQL target. -func NewMySQLTarget(id string, args MySQLArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*MySQLTarget, error) { +func NewMySQLTarget(id string, args MySQLArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*MySQLTarget, error) { var firstPing bool if args.DSN == "" { config := mysql.Config{ diff --git a/pkg/event/target/nats.go b/pkg/event/target/nats.go index 833bfeaa0..86252373b 100644 --- a/pkg/event/target/nats.go +++ b/pkg/event/target/nats.go @@ -234,7 +234,7 @@ func (target *NATSTarget) Close() (err error) { } // NewNATSTarget - creates new NATS target. -func NewNATSTarget(id string, args NATSArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*NATSTarget, error) { +func NewNATSTarget(id string, args NATSArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*NATSTarget, error) { var natsConn *nats.Conn var stanConn stan.Conn diff --git a/pkg/event/target/nsq.go b/pkg/event/target/nsq.go index 2521835eb..4e948cdd5 100644 --- a/pkg/event/target/nsq.go +++ b/pkg/event/target/nsq.go @@ -150,7 +150,7 @@ func (target *NSQTarget) Close() (err error) { } // NewNSQTarget - creates new NSQ target. -func NewNSQTarget(id string, args NSQArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*NSQTarget, error) { +func NewNSQTarget(id string, args NSQArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*NSQTarget, error) { config := nsq.NewConfig() if args.TLS.Enable { config.TlsV1 = true diff --git a/pkg/event/target/postgresql.go b/pkg/event/target/postgresql.go index e3e742c67..c30f1304c 100644 --- a/pkg/event/target/postgresql.go +++ b/pkg/event/target/postgresql.go @@ -313,7 +313,7 @@ func (target *PostgreSQLTarget) executeStmts() error { } // NewPostgreSQLTarget - creates new PostgreSQL target. -func NewPostgreSQLTarget(id string, args PostgreSQLArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) (*PostgreSQLTarget, error) { +func NewPostgreSQLTarget(id string, args PostgreSQLArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) (*PostgreSQLTarget, error) { var firstPing bool params := []string{args.ConnectionString} diff --git a/pkg/event/target/store.go b/pkg/event/target/store.go index 7f357d831..f08072ee0 100644 --- a/pkg/event/target/store.go +++ b/pkg/event/target/store.go @@ -45,7 +45,7 @@ type Store interface { } // replayEvents - Reads the events from the store and replays. -func replayEvents(store Store, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}), id event.TargetID) <-chan string { +func replayEvents(store Store, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{}), id event.TargetID) <-chan string { eventKeyCh := make(chan string) go func() { @@ -97,7 +97,7 @@ func IsConnResetErr(err error) bool { } // sendEvents - Reads events from the store and re-plays. -func sendEvents(target event.Target, eventKeyCh <-chan string, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) { +func sendEvents(target event.Target, eventKeyCh <-chan string, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) { retryTicker := time.NewTicker(retryInterval) defer retryTicker.Stop() diff --git a/pkg/event/target/webhook.go b/pkg/event/target/webhook.go index 66c0e6cfb..a9a2076ed 100644 --- a/pkg/event/target/webhook.go +++ b/pkg/event/target/webhook.go @@ -172,7 +172,7 @@ func (target *WebhookTarget) Close() error { } // NewWebhookTarget - creates new Webhook target. -func NewWebhookTarget(id string, args WebhookArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{})) *WebhookTarget { +func NewWebhookTarget(id string, args WebhookArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, kind ...interface{})) *WebhookTarget { var store Store