config

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KRB5_USER_AUTH   = "USER"
	KRB5_KEYTAB_AUTH = "KEYTAB"
)

Variables

View Source
var (
	// Version is the current version of the app, generated at build time
	Version = "unknown"
)

Functions

This section is empty.

Types

type AWSConfig added in v0.3.4

type AWSConfig struct {
	Region  string
	Profile string
}

type Config

type Config struct {
	Http struct {
		ListenAddress string
		MetricsPath   string
		HealthPath    string
		Disable       bool
	}
	Debug struct {
		ListenAddress string
		DebugPath     string
		Enabled       bool
	}
	Log struct {
		Format         string
		Level          string
		LevelFieldName string
		TimeFiledName  string
		MsgFiledName   string
	}
	Proxy struct {
		DefaultListenerIP         string
		BootstrapServers          []ListenerConfig
		ExternalServers           []ListenerConfig
		DialAddressMappings       []DialAddressMapping
		DisableDynamicListeners   bool
		DynamicAdvertisedListener string
		DynamicSequentialMinPort  int
		RequestBufferSize         int
		ResponseBufferSize        int
		ListenerReadBufferSize    int // SO_RCVBUF
		ListenerWriteBufferSize   int // SO_SNDBUF
		ListenerKeepAlive         time.Duration

		TLS struct {
			Enable                   bool
			ListenerCertFile         string
			ListenerKeyFile          string
			ListenerKeyPassword      string
			CAChainCertFile          string
			ListenerCipherSuites     []string
			ListenerCurvePreferences []string
			ClientCert               struct {
				Subjects []string
			}
		}
	}
	Auth struct {
		Local struct {
			Enable     bool
			Command    string
			Mechanism  string
			Parameters []string
			LogLevel   string
			Timeout    time.Duration
		}
		Gateway struct {
			Client struct {
				Enable     bool
				Method     string
				Magic      uint64
				Command    string
				Parameters []string
				LogLevel   string
				Timeout    time.Duration
			}
			Server struct {
				Enable     bool
				Method     string
				Magic      uint64
				Command    string
				Parameters []string
				LogLevel   string
				Timeout    time.Duration
			}
		}
	}
	Kafka struct {
		ClientID string

		MaxOpenRequests int

		ForbiddenApiKeys []int

		DialTimeout               time.Duration // How long to wait for the initial connection.
		WriteTimeout              time.Duration // How long to wait for a request.
		ReadTimeout               time.Duration // How long to wait for a response.
		KeepAlive                 time.Duration
		ConnectionReadBufferSize  int // SO_RCVBUF
		ConnectionWriteBufferSize int // SO_SNDBUF

		TLS struct {
			Enable               bool
			InsecureSkipVerify   bool
			ClientCertFile       string
			ClientKeyFile        string
			ClientKeyPassword    string
			CAChainCertFile      string
			SameClientCertEnable bool
		}

		SASL struct {
			Enable         bool
			Username       string
			Password       string
			JaasConfigFile string
			Method         string
			Plugin         struct {
				Enable     bool
				Command    string
				Mechanism  string
				Parameters []string
				LogLevel   string
				Timeout    time.Duration
			}
			GSSAPI    GSSAPIConfig
			AWSConfig AWSConfig
		}
		Producer struct {
			Acks0Disabled bool
		}
	}
	ForwardProxy struct {
		Url string

		Scheme   string
		Address  string
		Username string
		Password string
	}
}

func NewConfig

func NewConfig() *Config

func (*Config) InitBootstrapServers

func (c *Config) InitBootstrapServers(bootstrapServersMapping []string) (err error)

func (*Config) InitDialAddressMappings added in v0.1.5

func (c *Config) InitDialAddressMappings(dialMappings []string) (err error)

func (*Config) InitExternalServers

func (c *Config) InitExternalServers(externalServersMapping []string) (err error)

func (*Config) InitSASLCredentials

func (c *Config) InitSASLCredentials() (err error)

func (*Config) Validate

func (c *Config) Validate() error

type DialAddressMapping added in v0.1.5

type DialAddressMapping struct {
	SourceAddress      string
	DestinationAddress string
}

type GSSAPIConfig added in v0.3.3

type GSSAPIConfig struct {
	AuthType           string
	KeyTabPath         string
	KerberosConfigPath string
	ServiceName        string
	Username           string
	Password           string
	Realm              string
	DisablePAFXFAST    bool
	SPNHostsMapping    map[string]string
}

type JaasCredentials

type JaasCredentials struct {
	Username string
	Password string
}

func NewJaasCredentialFromFile

func NewJaasCredentialFromFile(filename string) (*JaasCredentials, error)

func NewJaasCredentials

func NewJaasCredentials(s string) (*JaasCredentials, error)

type ListenerConfig

type ListenerConfig struct {
	BrokerAddress     string
	ListenerAddress   string
	AdvertisedAddress string
}

type NetAddressMappingFunc

type NetAddressMappingFunc func(brokerHost string, brokerPort int32) (listenerHost string, listenerPort int32, err error)

Jump to

Keyboard shortcuts

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