config

package
v0.0.0-...-dc0fb25 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiDefinition

type ApiDefinition struct {
	ApiRequest protocol.API
	// HandlerFunc returns the API Response payload as a byte array, the API Response header, which is calculated by the request header and an optional error
	HandlerFunc func(req Request, apiVersion int16, opts ...any) ([]byte, int16, error)
}

type Broker

func MockBroker

func MockBroker() *Broker

MockBroker generates a mock object used for unit testing.

func NewBroker

func NewBroker(env *viper.Viper) (*Broker, error)

NewBroker returns a new instance of Broker. For now OpenTalaria does not support rack awareness, but this will change in the future.

type Cluster

type Cluster struct {
	ClusterID string
}

func MockCluster

func MockCluster() *Cluster

MockCluster generates a mock object used for unit testing.

type Config

type Config struct {
	OTProfile       OTProfile
	LogLevel        slog.Level
	LogFormat       string
	DebugServerPort int

	Broker  *Broker
	Cluster *Cluster

	Env *viper.Viper

	Plugin plugins.PluginInterface
}

func MockConfig

func MockConfig() *Config

MockConfig generates a mock object used for unit testing.

func NewConfig

func NewConfig(confFilename string) (*Config, error)

type Listener

type Listener struct {
	Host string
	Port int32
	// If the listener name is a security protocol, like PLAINTEXT,SSL,SASL_PLAINTEXT,SASL_SSL,
	// the name will be set as SecurityProtocol. Otherwise the name should be mapped in listener.security.protocol.map.
	// see https://docs.confluent.io/platform/current/installation/configuration/broker-configs.html#listener-security-protocol-map.
	SecurityProtocol SecurityProtocol
	ListenerName     string
}

type OTProfile

type OTProfile int
const (
	Localdev OTProfile = iota
	Dev
	Prod
	Unknown
)

type RegisteredAPI

type RegisteredAPI struct {
	ApiKey     int16
	MinVersion int16
	MaxVersion int16
}

type Request

type Request struct {
	Header  protocol.RequestHeader
	Message []byte
	Conn    net.Conn
	Config  *Config
}

type SecurityProtocol

type SecurityProtocol int
const (
	PLAINTEXT SecurityProtocol = iota
	SSL
	SASL_PLAINTEXT
	SASL_SSL
	UNDEFINED_SECURITY_PROTOCOL
)

func ParseSecurityProtocol

func ParseSecurityProtocol(p string) (SecurityProtocol, bool)

ParseSecurityProtocol parses the string p and returns the corresponding SecurityProtocol enum value and true or UNDEFINED_SECURITY_PROTOCOL and false if the value of string p is not recognized.

Jump to

Keyboard shortcuts

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