kafka

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PEMCertificateBlock has to match PEM certificate
	PEMCertificateBlock = `-----BEGIN CERTIFICATE-----(.*)-----END CERTIFICATE-----`
	// PEMPrivKeyBlock has to match PEM Key
	PEMPrivKeyBlock = `-----BEGIN PRIVATE KEY-----(.*)-----END PRIVATE KEY-----`
	// ReplacePattern to be replacing in Regexps, as strings.Replace is faster than regexp
	ReplacePattern = `(.*)`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterClient

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

ClusterClient will abstract work with Kafka clusters

func (*ClusterClient) Close

func (c *ClusterClient) Close()

Close will close kafka connection to cleanup resources

func (*ClusterClient) InsertTopic

func (c *ClusterClient) InsertTopic(topic *api.KafkaTopicSpec) error

type ClusterConfig

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

ClusterConfig will configure settings for Kafka cluster and it will get a new ClusterCient

func NewClusterConfig

func NewClusterConfig(options ...Option) (*ClusterConfig, error)

NewClusterConfig would return ClusterClient or would return error if error occured

func (*ClusterConfig) GetClient

func (c *ClusterConfig) GetClient() (*ClusterClient, error)

GetClient will make a new Kafka clients

type Option

type Option func(*ClusterConfig) error

Option is a type of options for ClusterConfig

func Brokers

func Brokers(brokers string) Option

Brokers is option function to set list of brokers

func MaxPartsPerTopic

func MaxPartsPerTopic(max uint) Option

MaxPartsPerTopic is option function to set Maximum Partitions per Topic

func TLSCACert

func TLSCACert(ca string) Option

TLSCACert is option function to set CA cert

func TLSCert

func TLSCert(cert string) Option

TLSCert is option function to set TLS cert

func TLSEnabled

func TLSEnabled(tlsEnabled bool) Option

TLSEnabled is option function to set if we need TLS or not

func TLSKey

func TLSKey(key string) Option

TLSKey is option function to set TLS key

func TLSSkipVerify

func TLSSkipVerify(tlsSkip bool) Option

TLSSkipVerify is option function to set if we need to verify clusters cert

Jump to

Keyboard shortcuts

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