enumgen

package
v0.17.83 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEnums

func ApplyEnums(w io.Writer, opts Opts, enums []*protogen.Enum) error

func ApplyEnumsTemplate added in v0.17.78

func ApplyEnumsTemplate(f *protogen.GeneratedFile, opts Opts, enums []*protogen.Enum) error

This function is called with a param which contains the entire definition of a method.

func ApplyMessages

func ApplyMessages(w io.Writer, opts Opts, msgs []*protogen.Message) error

func ApplyMessagesTemplate added in v0.17.78

func ApplyMessagesTemplate(f *protogen.GeneratedFile, opts Opts, msgs []*protogen.Message) error

This function is called with a param which contains the entire definition of a method.

func ApplyTSEnums added in v0.16.75

func ApplyTSEnums(w io.Writer, opts TSOpts, enums []*protogen.Enum) error

func ApplyTemplateTS added in v0.16.75

func ApplyTemplateTS(f *protogen.GeneratedFile, opts TSOpts, fileEnumInfos []FileEnumInfo) error

This function is called with a param which contains the entire definition of a method.

func CreateEnumDescription

func CreateEnumDescription(en *protogen.Enum, args Opts) *api.EnumDescription

CreateEnumDescription convert enum descriptor to EnumMeta message

func CreateMessageDescription

func CreateMessageDescription(msg *protogen.Message, args Opts) *api.MessageDescription

CreateMessageDescription convert enum descriptor to EnumMeta message

func GetEnums

func GetEnums(msgs []*protogen.Message) []*protogen.Enum

func GetMessagesToDescribe

func GetMessagesToDescribe(opts Opts, msgs []*protogen.Message, services []*protogen.Service) []*protogen.Message

Types

type FileEnumInfo added in v0.16.75

type FileEnumInfo struct {
	FileName string
	Enums    []*protogen.Enum
}

type Opts

type Opts struct {
	// Package provides package name
	Package string
	// SkipMessageDescriptionPackage is the package name to skip message description generation
	SkipMessageDescriptionPackage string
}

Opts are the options to set for rendering the template.

type TSOpts added in v0.16.75

type TSOpts struct {
	// BaseImportPath provides the base import path for TypeScript code
	// example: src/services/foo/protogen
	BaseImportPath string
}

TSOpts are the options to set for rendering the template.

Jump to

Keyboard shortcuts

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