kafka

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CloseProducer

func CloseProducer(producer interface{}) error

CloseProducer closes a given producer

func GetStatusCodeFromError added in v1.0.0

func GetStatusCodeFromError(err error) int

GetStatusCodeFromError parses the error and returns the status so that event gets retried or failed.

func NewProducer

func NewProducer(destinationConfig interface{}) (sarama.SyncProducer, error)

NewProducer creates a producer based on destination config

func NewProducerForAzureEventHub added in v1.0.0

func NewProducerForAzureEventHub(destinationConfig interface{}) (sarama.SyncProducer, error)

NewProducerForAzureEventHub creates a producer for Azure event hub based on destination config

func NewProducerForConfluentCloud

func NewProducerForConfluentCloud(destinationConfig interface{}) (sarama.SyncProducer, error)

NewProducerForConfluentCloud creates a producer for Confluent cloud based on destination config

func NewTLSConfig added in v1.0.0

func NewTLSConfig(caCertFile string) *tls.Config

NewTLSConfig generates a TLS configuration used to authenticate on server with certificates.

func Produce

func Produce(jsonData json.RawMessage, producer interface{}, destConfig interface{}) (int, string, string)

Produce creates a producer and send data to Kafka.

func SetSASLConfig added in v1.0.0

func SetSASLConfig(config *sarama.Config, destConfig Config) (err error)

Sets SASL authentication config for Kafka

Types

type AzureEventHubConfig added in v1.0.0

type AzureEventHubConfig struct {
	Topic                     string
	BootstrapServer           string
	EventHubsConnectionString string
}

AzureEventHubConfig is the config that is required to send data to Azure Event Hub

type Config added in v1.0.0

type Config struct {
	Topic         string
	HostName      string
	Port          string
	SslEnabled    bool
	CACertificate string
	UseSASL       bool
	SaslType      string
	Username      string
	Password      string
}

Config is the config that is required to send data to Kafka

type ConfluentCloudConfig added in v1.0.0

type ConfluentCloudConfig struct {
	Topic           string
	BootstrapServer string
	APIKey          string
	APISecret       string
}

ConfluentCloudConfig is the config that is required to send data to Confluent Cloud

type XDGSCRAMClient added in v1.0.0

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

Boilerplate needed for SCRAM Authentication in Kafka

func (*XDGSCRAMClient) Begin added in v1.0.0

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done added in v1.0.0

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step added in v1.0.0

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

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