Skip to content

Commit bc692f0

Browse files
committed
Unexport Request
1 parent 39f0fa1 commit bc692f0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

exporter/elasticsearchexporter/factory.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ func createLogsRequestExporter(
9797
}
9898

9999
batchMergeFunc := func(ctx context.Context, r1, r2 exporterhelper.Request) (exporterhelper.Request, error) {
100-
rr1 := r1.(*Request)
101-
rr2 := r2.(*Request)
100+
rr1 := r1.(*request)
101+
rr2 := r2.(*request)
102102
req := newRequest(logsExporter.bulkIndexer)
103103
req.Items = append(rr1.Items, rr2.Items...)
104104
return req, nil
@@ -111,12 +111,12 @@ func createLogsRequestExporter(
111111
}
112112

113113
marshalRequest := func(req exporterhelper.Request) ([]byte, error) {
114-
b, err := json.Marshal(*req.(*Request))
114+
b, err := json.Marshal(*req.(*request))
115115
return b, err
116116
}
117117

118118
unmarshalRequest := func(b []byte) (exporterhelper.Request, error) {
119-
var req Request
119+
var req request
120120
err := json.Unmarshal(b, &req)
121121
req.bulkIndexer = logsExporter.bulkIndexer
122122
return &req, err

exporter/elasticsearchexporter/request.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import (
55
"context"
66
)
77

8-
type Request struct {
8+
type request struct {
99
bulkIndexer *esBulkIndexerCurrent
1010
Items []bulkIndexerItem
1111
}
1212

13-
func newRequest(bulkIndexer *esBulkIndexerCurrent) *Request {
14-
return &Request{bulkIndexer: bulkIndexer}
13+
func newRequest(bulkIndexer *esBulkIndexerCurrent) *request {
14+
return &request{bulkIndexer: bulkIndexer}
1515
}
1616

17-
func (r *Request) Export(ctx context.Context) error {
17+
func (r *request) Export(ctx context.Context) error {
1818
batch := make([]esBulkIndexerItem, len(r.Items))
1919
for i, item := range r.Items {
2020
batch[i] = esBulkIndexerItem{
@@ -25,11 +25,11 @@ func (r *Request) Export(ctx context.Context) error {
2525
return r.bulkIndexer.AddBatchAndFlush(ctx, batch)
2626
}
2727

28-
func (r *Request) ItemsCount() int {
28+
func (r *request) ItemsCount() int {
2929
return len(r.Items)
3030
}
3131

32-
func (r *Request) Add(item bulkIndexerItem) {
32+
func (r *request) Add(item bulkIndexerItem) {
3333
r.Items = append(r.Items, item)
3434
}
3535

0 commit comments

Comments
 (0)