Documentation ¶
Index ¶
- Variables
- func CloseProducer(producer interface{}) error
- func GetStatusCodeFromError(err error) int
- func NewProducer(destinationConfig interface{}) (sarama.SyncProducer, error)
- func NewProducerForAzureEventHub(destinationConfig interface{}) (sarama.SyncProducer, error)
- func NewProducerForConfluentCloud(destinationConfig interface{}) (sarama.SyncProducer, error)
- func NewTLSConfig(caCertFile string) *tls.Config
- func Produce(jsonData json.RawMessage, producer interface{}, destConfig interface{}) (int, string, string)
- func SetSASLConfig(config *sarama.Config, destConfig Config) (err error)
- type AzureEventHubConfig
- type Config
- type ConfluentCloudConfig
- type XDGSCRAMClient
Constants ¶
This section is empty.
Variables ¶
var ( SHA256 scram.HashGeneratorFcn = sha256.New SHA512 scram.HashGeneratorFcn = sha512.New )
Functions ¶
func CloseProducer ¶
func CloseProducer(producer interface{}) error
CloseProducer closes a given producer
func GetStatusCodeFromError ¶ added in v1.0.0
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
NewTLSConfig generates a TLS configuration used to authenticate on server with certificates.
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