kafka

package
v0.0.49-panic Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_kafka_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

func (CompletedConfig) NewClient

func (c CompletedConfig) NewClient() (*kafka.Client, error)

NewClient creates a new client which a high-level API to interact with kafka brokers.

func (CompletedConfig) NewReaderConfig

func (c CompletedConfig) NewReaderConfig() (*kafka.Reader, error)

NewReaderConfig creates a new writer that is a configuration object used to create new instances of Reader.

func (CompletedConfig) NewWriter

func (c CompletedConfig) NewWriter() (*kafka.Writer, error)

NewWriter creates a new writer which provides the implementation of a producer of kafka messages that automatically distributes messages across partitions of a single topic using a configurable balancing policy.

func (CompletedConfig) Validate added in v0.0.44

func (c CompletedConfig) Validate() error

Validate checks Config.

type Config

type Config struct {
	GetViper  func() *viper.Viper // If set, overrides params below
	Proto     Kafka
	Validator *validator.Validate
}

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values

func NewViperConfig

func NewViperConfig(getViper func() *viper.Viper) *Config

NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to ApplyOptions, do that first. It's mutating the receiver. ApplyOptions is called inside.

type Kafka

type Kafka struct {

	// https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
	// Either a single address or a seed list of host:port addresses
	// of cluster/sentinel nodes.
	Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"`
	// contains filtered or unexported fields
}

func (*Kafka) Descriptor deprecated

func (*Kafka) Descriptor() ([]byte, []int)

Deprecated: Use Kafka.ProtoReflect.Descriptor instead.

func (*Kafka) GetAddrs

func (x *Kafka) GetAddrs() []string

func (*Kafka) ProtoMessage

func (*Kafka) ProtoMessage()

func (*Kafka) ProtoReflect

func (x *Kafka) ProtoReflect() protoreflect.Message

func (*Kafka) Reset

func (x *Kafka) Reset()

func (*Kafka) String

func (x *Kafka) String() string

Jump to

Keyboard shortcuts

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