Documentation
¶
Index ¶
- func ChannelToMessage(ch asyncapi.Channel, direction string) (*asyncapi.Message, error)
- func GenerateChannelPath(ch asyncapi.Channel) string
- func GetChildrenObjectSchemas(s asyncapi.Schema) []*asyncapi.Schema
- func HelpersFunctions() template.FuncMap
- func IsRequired(schema asyncapi.Schema, field string) bool
- func OperationName(channel asyncapi.Channel) string
- func ReferenceToStructAttributePath(ref string) string
- func ReferenceToTypeName(ref string) (string, error)
- func SetForcePointers(force bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelToMessage ¶ added in v0.35.1
ChannelToMessage will convert a channel to its message, based on publish/subscribe.
func GenerateChannelPath ¶
GenerateChannelPath will generate a channel path with the given channel.
func GetChildrenObjectSchemas ¶ added in v0.35.1
GetChildrenObjectSchemas will return all the children object schemas of a schema, only from first level and without AnyOf, AllOf and OneOf.
func HelpersFunctions ¶
HelpersFunctions returns the functions that can be used as helpers in a golang template.
func IsRequired ¶
IsRequired will check if a field is required in a asyncapi struct.
func OperationName ¶
OperationName returns `operationId` value from Publish or Subscribe operation if any. If no `operationID` exists — return provided default value (`name`).
func ReferenceToStructAttributePath ¶
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 ¶
ReferenceToTypeName will convert a reference to a type name in the form of golang conventional type names.
func SetForcePointers ¶ added in v0.46.4
func SetForcePointers(force bool)
SetForcePointers configures whether all struct fields (except arrays) should be generated as pointers. It is reset on every generation run so the setting does not leak between successive generations sharing the same process.
Types ¶
This section is empty.