pulse

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts axon.Options) (axon.EventStore, error)

Note: If you need a more controlled init func, write your pulsar lib to implement the EventStore interface.

func InitTestEventStore

func InitTestEventStore(mockClient Client, serviceName string) (axon.EventStore, error)

func NewEvent

func NewEvent(message Message, consumer Consumer) axon.Event

Types

type Client

type Client interface {
	CreateProducer(pulsar.ProducerOptions) (Producer, error)
	Subscribe(pulsar.ConsumerOptions) (Consumer, error)
	CreateReader(pulsar.ReaderOptions) (pulsar.Reader, error)
	TopicPartitions(string) ([]string, error)
	Close()
}

type Consumer

type Consumer interface {
	Recv(ctx context.Context) (Message, error)
	Ack(pulsar.MessageID)
	Close()
}

type Message

type Message interface {
	ID() pulsar.MessageID
	Payload() []byte
	Topic() string
}

type Producer

type Producer interface {
	Send(context.Context, []byte) (pulsar.MessageID, error)
	Close()
}

Jump to

Keyboard shortcuts

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