config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App added in v0.12.0

type App struct {
	// TCP address that gRPC API server should listen on.
	GRPCAddr string `yaml:"grpc_addr"`

	// TCP address that HTTP API server should listen on.
	TCPAddr string `yaml:"tcp_addr"`

	// Unix domain socket address that HTTP API server should listen on.
	// Listening on a unix domain socket is disabled by default.
	UnixAddr string `yaml:"unix_addr"`

	// An arbitrary number of proxies to different Kafka/ZooKeeper clusters can
	// be configured.
	Proxies map[string]*Proxy `yaml:"proxies"`

	// Default proxy is the one to be used in API calls that do not start with
	// prefix `/proxy/<alias>`. If it is not explicitly provided, then the one
	// mentioned in the `Proxies` section first is assumed.
	DefaultProxy string `yaml:"default_proxy"`
}

App defines Kafka-Pixy application configuration. It mirrors the structure of the JSON configuration file.

func DefaultApp added in v0.12.0

func DefaultApp(alias string) *App

DefaultApp returns default application configuration where default proxy has the specified alias.

func FromYAML added in v0.12.0

func FromYAML(data []byte) (*App, error)

FromYAML parses configuration from a YAML string and performs basic validation of parameters.

func FromYAMLFile added in v0.12.0

func FromYAMLFile(filename string) (*App, error)

FromYAML parses configuration from a YAML file and performs basic validation of parameters.

type Proxy added in v0.12.0

type Proxy struct {
	// Unique ID that identifies a Kafka-Pixy instance in both ZooKeeper and
	// Kafka. It is automatically generated by default and it is recommended to
	// leave it like that.
	ClientID string `yaml:"client_id"`

	Kafka struct {

		// List of seed Kafka peers that Kafka-Pixy should access to resolve
		// the Kafka cluster topology.
		SeedPeers []string `yaml:"seed_peers"`
	} `yaml:"kafka"`

	ZooKeeper struct {

		// List of seed ZooKeeper peers that Kafka-Pixy should access to
		// resolve the ZooKeeper cluster topology.
		SeedPeers []string `yaml:"seed_peers"`

		// Path to the directory where Kafka keeps its data.
		Chroot string `yaml:"chroot"`
	} `yaml:"zoo_keeper"`

	Producer struct {

		// Size of all buffered channels created by the producer module.
		ChannelBufferSize int `yaml:"channel_buffer_size"`

		// Period of time that Kafka-Pixy should keep trying to submit buffered
		// messages to Kafka. It is recommended to make it large enough to survive
		// a ZooKeeper leader election in your setup.
		ShutdownTimeout time.Duration `yaml:"shutdown_timeout"`
	} `yaml:"producer"`

	Consumer struct {

		// Size of all buffered channels created by the consumer module.
		ChannelBufferSize int `yaml:"channel_buffer_size"`

		// Consume request will wait at most this long until a message from the
		// specified group/topic becomes available.
		LongPollingTimeout time.Duration `yaml:"long_polling_timeout"`

		// Period of time that Kafka-Pixy should keep registration with a
		// consumer group or subscription for a topic in the absence of
		// requests to the consumer group or topic.
		RegistrationTimeout time.Duration `yaml:"registration_timeout"`

		// If a request to a Kafka-Pixy fails for any reason, then it should
		// wait this long before retrying.
		BackOffTimeout time.Duration `yaml:"backoff_timeout"`

		// Consumer should wait this long after it gets notification that a
		// consumer joined/left its consumer group before starting rebalancing.
		RebalanceDelay time.Duration `yaml:"rebalance_delay"`

		// How frequently to commit offsets to Kafka.
		OffsetsCommitInterval time.Duration `yaml:"offsets_commit_interval"`
	} `yaml:"consumer"`
}

Proxy defines configuration of a proxy to a particular Kafka/ZooKeeper cluster.

func DefaultProxy added in v0.12.0

func DefaultProxy() *Proxy

DefaultProxy returns configuration used by default.

Jump to

Keyboard shortcuts

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