config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// the api key can reside in the url parameter 'key'
	// maps to config value 'key'
	UrlKey = iota + 1
	// the api key can reside in the header 'x-api-key'
	// maps to config value 'header'
	HeaderKey
	// the api key can reside in either of the two
	// maps to config value 'both'
	URLKeyAndHeaderKey
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APICfg

type APICfg struct {
	// values
	BindIP                    string
	Port                      int
	ZooHosts                  []string
	KafkaZnode                string //The Zookeeper znode used by Kafka
	StoreHost                 string
	StoreDB                   string
	Cert                      string
	CertKey                   string
	CertificateAuthoritiesDir string
	ResAuth                   bool
	ServiceToken              string
	LogLevel                  string
	// Proxy Hostname represents the FQDN of the a potential proxy/load balancer that might be
	// serving requests in front of the ams instance
	ProxyHostname string

	PushEnabled bool
	// Whether or not it should communicate over tls with the push server
	PushTlsEnabled bool
	// Push server endpoint
	PushServerHost string
	// Push server port
	PushServerPort int
	// If tls is enabled, whether or not it should verify the push server's certificate
	VerifyPushServer bool
	// The token that corresponds to the registered push worker user
	PushWorkerToken string
	// Logging output(console,file,syslog etc)
	LogFacilities []string
	// contains filtered or unexported fields
}

APICfg holds kafka configuration

func NewAPICfg

func NewAPICfg(params ...string) *APICfg

NewAPICfg creates a new kafka configuration object

func (*APICfg) AuthOption

func (cfg *APICfg) AuthOption() AuthOption

AuthOption returns the value of the config for auth_option

func (*APICfg) GetBrokerInfo

func (cfg *APICfg) GetBrokerInfo() []string

GetBrokerInfo is a wrapper over GetZooList which retrieves broker information from zookeeper

func (*APICfg) GetZooList

func (cfg *APICfg) GetZooList() ([]string, error)

GetZooList gets broker list from zookeeper

func (*APICfg) Load

func (cfg *APICfg) Load()

Load the configuration

func (*APICfg) LoadCAs

func (cfg *APICfg) LoadCAs() (roots *x509.CertPool)

LoadCAs builds the CA chain using pem files from the specified directory in the cfg

func (*APICfg) LoadStrJSON

func (cfg *APICfg) LoadStrJSON(input string)

LoadStrJSON Loads configuration from a JSON string

func (*APICfg) LoadTest

func (cfg *APICfg) LoadTest()

LoadTest the configuration

type AuthOption

type AuthOption int

AuthOption defines how the service will handle authentication/authorization KEY, HEADER or BOTH are the available values for where the auth token should reside

func (AuthOption) String

func (a AuthOption) String() string

String representation of the iota auth option

Jump to

Keyboard shortcuts

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