Documentation ¶
Index ¶
Constants ¶
const ( TextContentType = "text/plain" JSONContentType = "application/json" )
ContentType options,
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentEncoding ¶
type ContentEncoding interface {
// contains filtered or unexported methods
}
ContentEncoding encodes the payload
var IdentityContentType ContentEncoding = &identityContentType{}
IdentityContentType encodes the payload using the identity function
type Data ¶
type Data struct {
Topic string `json:"topic"`
}
easyjson:json
func (Data) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Data) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Data) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Data) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination sends a payload over HTTP.
func NewDestination ¶
func NewDestination(endpoint logsconfig.Endpoint, contentType string, destinationsContext *client.DestinationsContext, maxConcurrentBackgroundSends int) *Destination
NewDestination returns a new Destination. If `maxConcurrentBackgroundSends` > 0, then at most that many background payloads will be sent concurrently, else there is no concurrency and the background sending pipeline will block while sending each payload. TODO: add support for SOCKS5
func (*Destination) Send ¶
func (d *Destination) Send(payload []byte) error
Send sends a payload over HTTP, the error returned can be retryable and it is the responsibility of the callee to retry.
func (*Destination) SendAsync ¶
func (d *Destination) SendAsync(payload []byte)
SendAsync sends a payload in background.
type GzipContentEncoding ¶
type GzipContentEncoding struct {
// contains filtered or unexported fields
}
GzipContentEncoding encodes the payload using gzip algorithm
func NewGzipContentEncoding ¶
func NewGzipContentEncoding(level int) *GzipContentEncoding
NewGzipContentEncoding creates a new Gzip content type
type MessageBuilder ¶
type MessageBuilder struct {
sarama.ProducerMessage
}
func NewBuilder ¶
func NewBuilder() *MessageBuilder
func (*MessageBuilder) Send ¶
func (m *MessageBuilder) Send(producer sarama.SyncProducer) error
func (*MessageBuilder) WithMessage ¶
func (m *MessageBuilder) WithMessage(key string, value []byte) *MessageBuilder
func (*MessageBuilder) WithTopic ¶
func (m *MessageBuilder) WithTopic(topic string) *MessageBuilder