Documentation
¶
Index ¶
- type KafkaController
- func (c *KafkaController) Publish(ctx context.Context, channel string, um extensions.BrokerMessage) error
- func (c *KafkaController) SetLogger(logger extensions.Logger)
- func (c *KafkaController) SetQueueName(name string)
- func (c *KafkaController) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)
- type KafkaControllerOption
- type NATS
- func (c *NATS) Publish(_ context.Context, channel string, bm extensions.BrokerMessage) error
- func (c *NATS) SetLogger(logger extensions.Logger)
- func (c *NATS) SetQueueName(name string)
- func (c *NATS) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaController ¶ added in v0.19.0
type KafkaController struct {
// contains filtered or unexported fields
}
KafkaController is the Kafka implementation for asyncapi-codegen
func NewKafkaController ¶ added in v0.19.0
func NewKafkaController(hosts []string, options ...KafkaControllerOption) *KafkaController
NewKafkaController creates a new KafkaController that fulfill the BrokerLinker interface
func (*KafkaController) Publish ¶ added in v0.19.0
func (c *KafkaController) Publish(ctx context.Context, channel string, um extensions.BrokerMessage) error
Publish a message to the broker
func (*KafkaController) SetLogger ¶ added in v0.19.0
func (c *KafkaController) SetLogger(logger extensions.Logger)
SetLogger set a custom logger that will log operations on broker controller
func (*KafkaController) SetQueueName ¶ added in v0.19.0
func (c *KafkaController) SetQueueName(name string)
SetQueueName sets a custom queue name for channel subscription
It can be used for multiple applications listening one the same channel but wants to listen on different queues.
func (*KafkaController) Subscribe ¶ added in v0.19.0
func (c *KafkaController) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)
Subscribe to messages from the broker
type KafkaControllerOption ¶ added in v0.19.0
type KafkaControllerOption func(controller *KafkaController)
func WithGroupID ¶ added in v0.19.0
func WithGroupID(groupID string) KafkaControllerOption
func WithMaxBytes ¶ added in v0.19.0
func WithMaxBytes(maxBytes int) KafkaControllerOption
func WithPartition ¶ added in v0.19.0
func WithPartition(partition int) KafkaControllerOption
type NATS ¶
type NATS struct {
// contains filtered or unexported fields
}
NATS is the NATS implementation for asyncapi-codegen
func (*NATS) Publish ¶
func (c *NATS) Publish(_ context.Context, channel string, bm extensions.BrokerMessage) error
Publish a message to the broker
func (*NATS) SetLogger ¶
func (c *NATS) SetLogger(logger extensions.Logger)
SetLogger set a custom logger that will log operations on broker controller
func (*NATS) SetQueueName ¶
SetQueueName sets a custom queue name for channel subscription
It can be used for multiple applications listening one the same channel but wants to listen on different queues.
func (*NATS) Subscribe ¶
func (c *NATS) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)
Subscribe to messages from the broker