receiver

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Code generated by events generator, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler added in v0.0.5

type EventHandler[T any] func(context.Context, rest.RESTClient, *T)

func (EventHandler[T]) Handle added in v0.0.5

func (eh EventHandler[T]) Handle(ctx context.Context, c rest.RESTClient, i interface{})

func (EventHandler[T]) New added in v0.0.5

func (eh EventHandler[T]) New() interface{}

type EventHandlerIface added in v0.0.5

type EventHandlerIface interface {
	New() interface{}
	Handle(context.Context, rest.RESTClient, interface{})
}

type HandlerFunc

type HandlerFunc interface{}

type LocalReceiver

type LocalReceiver struct {
	// contains filtered or unexported fields
}

func NewLocalReceiver

func NewLocalReceiver(opts ...ReceiverOption) *LocalReceiver

func (LocalReceiver) On

func (e LocalReceiver) On(handler HandlerFunc) error

func (LocalReceiver) Route

func (e LocalReceiver) Route(event string, data json.RawMessage) error

func (*LocalReceiver) Run added in v0.0.4

func (r *LocalReceiver) Run(ctx context.Context) error

type NATSReceiver added in v0.0.4

type NATSReceiver struct {
	// contains filtered or unexported fields
}

func NewNATSReceiver added in v0.0.4

func NewNATSReceiver(url string, natsOptions []nats.Option, opts ...ReceiverOption) (*NATSReceiver, error)

func (NATSReceiver) On added in v0.0.4

func (e NATSReceiver) On(handler HandlerFunc) error

func (NATSReceiver) Route added in v0.0.4

func (e NATSReceiver) Route(event string, data json.RawMessage) error

func (*NATSReceiver) Run added in v0.0.4

func (r *NATSReceiver) Run(ctx context.Context) error

type Receiver

type Receiver interface {
	On(handler HandlerFunc) error
	Route(event string, data json.RawMessage) error
	Run(ctx context.Context) error
}

Receiver is a generic interface for receiving events from a Dispatcher

type ReceiverOption

type ReceiverOption func(*eventRouter)

func WithClient

func WithClient(c rest.RESTClient) ReceiverOption

func WithErrorHandler

func WithErrorHandler(h func(error)) ReceiverOption

func WithGroupName added in v0.0.4

func WithGroupName(name string) ReceiverOption

func WithLogger

func WithLogger(l zerolog.Logger) ReceiverOption

type RedisReceiver

type RedisReceiver struct {
	// contains filtered or unexported fields
}

func NewRedisReceiver

func NewRedisReceiver(connectOpts *redis.Options, opts ...ReceiverOption) (*RedisReceiver, error)

func (RedisReceiver) On

func (e RedisReceiver) On(handler HandlerFunc) error

func (RedisReceiver) Route

func (e RedisReceiver) Route(event string, data json.RawMessage) error

func (*RedisReceiver) Run added in v0.0.4

func (r *RedisReceiver) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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