From fca6d24bb7bd0b24a4bdb7dc9a3c3609982977d4 Mon Sep 17 00:00:00 2001 From: Justin Gerace Date: Mon, 25 Feb 2019 17:56:10 -0800 Subject: [PATCH] Add WithContext methods to the HEC interface --- hec.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hec.go b/hec.go index 3858008..d31a9c8 100644 --- a/hec.go +++ b/hec.go @@ -1,6 +1,7 @@ package hec import ( + "context" "io" "net/http" ) @@ -18,6 +19,12 @@ type HEC interface { // 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 }