templates

package
v0.46.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelToMessage added in v0.35.1

func ChannelToMessage(ch asyncapi.Channel, direction string) *asyncapi.Message

ChannelToMessage will convert a channel to its message, based on publish/subscribe.

func ForcePointerOnFields added in v0.45.0

func ForcePointerOnFields()

ForcePointerOnFields is used to force the generation of all fields as pointers, except for arrays.

func GenerateChannelPath

func GenerateChannelPath(ch asyncapi.Channel) string

GenerateChannelPath will generate a channel path with the given channel.

func GetChildrenObjectSchemas added in v0.35.1

func GetChildrenObjectSchemas(s asyncapi.Schema) []*asyncapi.Schema

GetChildrenObjectSchemas will return all the children object schemas of a schema, only from first level and without AnyOf, AllOf and OneOf.

func HelpersFunctions

func HelpersFunctions() template.FuncMap

HelpersFunctions returns the functions that can be used as helpers in a golang template.

func IsRequired

func IsRequired(schema asyncapi.Schema, field string) bool

IsRequired will check if a field is required in a asyncapi struct.

func OperationName

func OperationName(channel asyncapi.Channel) string

OperationName returns `operationId` value from Publish or Subscribe operation if any. If no `operationID` exists — return provided default value (`name`).

func ReferenceToStructAttributePath

func ReferenceToStructAttributePath(ref string) string

ReferenceToStructAttributePath will convert a reference to a struct attribute path in the form of "a.b.c" where a, b and c are struct attributes in the form of golang conventional type names.

func ReferenceToTypeName

func ReferenceToTypeName(ref string) string

ReferenceToTypeName will convert a reference to a type name in the form of golang conventional type names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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