asyncapi

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package "asyncapi" provides primitives to interact with the AsyncAPI specification.

Code generated by github.com/lerenn/asyncapi-codegen version v0.39.0 DO NOT EDIT.

Index

Constants

View Source
const AsyncAPIVersion = ""

AsyncAPIVersion is the version of the used AsyncAPI document

Variables

This section is empty.

Functions

func AddReplyToSuffix

func AddReplyToSuffix(address, caller string) string

AddReplyToSuffix adds a random suffix to the replyTo channel name.

func UnwrapError

func UnwrapError(errAny any) error

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 ErrorSchema

type ErrorSchema struct {
	// Description: Code to identify the error type, based on HTTP errors
	Code int64 `json:"code"`

	// Description: Main error reason
	Message string `json:"message"`
}

ErrorSchema is a schema from the AsyncAPI specification required in messages Description: Response to a failed call

type LoggerWrapper

type LoggerWrapper struct {
}

func (LoggerWrapper) Error

func (lw LoggerWrapper) Error(ctx context.Context, msg string, info ...extensions.LogInfo)

func (LoggerWrapper) Info

func (lw LoggerWrapper) Info(ctx context.Context, msg string, info ...extensions.LogInfo)

func (LoggerWrapper) Warning

func (lw LoggerWrapper) Warning(ctx context.Context, msg string, info ...extensions.LogInfo)

type MessageWithCorrelationID

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

Jump to

Keyboard shortcuts

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