api

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeFlags

type ConsumeFlags struct {
	Follow     bool
	Tail       int32
	OffsetFlag string
}

func DefaultConsumeFlags

func DefaultConsumeFlags() ConsumeFlags

type ConsumerGroup

type ConsumerGroup struct {
	Name      string
	State     string
	Consumers int
}

type KafkaDataSource

type KafkaDataSource interface {
	Init(cfgOption string)
	GetTopics() (map[string]Topic, error)
	GetContexts() ([]string, error)
	GetContext() string
	SetContext(contextName string) error
	GetConsumerGroups() ([]ConsumerGroup, error)
	ConsumeTopic(ctx context.Context, topicName string, flags ConsumeFlags, handleMessage MessageHandlerFunc, onError func(err any)) error
}

type Message

type Message struct {
	Key           string
	Value         string
	Offset        int64
	Partition     int32
	KeySchemaID   string
	ValueSchemaID string
}

type MessageHandlerFunc

type MessageHandlerFunc func(msg Message)

type Topic

type Topic struct {
	// NumPartitions contains the number of partitions to create in the topic
	NumPartitions int32
	// ReplicationFactor contains the number of replicas to create for each partition
	ReplicationFactor int16
	// ReplicaAssignment contains the manual partition assignment, or the empty
	// array if we are using automatic assignment.
	ReplicaAssignment map[int32][]int32
	// ConfigEntries contains the custom topic configurations to set.
	ConfigEntries map[string]*string
	// Num of messages in the topic across all partitions
	MessageCount int64
}

Jump to

Keyboard shortcuts

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