helper

package
v0.0.0-...-6d44d83 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEnumByDescriptor

func FindEnumByDescriptor(enums []*protogen.Enum, ed protoreflect.EnumDescriptor) *protogen.Enum

func FindEnumFromMessageByDescriptor

func FindEnumFromMessageByDescriptor(messages []*protogen.Message, ed protoreflect.EnumDescriptor) *protogen.Enum

func FindMessageByDescriptor

func FindMessageByDescriptor(messages []*protogen.Message, md protoreflect.MessageDescriptor) *protogen.Message

func GenGetArguments

func GenGetArguments(keys []MapKey) string

GenGetArguments generates function arguments, which are the real values passed to the function.

func GenGetParams

func GenGetParams(keys []MapKey) string

GenGetParams generates function parameters, which are the names listed in the function's definition.

func GetTypeEmptyValue

func GetTypeEmptyValue(fd protoreflect.FieldDescriptor) string

func ParseGoType

func ParseGoType(gen *protogen.Plugin, fd protoreflect.FieldDescriptor) any

ParseGoType converts a FieldDescriptor to its Go type. returns string if fd is scalar type, and protogen.GoIdent if fd is enum or message type.

func ParseIndexFieldName

func ParseIndexFieldName(gen *protogen.Plugin, fd protoreflect.FieldDescriptor) string

func ParseIndexFieldNameAsFuncParam

func ParseIndexFieldNameAsFuncParam(gen *protogen.Plugin, fd protoreflect.FieldDescriptor) string

func ParseIndexFieldNameAsKeyStructFieldName

func ParseIndexFieldNameAsKeyStructFieldName(gen *protogen.Plugin, fd protoreflect.FieldDescriptor) string

Types

type MapKey

type MapKey struct {
	Type string
	Name string
}

func AddMapKey

func AddMapKey(gen *protogen.Plugin, fd protoreflect.FieldDescriptor, keys []MapKey) []MapKey

Jump to

Keyboard shortcuts

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