Documentation ¶
Index ¶
- func MakeEndpointOfEventCreated(s Service) endpoint.Endpoint
- func NewEventHandler(svc Service, codecs eventcodec.Codecs) eventpubsub.Handler
- func ValidateEventCreatedRequest(newSchema func(*EventCreatedRequest) validating.Schema) httpoption.Validator
- type EventCreatedRequest
- type EventCreatedResponse
- type EventPublisher
- type Service
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeEndpointOfEventCreated ¶
MakeEndpointOfEventCreated creates the endpoint for s.EventCreated.
func NewEventHandler ¶
func NewEventHandler(svc Service, codecs eventcodec.Codecs) eventpubsub.Handler
func ValidateEventCreatedRequest ¶
func ValidateEventCreatedRequest(newSchema func(*EventCreatedRequest) validating.Schema) httpoption.Validator
ValidateEventCreatedRequest creates a validator for EventCreatedRequest.
Types ¶
type EventCreatedRequest ¶
type EventCreatedRequest struct {
Id int `json:"id"`
}
type EventCreatedResponse ¶
type EventCreatedResponse struct {
Err error `json:"-"`
}
func (*EventCreatedResponse) Body ¶
func (r *EventCreatedResponse) Body() interface{}
func (*EventCreatedResponse) Failed ¶
func (r *EventCreatedResponse) Failed() error
Failed implements endpoint.Failer.
type EventPublisher ¶
type EventPublisher struct {
// contains filtered or unexported fields
}
EventPublisher implements Service on the publisher side.
EventPublisher should only be used in limited scenarios where only one subscriber is involved and the publisher depends on the interface provided by the subscriber.
In typical use cases of the publish-subscribe pattern - many subscribers are involved and the publisher knows nothing about the subscribers - you should just send the event in the way it should be.
func NewEventPublisher ¶
func NewEventPublisher(publisher eventpubsub.Publisher, codecs eventcodec.Codecs) *EventPublisher
func (*EventPublisher) EventCreated ¶
func (p *EventPublisher) EventCreated(ctx context.Context, id int) (err error)
type Subscriber ¶
type Subscriber struct{}
func (*Subscriber) EventCreated ¶
func (s *Subscriber) EventCreated(ctx context.Context, id int) error
Click to show internal directories.
Click to hide internal directories.