templates

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args added in v0.19.2

func Args(vs ...any) []any

Args is a function used to pass arguments to templates.

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 DescribeStruct added in v0.10.1

func DescribeStruct(st any) string

func GenerateChannelPath added in v0.9.0

func GenerateChannelPath(ch asyncapi.Channel) string

func HasField

func HasField(v interface{}, name string) bool

HasField will check if a struct has a field with the given name.

func IsRequired added in v0.4.0

func IsRequired(any asyncapi.Any, field string) bool

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

func MultiLineComment added in v0.10.1

func MultiLineComment(comment string) string

func Namify

func Namify(sentence string) string

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.

func SnakeCase

func SnakeCase(sentence string) string

SnakeCase will convert a sentence to snake case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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