kafka

package
v0.0.0-...-7613b02 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaConfig

type KafkaConfig struct {
	Timeout int
	Group   struct {
		Id string
	}
	Auto struct {
		Offset struct {
			Reset string
		}
		Commit struct {
			Interval struct {
				Ms int
			}
		}
	}
	Bootstrap struct {
		Servers string
	}
	Topics []string
	Sasl   struct {
		Username  string
		Password  string
		Mechanism string
		Protocol  string
	}
	Request struct {
		Timeout struct {
			Ms int
		}
		Required struct {
			Acks int
		}
	}
	Capath  string
	Message struct {
		Send struct {
			Max struct {
				Retries int
			}
		}
	}
	Retry struct {
		Backoff struct {
			Ms int
		}
	}
}

The kafka configuration that is used for produce and consume messages Related with configuration that is used by the librdkafka library. See: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md

type SCRAMClient

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

SCRAMClient implementation for the SCRAM authentication

func (*SCRAMClient) Begin

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

Begin prepares the client for the SCRAM exchange

func (*SCRAMClient) Done

func (x *SCRAMClient) Done() bool

Done should return true when the SCRAM conversation is over.

func (*SCRAMClient) Step

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

Step steps client through the SCRAM exchange

type TopicTranslation

type TopicTranslation struct {
	// contains filtered or unexported fields
}

TopicMap is used to map between real and internal topics, this is it could be that the name we indicate for the topics into the clowderapp resource be different from the real created in kafka, so this type allow to preproce the mappings, and use them when needed to translate them into the producer and consumer functions

var TopicTranslationConfig *TopicTranslation = nil

It store the mapping between the internal topic managed by the service and the real topic managed by kafka

func NewTopicTranslationWithClowder

func NewTopicTranslationWithClowder(cfg *clowder.AppConfig) *TopicTranslation

NewTopicTranslationWithClowder Build a topic map based into the clowder configuration.

func (*TopicTranslation) GetInternal

func (tm *TopicTranslation) GetInternal(realTopic string) string

GetInternal translates the topic's "Name" to the "RequestedName". This will be used by consumers. Returns input string when the topic is not found Example: "name": "platform-tmp-12345", "requestedName": "platform.notifications.ingress"

func (*TopicTranslation) GetReal

func (tm *TopicTranslation) GetReal(internalTopic string) string

GetReal translates the topic's "RequestedName" to the "Name". This will be used by producers. Returns input string when the topic is not found. Example: "name": "platform-tmp-12345", "requestedName": "platform.notifications.ingress"

Jump to

Keyboard shortcuts

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