codegen

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvokeGeneratorForFiles

func InvokeGeneratorForFiles(plugin *protogen.Plugin, generator FileGeneratorFunc) error

func IterateMessages

func IterateMessages(messages []*protogen.Message, fn func(message *protogen.Message) error) error

IterateMessages iterates over all messages (including embedded nested messages). It skips internal auto generated messages for things like maps. It calls fn for each message. If fn returns an error, iterateMessages will also error. We can't use go 1.23 iterator functions here yet since we support a minimum of go version 1.22.

func NeedsPointer

func NeedsPointer(f *protogen.Field) bool

NeedsPointer returns if a field needs a pointer for setting the value.

func NewFileWithBoilerplate

func NewFileWithBoilerplate(plugin *protogen.Plugin, file *protogen.File, fileName string) *protogen.GeneratedFile

NewFileWithBoilerplate creates a new file with the specified name and prints the starting lines for a generated go file. It starts with some comments containing information about what program was used to generate this file. It then prints the go package, and lastly adds a runtime compatibility check to make sure the runtime has the correct version.

func RunProtocPlugin

func RunProtocPlugin(generator FileGeneratorFunc)

Types

type FileGeneratorFunc

type FileGeneratorFunc func(plugin *protogen.Plugin, file *protogen.File) error

Directories

Path Synopsis
runnerdata command

Jump to

Keyboard shortcuts

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