generator

package
v0.0.0-...-c5bffc3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoFmt

func GoFmt(resp *pluginpb.CodeGeneratorResponse)

GoFmt formats all generated files

Types

type DefinedTypes

type DefinedTypes map[ProtoFullType]GoFullType

type FileGenerator

type FileGenerator struct {
	*Generator
	// contains filtered or unexported fields
}

FileGenerator of protobuf bindings for single file

func NewFileGenerator

func NewFileGenerator(g *Generator, protoFile *descriptorpb.FileDescriptorProto) *FileGenerator

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator of protobuf bindings

func NewGenerator

func NewGenerator(request *pluginpb.CodeGeneratorRequest) *Generator

NewGenerator creates new generator

func (*Generator) Generate

func (g *Generator) Generate() *pluginpb.CodeGeneratorResponse

Generate generates bindings

type GoEnumType

type GoEnumType struct {
	Name         string
	Comments     string
	ValuesPrefix string
	Values       []GoEnumTypeValue
}

type GoEnumTypeValue

type GoEnumTypeValue struct {
	Name     string
	Comments string
	Number   int32
}

type GoFile

type GoFile struct {
	Package   string
	Source    string
	Imports   []GoImport
	Types     []GoType
	EnumTypes []GoEnumType
}

type GoFullType

type GoFullType = string // Go package + type name

type GoImport

type GoImport struct {
	Path  string
	Alias string
}

type GoImportAlias

type GoImportAlias = string

type GoImportPath

type GoImportPath = string

type GoImportPathToAlias

type GoImportPathToAlias map[GoImportPath]GoImportAlias

type GoType

type GoType struct {
	Name     string
	Comments string
	Fields   []GoTypeField
}

type GoTypeField

type GoTypeField struct {
	Name      string
	Comments  string
	SnakeName string
	Type      string
	ZeroValue string
}

type ImportAliases

type ImportAliases map[GoImportPath]GoImportAlias

type KeyValueTypes

type KeyValueTypes = [2]string

type MapTypes

type MapTypes map[MessageName]KeyValueTypes

type MessageName

type MessageName = string

type ProtoFile

type ProtoFile = string

type ProtoFileToGoImport

type ProtoFileToGoImport map[ProtoFile]GoImport

type ProtoFullType

type ProtoFullType = string // Proto package + type name

Jump to

Keyboard shortcuts

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