kafka

package
v0.0.0-...-5655933 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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

func (v Data) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Data) MarshalJSON

func (v Data) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Data) UnmarshalEasyJSON

func (v *Data) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Data) UnmarshalJSON

func (v *Data) UnmarshalJSON(data []byte) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL