config

package
v1.0.6-1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

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
	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
}

APICfg holds kafka configuration

func NewAPICfg

func NewAPICfg(params ...string) *APICfg

NewAPICfg creates a new kafka configuration object

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

Jump to

Keyboard shortcuts

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