issue283

package
v0.48.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

View Source
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"
)
View Source
const AsyncAPIVersion = "1.0.0"

AsyncAPIVersion is the version of the used AsyncAPI document

Variables

View Source
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 Error

type Error struct {
	Channel string
	Err     error
}

func (*Error) Error

func (e *Error) Error() string

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 MessageWithCorrelationID

type MessageWithCorrelationID interface {
	CorrelationID() string
	SetCorrelationID(id string)
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL