pkg

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateServer

func GenerateServer(
	plugin *protogen.Plugin,
	file *protogen.File,
	serverLanguage ServerLanguage,
	toolName,
	localPrefix string) error

func StringLblValue added in v0.9.0

func StringLblValue(method bool) func(string, *generator.Label) (string, error)

Types

type Label added in v0.9.0

type Label struct {
	Name          string
	Type          string
	DefaultValues map[string]string
}

func PbLabelToGoLabels added in v0.9.0

func PbLabelToGoLabels(labels map[string]*generator.Label) ([]Label, error)

type ServerLanguage

type ServerLanguage string
const (
	ServerLangaugeGo ServerLanguage = "go"
)

func (ServerLanguage) Validate

func (s ServerLanguage) Validate() error

type TemplateGenerator

type TemplateGenerator struct {
	Name               string
	Template           string
	FileNameTemplate   string
	Partials           map[string]string
	StringLblValue     func(name string, label *generator.Label) (string, error)
	PbLabelTLangLabels func(labels map[string]*generator.Label) ([]Label, error)
	ExtraFns           template.FuncMap
	// contains filtered or unexported fields
}

func (*TemplateGenerator) AddImport added in v0.9.5

func (t *TemplateGenerator) AddImport(name protogen.GoImportPath, importPath protogen.GoPackageName)

func (*TemplateGenerator) Generate

func (t *TemplateGenerator) Generate(
	baseFile,
	args any,
	importToPkg map[protogen.GoImportPath]protogen.GoPackageName,
	toolName,
	localPrefix string) (string, string, error)

func (*TemplateGenerator) GenerateFile

func (t *TemplateGenerator) GenerateFile(
	file *protogen.File,
	plugin *protogen.Plugin,
	args any,
	toolName,
	localPrefix string) error

func (*TemplateGenerator) TypeName added in v0.9.5

func (t *TemplateGenerator) TypeName(ident protogen.GoIdent, ignore string) string

Jump to

Keyboard shortcuts

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