forked from sendgridlabs/go-kinesis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
firehose.go
90 lines (80 loc) · 2.44 KB
/
firehose.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package kinesis
// PutRecordBatchResp stores the information that provides by PutRecordBatch API call
type PutRecordBatchResp struct {
FailedPutCount int
RequestResponses []PutRecordBatchResponses
}
// RecordBatchResponses stores individual Record information provided by PutRecordBatch API call
type PutRecordBatchResponses struct {
ErrorCode string
ErrorMessage string
RecordId string
}
type S3DestinationDescriptionResp struct {
BucketARN string
BufferingHints struct {
IntervalInSeconds int
SizeInMBs int
}
CompressionFormat string
EncryptionConfiguration struct {
KMSEncryptionConfig struct {
AWSKMSKeyARN string
}
NoEncryptionConfig string
}
Prefix string
RoleARN string
}
type RedshiftDestinationDescriptionResp struct {
ClusterJDBCURL string
CopyCommand struct {
CopyOptions string
DataTableColumns string
DataTableName string
}
RoleARN string
S3DestinationDescription S3DestinationDescriptionResp
Username string
}
type DestinationsResp struct {
DestinationId string
RedshiftDestinationDescription RedshiftDestinationDescriptionResp
S3DestinationDescription S3DestinationDescriptionResp
}
// DescribeDeliveryStreamResp stores the information that provides by the Firehose DescribeDeliveryStream API call
type DescribeDeliveryStreamResp struct {
DeliveryStreamDescription struct {
CreateTimestamp float32
DeliveryStreamARN string
DeliveryStreamName string
DeliveryStreamStatus string
Destinations []DestinationsResp
HasMoreDestinations bool
LastUpdatedTimestamp int
VersionId string
}
}
// http://docs.aws.amazon.com/firehose/latest/APIReference/API_DescribeDeliveryStream.html
func (kinesis *Kinesis) DescribeDeliveryStream(args *RequestArgs) (resp *DescribeDeliveryStreamResp, err error) {
kinesis.Firehose()
params := makeParams("DescribeDeliveryStream")
resp = &DescribeDeliveryStreamResp{}
err = kinesis.query(params, args.params, resp)
if err != nil {
return nil, err
}
return
}
// http://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html
func (kinesis *Kinesis) PutRecordBatch(args *RequestArgs) (resp *PutRecordBatchResp, err error) {
kinesis.Firehose()
params := makeParams("PutRecordBatch")
resp = &PutRecordBatchResp{}
args.Add("Records", args.Records)
err = kinesis.query(params, args.params, resp)
if err != nil {
return nil, err
}
return
}