generator

package
v0.0.0-...-5b3aae6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProtoPkg = "google.golang.org/protobuf/proto"

Variables

This section is empty.

Functions

func KeySize

func KeySize(fieldNumber protoreflect.FieldNumber, wireType protowire.Type) int

func ProtoWireType

func ProtoWireType(k protoreflect.Kind) protowire.Type

func RegisterFeature

func RegisterFeature(name string, feat Feature)

Types

type Extensions

type Extensions struct {
	Poolable map[protogen.GoIdent]bool
}

type Feature

type Feature func(gen *GeneratedFile) FeatureGenerator

type FeatureGenerator

type FeatureGenerator interface {
	GenerateFile(file *protogen.File) bool
	GenerateHelpers()
}

type GeneratedFile

type GeneratedFile struct {
	*protogen.GeneratedFile
	Ext           *Extensions
	LocalPackages map[string]bool
	// contains filtered or unexported fields
}

func (*GeneratedFile) Alloc

func (b *GeneratedFile) Alloc(vname string, message *protogen.Message)

func (*GeneratedFile) FieldGoType

func (p *GeneratedFile) FieldGoType(field *protogen.Field) (goType string, pointer bool)

func (*GeneratedFile) Helper

func (p *GeneratedFile) Helper(name string, generate func(p *GeneratedFile))

func (*GeneratedFile) Ident

func (p *GeneratedFile) Ident(path, ident string) string

func (*GeneratedFile) IsLocalMessage

func (p *GeneratedFile) IsLocalMessage(message *protogen.Message) bool

func (*GeneratedFile) ShouldPool

func (b *GeneratedFile) ShouldPool(message *protogen.Message) bool

type Generator

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

func NewGenerator

func NewGenerator(allFiles []*protogen.File, featureNames []string, ext *Extensions) (*Generator, error)

func (*Generator) GenerateFile

func (gen *Generator) GenerateFile(gf *protogen.GeneratedFile, file *protogen.File) bool

Jump to

Keyboard shortcuts

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