Enable default vet flags (#6810)

Enable default vet flags except experimental
master
Pontus Leitzler 6 years ago committed by kannappanr
parent f1f23f6f11
commit f9779b24ad
  1. 4
      Makefile
  2. 2
      cmd/admin-handlers_test.go
  3. 6
      cmd/encryption-v1_test.go
  4. 90
      cmd/endpoint-ellipses_test.go
  5. 2
      cmd/gateway/s3/gateway-s3.go
  6. 4
      cmd/notification.go
  7. 10
      cmd/object-api-multipart_test.go
  8. 16
      cmd/object-api-putobject_test.go
  9. 2
      cmd/peer-rpc-client-target.go
  10. 4
      pkg/event/target/amqp.go
  11. 2
      pkg/event/target/elasticsearch.go
  12. 2
      pkg/event/target/httpclient.go
  13. 4
      pkg/event/target/kafka.go
  14. 4
      pkg/event/target/mqtt.go
  15. 2
      pkg/event/target/mysql.go
  16. 4
      pkg/event/target/nats.go
  17. 4
      pkg/event/target/nsq.go
  18. 2
      pkg/event/target/postgresql.go
  19. 2
      pkg/event/target/redis.go
  20. 4
      pkg/event/target/webhook.go

@ -23,8 +23,8 @@ verifiers: getdeps vet fmt lint cyclo deadcode spelling
vet: vet:
@echo "Running $@" @echo "Running $@"
@go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult cmd @go tool vet cmd
@go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult pkg @go tool vet pkg
fmt: fmt:
@echo "Running $@" @echo "Running $@"

@ -550,7 +550,7 @@ func testServicesCmdHandler(cmd cmdType, t *testing.T) {
credentials := globalServerConfig.GetCredential() credentials := globalServerConfig.GetCredential()
body, err := json.Marshal(madmin.ServiceAction{ body, err := json.Marshal(madmin.ServiceAction{
cmd.toServiceActionValue()}) Action: cmd.toServiceActionValue()})
if err != nil { if err != nil {
t.Fatalf("JSONify error: %v", err) t.Fatalf("JSONify error: %v", err)
} }

@ -37,7 +37,7 @@ var hasServerSideEncryptionHeaderTests = []struct {
{headers: map[string]string{}, sseRequest: false}, // 4 {headers: map[string]string{}, sseRequest: false}, // 4
{headers: map[string]string{crypto.SSECopyAlgorithm + " ": "AES256", " " + crypto.SSECopyKey: "key", crypto.SSECopyKeyMD5 + " ": "md5"}, sseRequest: false}, // 5 {headers: map[string]string{crypto.SSECopyAlgorithm + " ": "AES256", " " + crypto.SSECopyKey: "key", crypto.SSECopyKeyMD5 + " ": "md5"}, sseRequest: false}, // 5
{headers: map[string]string{crypto.SSECopyAlgorithm: "", crypto.SSECopyKey: "", crypto.SSECopyKeyMD5: ""}, sseRequest: false}, // 6 {headers: map[string]string{crypto.SSECopyAlgorithm: "", crypto.SSECopyKey: "", crypto.SSECopyKeyMD5: ""}, sseRequest: false}, // 6
{headers: map[string]string{crypto.SSEHeader: ""}, sseRequest: true}, // 6 {headers: map[string]string{crypto.SSEHeader: ""}, sseRequest: true}, // 7
} }
func TestHasServerSideEncryptionHeader(t *testing.T) { func TestHasServerSideEncryptionHeader(t *testing.T) {
@ -89,12 +89,12 @@ var hasSSECustomerHeaderTests = []struct {
{headers: map[string]string{crypto.SSECKeyMD5: "md5"}, sseRequest: true}, // 3 {headers: map[string]string{crypto.SSECKeyMD5: "md5"}, sseRequest: true}, // 3
{headers: map[string]string{}, sseRequest: false}, // 4 {headers: map[string]string{}, sseRequest: false}, // 4
{headers: map[string]string{crypto.SSECAlgorithm + " ": "AES256", " " + crypto.SSECKey: "key", crypto.SSECKeyMD5 + " ": "md5"}, sseRequest: false}, // 5 {headers: map[string]string{crypto.SSECAlgorithm + " ": "AES256", " " + crypto.SSECKey: "key", crypto.SSECKeyMD5 + " ": "md5"}, sseRequest: false}, // 5
{headers: map[string]string{crypto.SSECAlgorithm: "", crypto.SSECKey: "", crypto.SSECKeyMD5: ""}, sseRequest: false}, // 6 {headers: map[string]string{crypto.SSECAlgorithm: "", crypto.SSECKey: "", crypto.SSECKeyMD5: ""}, sseRequest: true}, // 6
{headers: map[string]string{crypto.SSEHeader: ""}, sseRequest: false}, // 7 {headers: map[string]string{crypto.SSEHeader: ""}, sseRequest: false}, // 7
} }
func TesthasSSECustomerHeader(t *testing.T) { func TestHasSSECustomerHeader(t *testing.T) {
for i, test := range hasSSECustomerHeaderTests { for i, test := range hasSSECustomerHeaderTests {
headers := http.Header{} headers := http.Header{}
for k, v := range test.headers { for k, v := range test.headers {

@ -287,9 +287,9 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"/export/set", Prefix: "/export/set",
"", Suffix: "",
getSequences(1, 64, 0), Seq: getSequences(1, 64, 0),
}, },
}, },
}, },
@ -305,14 +305,14 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"", Prefix: "",
"", Suffix: "",
getSequences(1, 64, 0), Seq: getSequences(1, 64, 0),
}, },
{ {
"http://minio", Prefix: "http://minio",
"/export/set", Suffix: "/export/set",
getSequences(2, 3, 0), Seq: getSequences(2, 3, 0),
}, },
}, },
}, },
@ -328,9 +328,9 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"http://minio", Prefix: "http://minio",
".mydomain.net/data", Suffix: ".mydomain.net/data",
getSequences(1, 64, 0), Seq: getSequences(1, 64, 0),
}, },
}, },
}, },
@ -345,14 +345,14 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"", Prefix: "",
"/data", Suffix: "/data",
getSequences(1, 16, 0), Seq: getSequences(1, 16, 0),
}, },
{ {
"http://rack", Prefix: "http://rack",
".mydomain.minio", Suffix: ".mydomain.minio",
getSequences(1, 4, 0), Seq: getSequences(1, 4, 0),
}, },
}, },
}, },
@ -368,14 +368,14 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"", Prefix: "",
"", Suffix: "",
getSequences(0, 1, 0), Seq: getSequences(0, 1, 0),
}, },
{ {
"http://minio", Prefix: "http://minio",
".mydomain.net/data", Suffix: ".mydomain.net/data",
getSequences(0, 15, 0), Seq: getSequences(0, 15, 0),
}, },
}, },
}, },
@ -391,9 +391,9 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"http://server1/data", Prefix: "http://server1/data",
"", Suffix: "",
getSequences(1, 32, 0), Seq: getSequences(1, 32, 0),
}, },
}, },
}, },
@ -409,9 +409,9 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"http://server1/data", Prefix: "http://server1/data",
"", Suffix: "",
getSequences(1, 32, 2), Seq: getSequences(1, 32, 2),
}, },
}, },
}, },
@ -427,19 +427,19 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"", Prefix: "",
"", Suffix: "",
getSequences(1, 2, 0), Seq: getSequences(1, 2, 0),
}, },
{ {
"", Prefix: "",
"/test", Suffix: "/test",
getSequences(1, 64, 0), Seq: getSequences(1, 64, 0),
}, },
{ {
"http://minio", Prefix: "http://minio",
"/export/set", Suffix: "/export/set",
getSequences(2, 3, 0), Seq: getSequences(2, 3, 0),
}, },
}, },
}, },
@ -456,14 +456,14 @@ func TestParseEndpointSet(t *testing.T) {
[]ellipses.ArgPattern{ []ellipses.ArgPattern{
[]ellipses.Pattern{ []ellipses.Pattern{
{ {
"", Prefix: "",
"", Suffix: "",
getSequences(1, 10, 0), Seq: getSequences(1, 10, 0),
}, },
{ {
"/export", Prefix: "/export",
"/disk", Suffix: "/disk",
getSequences(1, 10, 0), Seq: getSequences(1, 10, 0),
}, },
}, },
}, },

@ -397,7 +397,7 @@ func (l *s3Objects) GetObject(ctx context.Context, bucket string, key string, st
// GetObjectInfo reads object info and replies back ObjectInfo // GetObjectInfo reads object info and replies back ObjectInfo
func (l *s3Objects) GetObjectInfo(ctx context.Context, bucket string, object string, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) { func (l *s3Objects) GetObjectInfo(ctx context.Context, bucket string, object string, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
oi, err := l.Client.StatObject(bucket, object, miniogo.StatObjectOptions{miniogo.GetObjectOptions{ServerSideEncryption: opts.ServerSideEncryption}}) oi, err := l.Client.StatObject(bucket, object, miniogo.StatObjectOptions{GetObjectOptions: miniogo.GetObjectOptions{ServerSideEncryption: opts.ServerSideEncryption}})
if err != nil { if err != nil {
return minio.ObjectInfo{}, minio.ErrorRespToObjectError(err, bucket, object) return minio.ObjectInfo{}, minio.ErrorRespToObjectError(err, bucket, object)
} }

@ -510,7 +510,7 @@ func (args eventArgs) ToEvent() event.Event {
AwsRegion: args.ReqParams["region"], AwsRegion: args.ReqParams["region"],
EventTime: eventTime.Format(event.AMZTimeFormat), EventTime: eventTime.Format(event.AMZTimeFormat),
EventName: args.EventName, EventName: args.EventName,
UserIdentity: event.Identity{args.ReqParams["accessKey"]}, UserIdentity: event.Identity{PrincipalID: args.ReqParams["accessKey"]},
RequestParameters: args.ReqParams, RequestParameters: args.ReqParams,
ResponseElements: respElements, ResponseElements: respElements,
S3: event.Metadata{ S3: event.Metadata{
@ -518,7 +518,7 @@ func (args eventArgs) ToEvent() event.Event {
ConfigurationID: "Config", ConfigurationID: "Config",
Bucket: event.Bucket{ Bucket: event.Bucket{
Name: args.BucketName, Name: args.BucketName,
OwnerIdentity: event.Identity{args.ReqParams["accessKey"]}, OwnerIdentity: event.Identity{PrincipalID: args.ReqParams["accessKey"]},
ARN: policy.ResourceARNPrefix + args.BucketName, ARN: policy.ResourceARNPrefix + args.BucketName,
}, },
Object: event.Object{ Object: event.Object{

@ -329,20 +329,20 @@ func testObjectAPIPutObjectPart(obj ObjectLayer, instanceType string, t TestErrH
// Test case - 12. // Test case - 12.
// Input to replicate Md5 mismatch. // Input to replicate Md5 mismatch.
{bucket, object, uploadID, 1, "", "d41d8cd98f00b204e9800998ecf8427f", "", 0, false, "", {bucket, object, uploadID, 1, "", "d41d8cd98f00b204e9800998ecf8427f", "", 0, false, "",
hash.BadDigest{"d41d8cd98f00b204e9800998ecf8427f", "d41d8cd98f00b204e9800998ecf8427e"}}, hash.BadDigest{ExpectedMD5: "d41d8cd98f00b204e9800998ecf8427f", CalculatedMD5: "d41d8cd98f00b204e9800998ecf8427e"}},
// Test case - 13. // Test case - 13.
// When incorrect sha256 is provided. // When incorrect sha256 is provided.
{bucket, object, uploadID, 1, "", "", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b854", 0, false, "", {bucket, object, uploadID, 1, "", "", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b854", 0, false, "",
hash.SHA256Mismatch{"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b854", hash.SHA256Mismatch{ExpectedSHA256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b854",
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}, CalculatedSHA256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}},
// Test case - 14. // Test case - 14.
// Input with size more than the size of actual data inside the reader. // Input with size more than the size of actual data inside the reader.
{bucket, object, uploadID, 1, "abcd", "e2fc714c4727ee9395f324cd2e7f3335", "", int64(len("abcd") + 1), false, "", {bucket, object, uploadID, 1, "abcd", "e2fc714c4727ee9395f324cd2e7f3335", "", int64(len("abcd") + 1), false, "",
hash.BadDigest{"e2fc714c4727ee9395f324cd2e7f3335", "e2fc714c4727ee9395f324cd2e7f331f"}}, hash.BadDigest{ExpectedMD5: "e2fc714c4727ee9395f324cd2e7f3335", CalculatedMD5: "e2fc714c4727ee9395f324cd2e7f331f"}},
// Test case - 15. // Test case - 15.
// Input with size less than the size of actual data inside the reader. // Input with size less than the size of actual data inside the reader.
{bucket, object, uploadID, 1, "abcd", "900150983cd24fb0d6963f7d28e17f73", "", int64(len("abcd") - 1), false, "", {bucket, object, uploadID, 1, "abcd", "900150983cd24fb0d6963f7d28e17f73", "", int64(len("abcd") - 1), false, "",
hash.BadDigest{"900150983cd24fb0d6963f7d28e17f73", "900150983cd24fb0d6963f7d28e17f72"}}, hash.BadDigest{ExpectedMD5: "900150983cd24fb0d6963f7d28e17f73", CalculatedMD5: "900150983cd24fb0d6963f7d28e17f72"}},
// Test case - 16-19. // Test case - 16-19.
// Validating for success cases. // Validating for success cases.

@ -97,24 +97,24 @@ func testObjectAPIPutObject(obj ObjectLayer, instanceType string, t TestErrHandl
// Test case - 7. // Test case - 7.
// Input to replicate Md5 mismatch. // Input to replicate Md5 mismatch.
{bucket, object, []byte(""), map[string]string{"etag": "d41d8cd98f00b204e9800998ecf8427f"}, "", 0, "", {bucket, object, []byte(""), map[string]string{"etag": "d41d8cd98f00b204e9800998ecf8427f"}, "", 0, "",
hash.BadDigest{"d41d8cd98f00b204e9800998ecf8427f", "d41d8cd98f00b204e9800998ecf8427e"}}, hash.BadDigest{ExpectedMD5: "d41d8cd98f00b204e9800998ecf8427f", CalculatedMD5: "d41d8cd98f00b204e9800998ecf8427e"}},
// Test case - 8. // Test case - 8.
// With incorrect sha256. // With incorrect sha256.
{bucket, object, []byte("abcd"), map[string]string{"etag": "e2fc714c4727ee9395f324cd2e7f331f"}, {bucket, object, []byte("abcd"), map[string]string{"etag": "e2fc714c4727ee9395f324cd2e7f331f"},
"88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031580", int64(len("abcd")), "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031580", int64(len("abcd")),
"", hash.SHA256Mismatch{"88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031580", "", hash.SHA256Mismatch{ExpectedSHA256: "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031580",
"88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589"}}, CalculatedSHA256: "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589"}},
// Test case - 9. // Test case - 9.
// Input with size more than the size of actual data inside the reader. // Input with size more than the size of actual data inside the reader.
{bucket, object, []byte("abcd"), map[string]string{"etag": "e2fc714c4727ee9395f324cd2e7f331e"}, "", int64(len("abcd") + 1), "", {bucket, object, []byte("abcd"), map[string]string{"etag": "e2fc714c4727ee9395f324cd2e7f331e"}, "", int64(len("abcd") + 1), "",
hash.BadDigest{"e2fc714c4727ee9395f324cd2e7f331e", "e2fc714c4727ee9395f324cd2e7f331f"}}, hash.BadDigest{ExpectedMD5: "e2fc714c4727ee9395f324cd2e7f331e", CalculatedMD5: "e2fc714c4727ee9395f324cd2e7f331f"}},
// Test case - 10. // Test case - 10.
// Input with size less than the size of actual data inside the reader. // Input with size less than the size of actual data inside the reader.
{bucket, object, []byte("abcd"), map[string]string{"etag": "900150983cd24fb0d6963f7d28e17f73"}, "", int64(len("abcd") - 1), "", {bucket, object, []byte("abcd"), map[string]string{"etag": "900150983cd24fb0d6963f7d28e17f73"}, "", int64(len("abcd") - 1), "",
hash.BadDigest{"900150983cd24fb0d6963f7d28e17f73", "900150983cd24fb0d6963f7d28e17f72"}}, hash.BadDigest{ExpectedMD5: "900150983cd24fb0d6963f7d28e17f73", CalculatedMD5: "900150983cd24fb0d6963f7d28e17f72"}},
// Test case - 11-14. // Test case - 11-14.
// Validating for success cases. // Validating for success cases.
@ -144,11 +144,11 @@ func testObjectAPIPutObject(obj ObjectLayer, instanceType string, t TestErrHandl
// Test case 24-26. // Test case 24-26.
// data with invalid md5sum in header // data with invalid md5sum in header
{bucket, object, data, invalidMD5Header, "", int64(len(data)), getMD5Hash(data), {bucket, object, data, invalidMD5Header, "", int64(len(data)), getMD5Hash(data),
hash.BadDigest{invalidMD5, getMD5Hash(data)}}, hash.BadDigest{ExpectedMD5: invalidMD5, CalculatedMD5: getMD5Hash(data)}},
{bucket, object, nilBytes, invalidMD5Header, "", int64(len(nilBytes)), getMD5Hash(nilBytes), {bucket, object, nilBytes, invalidMD5Header, "", int64(len(nilBytes)), getMD5Hash(nilBytes),
hash.BadDigest{invalidMD5, getMD5Hash(nilBytes)}}, hash.BadDigest{ExpectedMD5: invalidMD5, CalculatedMD5: getMD5Hash(nilBytes)}},
{bucket, object, fiveMBBytes, invalidMD5Header, "", int64(len(fiveMBBytes)), getMD5Hash(fiveMBBytes), {bucket, object, fiveMBBytes, invalidMD5Header, "", int64(len(fiveMBBytes)), getMD5Hash(fiveMBBytes),
hash.BadDigest{invalidMD5, getMD5Hash(fiveMBBytes)}}, hash.BadDigest{ExpectedMD5: invalidMD5, CalculatedMD5: getMD5Hash(fiveMBBytes)}},
// Test case 27-29. // Test case 27-29.
// data with size different from the actual number of bytes available in the reader // data with size different from the actual number of bytes available in the reader

@ -44,7 +44,7 @@ func (target *PeerRPCClientTarget) Close() error {
// NewPeerRPCClientTarget - creates RPCClient target with given target ID available in remote peer. // NewPeerRPCClientTarget - creates RPCClient target with given target ID available in remote peer.
func NewPeerRPCClientTarget(bucketName string, targetID event.TargetID, rpcClient *PeerRPCClient) *PeerRPCClientTarget { func NewPeerRPCClientTarget(bucketName string, targetID event.TargetID, rpcClient *PeerRPCClient) *PeerRPCClientTarget {
return &PeerRPCClientTarget{ return &PeerRPCClientTarget{
id: event.TargetID{targetID.ID, targetID.Name + "+" + mustGetUUID()}, id: event.TargetID{ID: targetID.ID, Name: targetID.Name + "+" + mustGetUUID()},
remoteTargetID: targetID, remoteTargetID: targetID,
bucketName: bucketName, bucketName: bucketName,
rpcClient: rpcClient, rpcClient: rpcClient,

@ -123,7 +123,7 @@ func (target *AMQPTarget) Send(eventData event.Event) error {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -154,7 +154,7 @@ func NewAMQPTarget(id string, args AMQPArgs) (*AMQPTarget, error) {
} }
return &AMQPTarget{ return &AMQPTarget{
id: event.TargetID{id, "amqp"}, id: event.TargetID{ID: id, Name: "amqp"},
args: args, args: args,
conn: conn, conn: conn,
}, nil }, nil

@ -140,7 +140,7 @@ func NewElasticsearchTarget(id string, args ElasticsearchArgs) (*ElasticsearchTa
} }
return &ElasticsearchTarget{ return &ElasticsearchTarget{
id: event.TargetID{id, "elasticsearch"}, id: event.TargetID{ID: id, Name: "elasticsearch"},
args: args, args: args,
client: client, client: client,
}, nil }, nil

@ -135,7 +135,7 @@ func NewHTTPClientTarget(host xnet.Host, w http.ResponseWriter) (*HTTPClientTarg
return nil, err return nil, err
} }
c := &HTTPClientTarget{ c := &HTTPClientTarget{
id: event.TargetID{"httpclient" + "+" + uuid + "+" + host.Name, host.Port.String()}, id: event.TargetID{ID: "httpclient" + "+" + uuid + "+" + host.Name, Name: host.Port.String()},
w: w, w: w,
eventCh: make(chan []byte), eventCh: make(chan []byte),
DoneCh: make(chan struct{}), DoneCh: make(chan struct{}),

@ -81,7 +81,7 @@ func (target *KafkaTarget) Send(eventData event.Event) error {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -129,7 +129,7 @@ func NewKafkaTarget(id string, args KafkaArgs) (*KafkaTarget, error) {
} }
return &KafkaTarget{ return &KafkaTarget{
id: event.TargetID{id, "kafka"}, id: event.TargetID{ID: id, Name: "kafka"},
args: args, args: args,
producer: producer, producer: producer,
}, nil }, nil

@ -89,7 +89,7 @@ func (target *MQTTTarget) Send(eventData event.Event) error {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -127,7 +127,7 @@ func NewMQTTTarget(id string, args MQTTArgs) (*MQTTTarget, error) {
} }
return &MQTTTarget{ return &MQTTTarget{
id: event.TargetID{id, "mqtt"}, id: event.TargetID{ID: id, Name: "mqtt"},
args: args, args: args,
client: client, client: client,
}, nil }, nil

@ -254,7 +254,7 @@ func NewMySQLTarget(id string, args MySQLArgs) (*MySQLTarget, error) {
} }
return &MySQLTarget{ return &MySQLTarget{
id: event.TargetID{id, "mysql"}, id: event.TargetID{ID: id, Name: "mysql"},
args: args, args: args,
updateStmt: updateStmt, updateStmt: updateStmt,
deleteStmt: deleteStmt, deleteStmt: deleteStmt,

@ -93,7 +93,7 @@ func (target *NATSTarget) Send(eventData event.Event) (err error) {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -165,7 +165,7 @@ func NewNATSTarget(id string, args NATSArgs) (*NATSTarget, error) {
} }
return &NATSTarget{ return &NATSTarget{
id: event.TargetID{id, "nats"}, id: event.TargetID{ID: id, Name: "nats"},
args: args, args: args,
stanConn: stanConn, stanConn: stanConn,
natsConn: natsConn, natsConn: natsConn,

@ -76,7 +76,7 @@ func (target *NSQTarget) Send(eventData event.Event) (err error) {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -109,7 +109,7 @@ func NewNSQTarget(id string, args NSQArgs) (*NSQTarget, error) {
} }
return &NSQTarget{ return &NSQTarget{
id: event.TargetID{id, "nsq"}, id: event.TargetID{ID: id, Name: "nsq"},
args: args, args: args,
producer: producer, producer: producer,
}, nil }, nil

@ -259,7 +259,7 @@ func NewPostgreSQLTarget(id string, args PostgreSQLArgs) (*PostgreSQLTarget, err
} }
return &PostgreSQLTarget{ return &PostgreSQLTarget{
id: event.TargetID{id, "postgresql"}, id: event.TargetID{ID: id, Name: "postgresql"},
args: args, args: args,
updateStmt: updateStmt, updateStmt: updateStmt,
deleteStmt: deleteStmt, deleteStmt: deleteStmt,

@ -170,7 +170,7 @@ func NewRedisTarget(id string, args RedisArgs) (*RedisTarget, error) {
} }
return &RedisTarget{ return &RedisTarget{
id: event.TargetID{id, "redis"}, id: event.TargetID{ID: id, Name: "redis"},
args: args, args: args,
pool: pool, pool: pool,
}, nil }, nil

@ -72,7 +72,7 @@ func (target *WebhookTarget) Send(eventData event.Event) error {
} }
key := eventData.S3.Bucket.Name + "/" + objectName key := eventData.S3.Bucket.Name + "/" + objectName
data, err := json.Marshal(event.Log{eventData.EventName, key, []event.Event{eventData}}) data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
if err != nil { if err != nil {
return err return err
} }
@ -109,7 +109,7 @@ func (target *WebhookTarget) Close() error {
// NewWebhookTarget - creates new Webhook target. // NewWebhookTarget - creates new Webhook target.
func NewWebhookTarget(id string, args WebhookArgs) *WebhookTarget { func NewWebhookTarget(id string, args WebhookArgs) *WebhookTarget {
return &WebhookTarget{ return &WebhookTarget{
id: event.TargetID{id, "webhook"}, id: event.TargetID{ID: id, Name: "webhook"},
args: args, args: args,
httpClient: &http.Client{ httpClient: &http.Client{
Transport: &http.Transport{ Transport: &http.Transport{

Loading…
Cancel
Save