Documentation ¶
Index ¶
- func IsUnprocessableEventError(err error) bool
- type EventDesc
- type EventHandlerRegistrar
- type Handler
- type Processor
- type PublishFn
- type PublishOption
- type Publisher
- type PublisherImpl
- type PublisherInterceptor
- type PublisherOption
- type Receiver
- type Sender
- type ServiceDesc
- type ServiceInfo
- type Setuper
- type Subscriber
- type SubscriberInterceptor
- type SubscriberOption
- type UnprocessableEventError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventHandlerRegistrar ¶
type EventHandlerRegistrar interface {
RegisterEventHandler(desc *ServiceDesc, event string, impl interface{})
}
type PublishFn ¶
type PublishFn func(ctx context.Context, name string, e interface{}, p *PublisherImpl, opts ...PublishOption) error
type PublishOption ¶
func WithEventContentType ¶ added in v0.1.4
func WithEventContentType(contentType string) PublishOption
func WithEventDataSchema ¶ added in v0.1.6
func WithEventDataSchema(schema *url.URL) PublishOption
func WithEventExtension ¶ added in v0.1.6
func WithEventExtension(name string, value interface{}) PublishOption
func WithEventSource ¶ added in v0.1.4
func WithEventSource(source string) PublishOption
func WithEventSubject ¶ added in v0.1.6
func WithEventSubject(subject string) PublishOption
type Publisher ¶
type Publisher interface {
Publish(ctx context.Context, name string, event interface{}, opts ...PublishOption) error
}
type PublisherImpl ¶
type PublisherImpl struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher(sender Sender, opts ...PublisherOption) *PublisherImpl
func (*PublisherImpl) Publish ¶
func (p *PublisherImpl) Publish(ctx context.Context, name string, event interface{}, opts ...PublishOption) error
type PublisherInterceptor ¶
type PublisherInterceptor func(ctx context.Context, name string, e interface{}, p *PublisherImpl, pf PublishFn, opts ...PublishOption) error
type PublisherOption ¶
type PublisherOption func(opts *publisherOptions)
func WithChainPublisherInterceptor ¶
func WithChainPublisherInterceptor(interceptors ...PublisherInterceptor) PublisherOption
func WithDefaultPublishOptions ¶ added in v0.1.4
func WithDefaultPublishOptions(pos ...PublishOption) PublisherOption
func WithPublisherContentType ¶
func WithPublisherContentType(t string) PublisherOption
func WithPublisherInterceptor ¶
func WithPublisherInterceptor(f PublisherInterceptor) PublisherOption
type ServiceDesc ¶
type ServiceInfo ¶
type Setuper ¶ added in v0.1.6
type Setuper interface {
Setup(ctx context.Context, serviceName string, info ...ServiceInfo) error
}
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(name string, opts ...SubscriberOption) *Subscriber
func (*Subscriber) GetServiceInfo ¶
func (s *Subscriber) GetServiceInfo() []ServiceInfo
func (*Subscriber) RegisterEventHandler ¶
func (s *Subscriber) RegisterEventHandler(sd *ServiceDesc, eventName string, h interface{})
type SubscriberInterceptor ¶
type SubscriberOption ¶
type SubscriberOption func(opts *subscriberOptions)
func WithChainSubscriberInterceptor ¶
func WithChainSubscriberInterceptor(interceptors ...SubscriberInterceptor) SubscriberOption
func WithSubscriberInterceptor ¶
func WithSubscriberInterceptor(f SubscriberInterceptor) SubscriberOption
type UnprocessableEventError ¶
type UnprocessableEventError struct {
// contains filtered or unexported fields
}
func NewUnprocessableEventError ¶
func NewUnprocessableEventError(err error) *UnprocessableEventError
func (*UnprocessableEventError) Error ¶
func (e *UnprocessableEventError) Error() string
func (*UnprocessableEventError) Unwrap ¶
func (e *UnprocessableEventError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.