Documentation
¶
Overview ¶
Package "issue283" provides primitives to interact with the AsyncAPI specification.
Code generated by github.com/lerenn/asyncapi-codegen version (devel) DO NOT EDIT.
Index ¶
Constants ¶
const ( // PingChannelPath is the constant representing the 'PingChannel' channel path. PingChannelPath = "v3.issue283.ping" // PongChannelPath is the constant representing the 'PongChannel' channel path. PongChannelPath = "v3.issue283.pong" )
const AsyncAPIVersion = "1.0.0"
AsyncAPIVersion is the version of the used AsyncAPI document
Variables ¶
var ChannelsPaths = []string{ PingChannelPath, PongChannelPath, }
ChannelsPaths is an array of all channels paths
Functions ¶
This section is empty.
Types ¶
type ControllerOption ¶
type ControllerOption func(controller *controller)
ControllerOption is the type of the options that can be passed when creating a new Controller
func WithErrorHandler ¶
func WithErrorHandler(handler extensions.ErrorHandler) ControllerOption
WithErrorHandler attaches a errorhandler to handle errors from subscriber functions
func WithLogger ¶
func WithLogger(logger extensions.Logger) ControllerOption
WithLogger attaches a logger to the controller
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...extensions.Middleware) ControllerOption
WithMiddlewares attaches middlewares that will be executed when sending or receiving messages
type HeadersFromPingMessage ¶
type HeadersFromPingMessage struct {
CorrelationId *string `json:"correlationId,omitempty"`
}
HeadersFromPingMessage is a schema from the AsyncAPI specification required in messages
type HeadersFromPongMessage ¶
type HeadersFromPongMessage struct {
CorrelationId *string `json:"correlationId,omitempty"`
}
HeadersFromPongMessage is a schema from the AsyncAPI specification required in messages
type PingMessage ¶
type PingMessage struct {
// Headers will be used to fill the message headers
Headers HeadersFromPingMessage
// Payload will be inserted in the message payload
Payload PingMessagePayload
}
PingMessage is the message expected for 'PingMessage' channel.
func NewPingMessage ¶
func NewPingMessage() PingMessage
func (PingMessage) CorrelationID ¶
func (msg PingMessage) CorrelationID() string
CorrelationID will give the correlation ID of the message, based on AsyncAPI spec
func (*PingMessage) SetAsResponseFrom ¶
func (msg *PingMessage) SetAsResponseFrom(req MessageWithCorrelationID)
SetAsResponseFrom will correlate the message with the one passed in parameter. It will assign the 'req' message correlation ID to the message correlation ID, both specified in AsyncAPI spec.
func (*PingMessage) SetCorrelationID ¶
func (msg *PingMessage) SetCorrelationID(id string)
SetCorrelationID will set the correlation ID of the message, based on AsyncAPI spec
type PingMessagePayload ¶
type PingMessagePayload struct {
Event *string `json:"event,omitempty"`
}
PingMessagePayload is a schema from the AsyncAPI specification required in messages
type PongMessage ¶
type PongMessage struct {
// Headers will be used to fill the message headers
Headers HeadersFromPongMessage
// Payload will be inserted in the message payload
Payload PongMessagePayload
}
PongMessage is the message expected for 'PongMessage' channel.
func NewPongMessage ¶
func NewPongMessage() PongMessage
func (PongMessage) CorrelationID ¶
func (msg PongMessage) CorrelationID() string
CorrelationID will give the correlation ID of the message, based on AsyncAPI spec
func (*PongMessage) SetAsResponseFrom ¶
func (msg *PongMessage) SetAsResponseFrom(req MessageWithCorrelationID)
SetAsResponseFrom will correlate the message with the one passed in parameter. It will assign the 'req' message correlation ID to the message correlation ID, both specified in AsyncAPI spec.
func (*PongMessage) SetCorrelationID ¶
func (msg *PongMessage) SetCorrelationID(id string)
SetCorrelationID will set the correlation ID of the message, based on AsyncAPI spec
type PongMessagePayload ¶
type PongMessagePayload struct {
Event *string `json:"event,omitempty"`
}
PongMessagePayload is a schema from the AsyncAPI specification required in messages