package generator
import "github.com/planetscale/vtprotobuf/generator"
Index ¶
- Constants
- func KeySize(fieldNumber protoreflect.FieldNumber, wireType protowire.Type) int
- func ProtoWireType(k protoreflect.Kind) protowire.Type
- func RegisterFeature(name string, feat Feature)
- type Config
- type Feature
- type FeatureGenerator
- type GeneratedFile
- func (b *GeneratedFile) Alloc(vname string, message *protogen.Message, isQualifiedIdent bool)
- func (p *GeneratedFile) FieldGoType(field *protogen.Field) (goType string, pointer bool)
- func (p *GeneratedFile) Helper(name string) protogen.GoIdent
- func (p *GeneratedFile) Ident(path, ident string) string
- func (p *GeneratedFile) IsLocalField(field *protogen.Field) bool
- func (p *GeneratedFile) IsLocalMessage(message *protogen.Message) bool
- func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool
- func (b *GeneratedFile) ShouldPool(message *protogen.Message) bool
- func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIdent
- func (p *GeneratedFile) WellKnownTypeMap(message *protogen.Message) protogen.GoIdent
- func (p *GeneratedFile) Wrapper() bool
- type Generator
- func NewGenerator(plugin *protogen.Plugin, featureNames []string, cfg *Config) (*Generator, error)
- func (gen *Generator) Generate()
- type ObjectSet
Constants ¶
const ProtoPkg = "google.golang.org/protobuf/proto"
const SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
Functions ¶
func KeySize ¶
func KeySize(fieldNumber protoreflect.FieldNumber, wireType protowire.Type) int
func ProtoWireType ¶
func ProtoWireType(k protoreflect.Kind) protowire.Type
func RegisterFeature ¶
Types ¶
type Config ¶
type Config struct { // Poolable rules determines if pool feature generate for particular message Poolable ObjectSet // PoolableExclude rules determines if pool feature disabled for particular message PoolableExclude ObjectSet Wrap bool WellKnownTypes bool AllowEmpty bool BuildTag string }
type Feature ¶
type Feature func(gen *GeneratedFile) FeatureGenerator
type FeatureGenerator ¶
type GeneratedFile ¶
type GeneratedFile struct { *protogen.GeneratedFile Config *Config LocalPackages map[protoreflect.FullName]bool }
func (*GeneratedFile) Alloc ¶
func (b *GeneratedFile) Alloc(vname string, message *protogen.Message, isQualifiedIdent bool)
func (*GeneratedFile) FieldGoType ¶
func (p *GeneratedFile) FieldGoType(field *protogen.Field) (goType string, pointer bool)
func (*GeneratedFile) Helper ¶
func (p *GeneratedFile) Helper(name string) protogen.GoIdent
func (*GeneratedFile) Ident ¶
func (p *GeneratedFile) Ident(path, ident string) string
func (*GeneratedFile) IsLocalField ¶
func (p *GeneratedFile) IsLocalField(field *protogen.Field) bool
func (*GeneratedFile) IsLocalMessage ¶
func (p *GeneratedFile) IsLocalMessage(message *protogen.Message) bool
func (*GeneratedFile) IsWellKnownType ¶
func (p *GeneratedFile) IsWellKnownType(message *protogen.Message) bool
func (*GeneratedFile) ShouldPool ¶
func (b *GeneratedFile) ShouldPool(message *protogen.Message) bool
func (*GeneratedFile) WellKnownFieldMap ¶
func (p *GeneratedFile) WellKnownFieldMap(field *protogen.Field) protogen.GoIdent
func (*GeneratedFile) WellKnownTypeMap ¶
func (p *GeneratedFile) WellKnownTypeMap(message *protogen.Message) protogen.GoIdent
func (*GeneratedFile) Wrapper ¶
func (p *GeneratedFile) Wrapper() bool
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func (*Generator) Generate ¶
func (gen *Generator) Generate()
type ObjectSet ¶
type ObjectSet struct {
// contains filtered or unexported fields
}
func NewObjectSet ¶
func NewObjectSet() ObjectSet
func (ObjectSet) Contains ¶
func (ObjectSet) Set ¶
func (ObjectSet) String ¶
Source Files ¶
features.go generatedfile.go generator.go helpers.go
Directories ¶
Path | Synopsis |
---|---|
generator/pattern |
- Version
- v0.6.0 (latest)
- Published
- Jan 29, 2024
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 1 week ago –
Tools for package owners.