config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoRefreshXConfig

type AutoRefreshXConfig struct {
	ConfigInterface
	// contains filtered or unexported fields
}

AutoRefreshXConfig is the config needed for the autorefresh object it's composed by a ConfigInterface object and therefore inherits all the methods of ConfigInterface

func NewAutoRefreshXConfig

func NewAutoRefreshXConfig(mutexObj *sync.RWMutex, config ConfigInterface) *AutoRefreshXConfig

NewAutoRefreshXConfig returns an object implementing refresh.AutoRefreshXConfigInterface

func (*AutoRefreshXConfig) GetMutexObj

func (c *AutoRefreshXConfig) GetMutexObj() *sync.RWMutex

GetMutexObj returns a pointer to a sync.RWMutex object

type Config

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

Config is the core setup of any other config object, holds information about tls, refreshing time of TLS secrets and logger used for publisher/subscriber objects (using zap SugaredLogger)

func NewConfig

func NewConfig(refreshTimeout time.Duration, tlsConfig TLSConfigInterface, saslConfig SASLConfigInterface, logger logging.LoggerInterface) *Config

NewConfig returns an object implementing ConfigInterface func NewConfig(refreshTimeout time.Duration, tlsConfig TLSConfigInterface, logger logging.LoggerInterface) ConfigInterface {

func (*Config) GetDialer added in v1.2.0

func (c *Config) GetDialer() *kafka.Dialer

GetDialer returns internal dialer used for operations

func (*Config) GetLogger

func (c *Config) GetLogger() logging.LoggerInterface

GetLogger returns internal logger used for operations

func (*Config) GetRefreshTimeout

func (c *Config) GetRefreshTimeout() time.Duration

GetRefreshTimeout returns the duration of a refreshing cycle, used by AutoRefreshX

func (*Config) GetSASLConfig added in v1.2.0

func (c *Config) GetSASLConfig() SASLConfigInterface

GetSASLConfig returns a pointer to a SASLConfigInterface

func (*Config) GetTLSConfig

func (c *Config) GetTLSConfig() TLSConfigInterface

GetTLSConfig returns a pointer to a TLSConfig

type ConfigInterface

type ConfigInterface interface {
	GetLogger() logging.LoggerInterface
	GetTLSConfig() TLSConfigInterface
	GetRefreshTimeout() time.Duration
	GetSASLConfig() SASLConfigInterface
	GetDialer() *kafka.Dialer
}

ConfigInterface is the interface for a core config

type ReaderConfig

type ReaderConfig struct {
	ConfigInterface
	// contains filtered or unexported fields
}

ReaderConfig is a config for the core.Reader, holds subscriber informations

func NewReaderConfig

func NewReaderConfig(cfg ConfigInterface, bootstrapServers []string, topic, groupID string, noWorkers int, readTimeout time.Duration) *ReaderConfig

NewReaderConfig creates a new object implementing ReaderConfigInterface

func (*ReaderConfig) GetBootstrapServers

func (c *ReaderConfig) GetBootstrapServers() []string

GetBootstapServers returns the kafka url the config is pointing to

func (*ReaderConfig) GetGroupID

func (c *ReaderConfig) GetGroupID() string

GetGroupID returns a consumer group ID

func (*ReaderConfig) GetReadTimeout

func (c *ReaderConfig) GetReadTimeout() time.Duration

GetReadTimeout returns the time the ReadMessage call will be allowed to wait before timing out (via context)

func (*ReaderConfig) GetTopic

func (c *ReaderConfig) GetTopic() string

GetTopic returns the topic chosed to subscribe to

func (*ReaderConfig) Workers

func (c *ReaderConfig) Workers() int

Workers returns the number of workers for a subscriber

type SASLConfigInterface added in v1.2.0

type SASLConfigInterface interface {
	GetSASLMechanism() sasl.Mechanism
}

SASLConfigInterface is the interface for a core config

type TLSConfigInterface added in v1.2.0

type TLSConfigInterface interface {
	GetTLS() (*tls.Config, error)
}

type WriterConfig

type WriterConfig struct {
	ConfigInterface
	// contains filtered or unexported fields
}

WriterConfig is a config for the core.Writer, holds subscriber informations

func NewWriterConfig

func NewWriterConfig(cfg ConfigInterface, brokers []string, topic, nickname string, async bool, encoder enc.EncoderInterface) *WriterConfig

NewWriterConfig creates a new object implementing WriterConfigInterface

func (*WriterConfig) GetAsync

func (c *WriterConfig) GetAsync() bool

GetAsync returns if the publisher is supposed to be setup as async or sync

func (*WriterConfig) GetBrokers

func (c *WriterConfig) GetBrokers() []string

GetBrokers returns the configured list of brokers

func (*WriterConfig) GetEncoder

func (c *WriterConfig) GetEncoder() enc.EncoderInterface

GetEncoder returns the configured encoder

func (*WriterConfig) GetNickname

func (c *WriterConfig) GetNickname() string

GetNickname returns the nickname for the associated topic

func (*WriterConfig) GetTopic

func (c *WriterConfig) GetTopic() string

GetTopic returns the configured topic

Jump to

Keyboard shortcuts

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