Documentation ¶
Overview ¶
Package admin provides an interface for kafka administrative operations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKafkaAdmin ¶
func NewKafkaAdmin(bootstrapServer []string, options ...KafkaAdminOption) *kafkaAdmin
Types ¶
type KafkaAdmin ¶
type KafkaAdmin interface { FetchInfo(topics []string) (map[string]*Topic, error) CreateTopics(topics map[string]*Topic) error DeleteTopics(topics []string) (map[string]error, error) Close() }
KafkaAdmin
type KafkaAdminOption ¶
type KafkaAdminOption func(*kafkaAdminOptions)
func WithKafkaVersion ¶
func WithKafkaVersion(version sarama.KafkaVersion) KafkaAdminOption
func WithLogger ¶
func WithLogger(logger log.Logger) KafkaAdminOption
type MockKafkaAdmin ¶
type MockKafkaAdmin struct {
Topics *Topics
}
func NewMockAdminWithTopics ¶
func NewMockAdminWithTopics(tps map[string]*Topic) *MockKafkaAdmin
func (*MockKafkaAdmin) Close ¶
func (m *MockKafkaAdmin) Close()
func (*MockKafkaAdmin) CreateTopics ¶
func (m *MockKafkaAdmin) CreateTopics(topics map[string]*Topic) error
func (*MockKafkaAdmin) DeleteTopics ¶
func (m *MockKafkaAdmin) DeleteTopics(topics []string) (map[string]error, error)
type MockPartition ¶
func (*MockPartition) FetchAll ¶
func (p *MockPartition) FetchAll() (records []*data.Record)
func (*MockPartition) Latest ¶
func (p *MockPartition) Latest() int64
type MockTopic ¶
func (*MockTopic) AddPartition ¶
func (*MockTopic) Partitions ¶
func (tp *MockTopic) Partitions() []*MockPartition
Click to show internal directories.
Click to hide internal directories.