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. Each proxy configuration is identified by a cluster name. Proxies map[string]*Proxy `yaml:"proxies"` // Default cluster is the one to be used in API calls that do not start with // prefix `/clusters/<cluster>`. If it is not explicitly provided, then the // one mentioned in the `Proxies` section first is assumed. DefaultCluster string `yaml:"default_cluster"` }
App defines Kafka-Pixy application configuration. It mirrors the structure of the JSON configuration file.
func DefaultApp ¶ added in v0.12.0
DefaultApp returns default application configuration where default proxy has the specified cluster.
func FromYAML ¶ added in v0.12.0
FromYAML parses configuration from a YAML string and performs basic validation of parameters.
func FromYAMLFile ¶ added in v0.12.0
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"` // Version of the Kafka cluster. Supported versions are 0.8.2.2 - 0.10.1.0 Version string `yaml:"version"` } `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"` // The type of compression to use on messages. Compression string `yaml:"compression"` // The best-effort number of bytes needed to trigger a flush. FlushBytes int `yaml:"flush_bytes"` // The best-effort frequency of flushes. FlushFrequency time.Duration `yaml:"flush_frequency"` // How long to wait for the cluster to settle between retries. RetryBackoff time.Duration `yaml:"retry_backoff"` // The total number of times to retry sending a message. RetryMax int `yaml:"retry_max"` // The level of acknowledgement reliability needed from the broker. RequiredAcks string `yaml:"required_acks"` // 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 { // Period of time that Kafka-Pixy should wait for an acknowledgement // before retrying. It must be less then RegistrationTimeout. AckTimeout time.Duration `yaml:"ack_timeout"` // Size of all buffered channels created by the consumer module. ChannelBufferSize int `yaml:"channel_buffer_size"` // The default number of message bytes to fetch from the broker in each // request. This should be larger than the majority of your messages, // or else the consumer will spend a lot of time negotiating sizes and // not actually consuming. FetchBytes int `yaml:"fetch_bytes"` // 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"` // How frequently to commit offsets to Kafka. OffsetsCommitInterval time.Duration `yaml:"offsets_commit_interval"` // Kafka-Pixy should wait this long after it gets notification that a // consumer joined/left a consumer group it is a member of before // rebalancing. RebalanceDelay time.Duration `yaml:"rebalance_delay"` // 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. RetryBackoff time.Duration `yaml:"retry_backoff"` } `yaml:"consumer"` }
Proxy defines configuration of a proxy to a particular Kafka/ZooKeeper cluster.
func DefaultProxy ¶ added in v0.12.0
func DefaultProxy() *Proxy
DefaultCluster returns configuration used by default.
func (*Proxy) SaramaProdCfg ¶ added in v0.13.0
SaramaProdCfg returns a config for sarama producer.
Click to show internal directories.
Click to hide internal directories.