Documentation ¶
Index ¶
- Constants
- type BatchPickupRequest
- type BatchPickupResponse
- type Command
- func (o *Command) BatchPickup(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Connection(rw io.Writer, req io.Reader) command.Error
- func (o *Command) GetHandlers() []command.Handler
- func (o *Command) Reconnect(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Register(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Status(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Unregister(rw io.Writer, req io.Reader) command.Error
- type RegisterRoute
- type StatusRequest
- type StatusResponse
Constants ¶
const ( // InvalidRequestErrorCode for invalid requests. InvalidRequestErrorCode = command.Code(iota + command.ROUTE) // ResponseWriteErrorCode for connection ID validation error. RegisterMissingConnIDCode // RegisterRouterErrorCode for register router error. RegisterRouterErrorCode // UnregisterRouterErrorCode for unregister router error. UnregisterRouterErrorCode // Connection for get connection id error. GetConnectionIDErrorCode // ReconnectMissingConnIDCode for connection ID validation error. ReconnectMissingConnIDCode // ReconnectRouterErrorCode for reconnecting router error. ReconnectRouterErrorCode // StatusRequestMissingConnIDCode for connection ID validation error. StatusRequestMissingConnIDCode // StatusRequestErrorCode for status request error. StatusRequestErrorCode // BatchPickupMissingConnIDCode for connection ID validation error. BatchPickupMissingConnIDCode // BatchPickupRequestErrorCode for batch pick up error. BatchPickupRequestErrorCode )
Error codes
const ( // command name CommandName = "mediator" // command methods RegisterCommandMethod = "Register" UnregisterCommandMethod = "Unregister" GetConnectionIDCommandMethod = "Connection" ReconnectCommandMethod = "Reconnect" StatusCommandMethod = "Status" BatchPickupCommandMethod = "BatchPickup" )
constant for the mediator controller
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchPickupRequest ¶
type BatchPickupRequest struct { // ConnectionID of connection for which pending messages needs to be dispatched. ConnectionID string `json:"connectionID"` // Size of batch of pending messages to be dispatched. Size int `json:"batch_size"` }
BatchPickupRequest is request for dispatching pending messages.
type BatchPickupResponse ¶
type BatchPickupResponse struct { // Count of messages dispatched. MessageCount int `json:"message_count"` }
BatchPickupResponse is response for dispatching pending messages.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command contains command operations provided by route controller.
func (*Command) BatchPickup ¶
BatchPickup dispatches pending messages for given connection.
func (*Command) Connection ¶
Connection returns the connectionID of the router.
func (*Command) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller command.
func (*Command) Reconnect ¶
Reconnect sends noop message to reestablish a connection when there is no other reason to message the mediator nolint:dupl
type RegisterRoute ¶
type RegisterRoute struct {
ConnectionID string `json:"connectionID"`
}
RegisterRoute contains parameters for registering/reconnecting router.
type StatusRequest ¶
type StatusRequest struct {
ConnectionID string `json:"connectionID"`
}
StatusRequest is request for getting details about pending messages.
type StatusResponse ¶
type StatusResponse struct {
*messagepickup.Status
}
StatusResponse is status response containing details about pending messages.