Documentation ¶
Overview ¶
Package kafkaadmin provides Kafka administrative functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SecurityProtocolSet is the set of protocols supported to communicate with brokers SecurityProtocolSet = map[string]struct{}{"PLAINTEXT": empty, "SSL": empty, "SASL_PLAINTEXT": empty, "SASL_SSL": empty} // SASLMechanismSet is the set of mechanisms supported for client to broker authentication SASLMechanismSet = map[string]struct{}{"PLAIN": empty, "SCRAM-SHA-256": empty, "SCRAM-SHA-512": empty} )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements a KafkaAdmin.
func NewClientWithFactory ¶
func NewClientWithFactory(cfg Config, factory FactoryFunc) (*Client, error)
NewClientWithFactory returns a new admin Client using a factory func for the kafkaAdminClient
func (Client) CreateTopic ¶
func (c Client) CreateTopic(ctx context.Context, cfg CreateTopicConfig) error
CreateTopic creates a topic.
type Config ¶
type Config struct { BootstrapServers string GroupId string SSLCALocation string SecurityProtocol string SASLMechanism string SASLUsername string SASLPassword string }
Config holds Client configuration parameters.
type CreateTopicConfig ¶ added in v3.7.0
type CreateTopicConfig struct { Name string Partitions int ReplicationFactor int Config map[string]string ReplicaAssignment ReplicaAssignment }
CreateTopicConfig holds CreateTopic parameters.
type FactoryFunc ¶
type FactoryFunc func(conf *kafka.ConfigMap) (*kafka.AdminClient, error)
type KafkaAdmin ¶ added in v3.7.0
type KafkaAdmin interface { Close() CreateTopic(context.Context, CreateTopicConfig) error DeleteTopic(context.Context, string) error }
KafkaAdmin interface.
type ReplicaAssignment ¶ added in v3.7.0
type ReplicaAssignment [][]int32
Click to show internal directories.
Click to hide internal directories.