Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmqpEndpoint ¶
type AmqpEndpoint struct {
// contains filtered or unexported fields
}
AmqpEndpoint uses amqp transport to send out a message.
func (AmqpEndpoint) Name ¶
func (a AmqpEndpoint) Name() string
func (AmqpEndpoint) Send ¶
func (a AmqpEndpoint) Send(ctx context.Context, msg *message.OutcomingMessage, opts ...DeliveryOption) error
type DeliveryOption ¶
type DeliveryOption func(o *deliveryOptions) error
func WithDelay ¶
func WithDelay(delay time.Duration) DeliveryOption
WithDelay option waits specified duration before delivering a message
type Endpoint ¶
type Endpoint interface {
// Name is a unique name of the endpoint
Name() string
// Send sends a message with specified implementation
Send(ctx context.Context, message *message.OutcomingMessage, options ...DeliveryOption) error
}
Endpoint knows where to deliver a message
func NewAmqpEndpoint ¶
func NewAmqpEndpoint(name string, amqpTransport transport.Transport, destination transport.DeliveryDestination, msgMarshaller message.Marshaller) Endpoint
NewAmqpEndpoint creates new instance of AmqpEndpoint
type Router ¶
type Router interface {
// RegisterEndpoint assigns types of objects to an endpoint
RegisterEndpoint(endpoint Endpoint, objects ...message.Object)
// Route returns a list of endpoints that were assigned to a type of object
Route(obj message.Object) []Endpoint
}
Router is a registry of Endpoints and types. Each type can have multiple endpoints assigned.
Click to show internal directories.
Click to hide internal directories.