Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the Kafka implementation for asyncapi-codegen.
func NewController ¶
func NewController(hosts []string, options ...ControllerOption) *Controller
NewController creates a new KafkaController that fulfill the BrokerLinker interface.
func (*Controller) Publish ¶
func (c *Controller) Publish(ctx context.Context, channel string, um extensions.BrokerMessage) error
Publish a message to the broker.
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe(ctx context.Context, channel string) (extensions.BrokerChannelSubscription, error)
Subscribe to messages from the broker.
type ControllerOption ¶
type ControllerOption func(controller *Controller)
ControllerOption is a function that can be used to configure a Kafka controller Examples: WithGroupID(), WithPartition(), WithMaxBytes(), WithLogger().
func WithGroupID ¶
func WithGroupID(groupID string) ControllerOption
WithGroupID set a custom group ID for channel subscription.
func WithLogger ¶
func WithLogger(logger extensions.Logger) ControllerOption
WithLogger set a custom logger that will log operations on broker controller.
func WithMaxBytes ¶
func WithMaxBytes(maxBytes int) ControllerOption
WithMaxBytes set the maximum size of a message.
func WithPartition ¶
func WithPartition(partition int) ControllerOption
WithPartition set the partition to use for the topic.
Click to show internal directories.
Click to hide internal directories.