templates

package
v0.42.5 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelToMessageTypeName

func ChannelToMessageTypeName(ch asyncapi.Channel) string

ChannelToMessageTypeName will convert a channel to a message type name in the form of golang conventional type names.

func GenerateChannelAddr

func GenerateChannelAddr(ch *asyncapi.Channel) string

GenerateChannelAddr will generate a channel path with the given channel.

func GenerateChannelAddrFromOp

func GenerateChannelAddrFromOp(op asyncapi.Operation) string

GenerateChannelAddrFromOp will generate a channel path with the given operation.

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 OpToChannelTypeName

func OpToChannelTypeName(op asyncapi.Operation) string

OpToChannelTypeName will convert an operation to a channel type name in the form of golang conventional type names.

func OpToMsgTypeName

func OpToMsgTypeName(op asyncapi.Operation) string

OpToMsgTypeName will convert an operation to a message type name in the form of golang conventional type names.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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