Documentation ¶
Index ¶
- func NewHandlerOption[T any](isSync bool, handler func(ctx context.Context, msg *T) error) pubsub.HandlerOptions
- func Publish[T any](ctx context.Context, obj *T)
- func PublishJSON(ctx context.Context, topic string, obj interface{})
- func PublishLocal[T any](ctx context.Context, eventData T) error
- func SetClient(serviceName string, provider pubsub.Provider)
- func Subscribe[T any](handler func(ctx context.Context, msg *T) error)
- func SubscribeSync[T any](handler func(ctx context.Context, msg *T) error)
- type EntityCreatedEvent
- type EntityCreatingEvent
- type EntityDeletedEvent
- type EntityUpdatedEvent
- type EntityUpdatingEvent
- type LocalEventHandler
- type MemoryProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandlerOption ¶
func PublishJSON ¶
Types ¶
type EntityCreatedEvent ¶
type EntityCreatedEvent[T any] struct { Entity *T `json:"entity"` }
func Created ¶
func Created[T any](entity *T) *EntityCreatedEvent[T]
type EntityCreatingEvent ¶
type EntityCreatingEvent[T any] struct { Entity *T `json:"entity"` }
func Creating ¶
func Creating[T any](entity *T) *EntityCreatingEvent[T]
type EntityDeletedEvent ¶
func Deleted ¶
func Deleted[T any](entity *T) *EntityDeletedEvent[T]
type EntityUpdatedEvent ¶
type EntityUpdatedEvent[T any] struct { Entity *T `json:"entity"` }
func Updated ¶
func Updated[T any](entity *T) *EntityUpdatedEvent[T]
type EntityUpdatingEvent ¶
type EntityUpdatingEvent[T any] struct { Entity *T `json:"entity"` }
func Updating ¶
func Updating[T any](entity *T) *EntityUpdatingEvent[T]
type LocalEventHandler ¶
type MemoryProvider ¶
type MemoryProvider struct { ErrorHandler func(ctx context.Context, msg *pubsub.Msg, err error) // contains filtered or unexported fields }
func NewMemoryProvider ¶
func NewMemoryProvider() *MemoryProvider
func (*MemoryProvider) Publish ¶
func (mp *MemoryProvider) Publish(ctx context.Context, topic string, m *pubsub.Msg) error
func (*MemoryProvider) Shutdown ¶
func (mp *MemoryProvider) Shutdown()
func (*MemoryProvider) Subscribe ¶
func (mp *MemoryProvider) Subscribe(opts pubsub.HandlerOptions, h pubsub.MsgHandler)
Click to show internal directories.
Click to hide internal directories.