Documentation ¶
Index ¶
- Variables
- func BrokerAddress() []string
- func Config() wkafka.Config
- func Consume[T any](ctx context.Context, cfg ReadConfig, ...) error
- func TestClient(opts ...OptionTestClient) (*wkafka.Client, error)
- type Generate
- func (g *Generate) Cleanup() (kadm.DeleteTopicResponses, error)
- func (g *Generate) CreateTopics(ctx context.Context, topics ...Topic) ([]kadm.CreateTopicResponse, error)
- func (g *Generate) DeleteGroups(ctx context.Context, groups ...string) (kadm.DeleteGroupResponses, error)
- func (g *Generate) DeleteTopics(ctx context.Context, topics ...string) (kadm.DeleteTopicResponses, error)
- type OptionTestClient
- type ReadConfig
- type Topic
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultBrokerAddress = []string{"127.0.0.1:9092"}
)
Functions ¶
func BrokerAddress ¶
func BrokerAddress() []string
func Consume ¶ added in v0.3.2
func Consume[T any](ctx context.Context, cfg ReadConfig, fn func(ctx context.Context, data T) error) error
Consume for testing creating client and start consuming messages to your function.
- Cancel the context to stop this function.
func TestClient ¶
func TestClient(opts ...OptionTestClient) (*wkafka.Client, error)
Types ¶
type Generate ¶
type Generate struct { Topics map[string]struct{} // contains filtered or unexported fields }
func NewGenerate ¶
func (*Generate) CreateTopics ¶
func (*Generate) DeleteGroups ¶ added in v0.3.2
func (*Generate) DeleteTopics ¶ added in v0.3.2
type OptionTestClient ¶ added in v0.3.2
type OptionTestClient func(*optionTestClient)
func WithConfig ¶ added in v0.3.2
func WithConfig(cfg wkafka.Config) OptionTestClient
func WithContext ¶ added in v0.3.2
func WithContext(ctx context.Context) OptionTestClient
func WithWafkaOptions ¶ added in v0.3.2
func WithWafkaOptions(opts ...wkafka.Option) OptionTestClient
type ReadConfig ¶ added in v0.3.2
type ReadConfig struct { Name string KafkaConfig wkafka.Config KafkaConsumer wkafka.ConsumerConfig }
Click to show internal directories.
Click to hide internal directories.