Documentation ¶
Index ¶
- type SubOption
- type Subscriber
- func NewSubscriber[K eventsourcing.ID, PK eventsourcing.IDPt[K]](logger *slog.Logger, js nats.JetStreamContext, topic projection.ConsumerTopic, ...) *Subscriber[K]
- func NewSubscriberWithConn[K eventsourcing.ID, PK eventsourcing.IDPt[K]](logger *slog.Logger, nc *nats.Conn, topic projection.ConsumerTopic) (*Subscriber[K], error)
- func NewSubscriberWithURL[K eventsourcing.ID, PK eventsourcing.IDPt[K]](ctx context.Context, logger *slog.Logger, url string, ...) (*Subscriber[K], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubOption ¶
type SubOption[K eventsourcing.ID] func(*Subscriber[K])
func WithMsgCodec ¶
func WithMsgCodec[K eventsourcing.ID](codec sink.Codec[K]) SubOption[K]
type Subscriber ¶
type Subscriber[K eventsourcing.ID] struct { // contains filtered or unexported fields }
func NewSubscriber ¶
func NewSubscriber[K eventsourcing.ID, PK eventsourcing.IDPt[K]]( logger *slog.Logger, js nats.JetStreamContext, topic projection.ConsumerTopic, options ...SubOption[K], ) *Subscriber[K]
func NewSubscriberWithConn ¶ added in v0.32.0
func NewSubscriberWithConn[K eventsourcing.ID, PK eventsourcing.IDPt[K]]( logger *slog.Logger, nc *nats.Conn, topic projection.ConsumerTopic, ) (*Subscriber[K], error)
func NewSubscriberWithURL ¶ added in v0.32.0
func NewSubscriberWithURL[K eventsourcing.ID, PK eventsourcing.IDPt[K]]( ctx context.Context, logger *slog.Logger, url string, topic projection.ConsumerTopic, ) (*Subscriber[K], error)
func (*Subscriber[K]) StartConsumer ¶
func (s *Subscriber[K]) StartConsumer(ctx context.Context, startTime *time.Time, projName string, handler projection.ConsumerHandler[K], options ...projection.ConsumerOption[K]) (er error)
func (*Subscriber[K]) Topic ¶ added in v0.32.0
func (s *Subscriber[K]) Topic() string
Click to show internal directories.
Click to hide internal directories.