Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPMsg ¶
type HTTPMsg interface { GetPayload() []byte GetDebugPath() string GetURL(endpoint string) string //static methods GetHeaders(conf HTTPSinkConf) map[string]string BatchURL(msgs []interface{}, endpoint string, version int) string BatchPayload(msgs []interface{}, version int) []byte }
HTTPMsg is an interface which incoming data should implment for HttpSink to work
type HTTPSink ¶
type HTTPSink struct {
// contains filtered or unexported fields
}
HTTPSink is Sink implementation which writes to HttpEndpoint
func GetHTTPSink ¶
func GetHTTPSink(size int, conf HTTPSinkConf) *HTTPSink
GetHTTPSink method is public method used to create Instance of HTTPSink
func (*HTTPSink) BatchConsume ¶
BatchConsume is implementation of Sink interface Consume.
func (*HTTPSink) Clone ¶
Clone is implementation of Sink interface method. As HTTPSink is Stateless this method returns selfRefrence
func (*HTTPSink) Consume ¶
Consume is implementation for Single message Consumption. This infinitely retries pre and post hooks, but finetly retries HTTPCall for status. status == true is determined by responseCode 2xx
func (*HTTPSink) RegisterHook ¶
func (h *HTTPSink) RegisterHook(hook HTTPSinkHook)
type HTTPSinkConf ¶
type HTTPSinkConf struct { Endpoint string `json:"endpoint"` //http://destinationHost:port/prefixPath Timeout core.Duration `json:"timeout"` RetryInterval core.Duration `json:"retry_interval"` Headers []map[string]string `json:"headers"` Method string `json:"method"` //GET,POST,PUT,DELETE NonRetriableHttpStatusCodes []int `json:nonRetriableHttpStatusCodes` //this is for handling customized errorCode thrown by sink }
HTTPSinkConf holds config to HTTPSink
type HTTPSinkHook ¶
type HTTPSinkHook interface { PreHTTPCall(msg interface{}) PostHTTPCall(msg interface{}, sucess bool) }
HTTPSinkHook is added for Clien to attach pre and post porcessing logic