-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathhec.go
37 lines (28 loc) · 1.2 KB
/
hec.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
package hec
import (
"context"
"io"
"net/http"
)
type HEC interface {
SetHTTPClient(client *http.Client)
SetKeepAlive(enable bool)
SetChannel(channel string)
SetMaxRetry(retries int)
SetMaxContentLength(size int)
SetCompression(compression string)
// WriteEvent writes single event via HEC json mode
WriteEvent(event *Event) error
// WriteBatch writes multiple events via HCE batch mode
WriteBatch(events []*Event) error
// WriteBatchWithContext writes multiple events via HEC batch mode with a context for cancellation
WriteBatchWithContext(ctx context.Context, events []*Event) error
// WriteRaw writes raw data stream via HEC raw mode
WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
// WriteRawWithContext writes raw data stream via HEC raw mode with a context for cancellation
WriteRawWithContext(ctx context.Context, reader io.ReadSeeker, metadata *EventMetadata) error
// WaitForAcknowledgement blocks until the Splunk indexer acknowledges data sent to it
WaitForAcknowledgement() error
// WaitForAcknowledgementWithContext blocks until the Splunk indexer acknowledges data sent to it with a context for cancellation
WaitForAcknowledgementWithContext(ctx context.Context) error
}