Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTagOption(args *config.Argument) (ret []generator.Option)
- func IsMapEntry(nt *descriptorpb.DescriptorProto) bool
- func LoadBaseIdentifier(ast *descriptorpb.FileDescriptorProto) map[string]*Symbol
- type FileInfos
- type NameSpace
- type PackageReference
- type Plugin
- type Resolver
- func (resolver *Resolver) ExportReferred(all, needMain bool) (ret []*PackageReference)
- func (resolver *Resolver) Get(name string) *Symbol
- func (resolver *Resolver) GetFiles() FileInfos
- func (resolver *Resolver) GetRefModel(includeBase string) (*model.Model, error)
- func (resolver *Resolver) LoadAll(ast *descriptorpb.FileDescriptorProto) error
- func (resolver *Resolver) LoadOne(ast *descriptorpb.FileDescriptorProto) (NameSpace, error)
- func (resolver *Resolver) ResolveIdentifier(id string) (ret *Symbol, err error)
- func (resolver *Resolver) ResolveType(f *descriptorpb.FieldDescriptorProto, nested []*descriptorpb.DescriptorProto) (*model.Type, error)
- type Symbol
Constants ¶
View Source
const ( FileDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 FileDescriptorProto_Package_field_number protoreflect.FieldNumber = 2 FileDescriptorProto_Dependency_field_number protoreflect.FieldNumber = 3 FileDescriptorProto_PublicDependency_field_number protoreflect.FieldNumber = 10 FileDescriptorProto_WeakDependency_field_number protoreflect.FieldNumber = 11 FileDescriptorProto_MessageType_field_number protoreflect.FieldNumber = 4 FileDescriptorProto_EnumType_field_number protoreflect.FieldNumber = 5 FileDescriptorProto_Service_field_number protoreflect.FieldNumber = 6 FileDescriptorProto_Extension_field_number protoreflect.FieldNumber = 7 FileDescriptorProto_Options_field_number protoreflect.FieldNumber = 8 FileDescriptorProto_SourceCodeInfo_field_number protoreflect.FieldNumber = 9 FileDescriptorProto_Syntax_field_number protoreflect.FieldNumber = 12 )
Field numbers for google.protobuf.FileDescriptorProto.
View Source
const WeakFieldPrefix_goname = "XXX_weak_"
Variables ¶
View Source
var ( ConstTrue = Symbol{ IsValue: true, Type: model.TypeBool, Value: true, Scope: &BaseProto, } ConstFalse = Symbol{ IsValue: true, Type: model.TypeBool, Value: false, Scope: &BaseProto, } ConstEmptyString = Symbol{ IsValue: true, Type: model.TypeString, Value: "", Scope: &BaseProto, } )
View Source
var ( HttpMethodOptions = map[*protoimpl.ExtensionInfo]string{ api.E_Get: "GET", api.E_Post: "POST", api.E_Put: "PUT", api.E_Patch: "PATCH", api.E_Delete: "DELETE", api.E_Options: "OPTIONS", api.E_Head: "HEAD", api.E_Any: "Any", } BindingTags = map[*protoimpl.ExtensionInfo]string{ api.E_Path: "path", api.E_Query: "query", api.E_Form: "form", api.E_Header: "header", api.E_Cookie: "cookie", api.E_Body: "json", api.E_RawBody: "raw_body", } ValidatorTags = map[*protoimpl.ExtensionInfo]string{api.E_Vd: "vd"} SerializerOptions = map[*protoimpl.ExtensionInfo]string{api.E_Serializer: "serializer"} )
View Source
var BaseProto = descriptorpb.FileDescriptorProto{}
Functions ¶
func IsMapEntry ¶
func IsMapEntry(nt *descriptorpb.DescriptorProto) bool
func LoadBaseIdentifier ¶
func LoadBaseIdentifier(ast *descriptorpb.FileDescriptorProto) map[string]*Symbol
Types ¶
type FileInfos ¶
type FileInfos struct { Official map[string]*descriptorpb.FileDescriptorProto PbReflect map[string]*desc.FileDescriptor }
type PackageReference ¶
type PackageReference struct { IncludeBase string IncludePath string Model *model.Model Ast *descriptorpb.FileDescriptorProto Referred bool }
type Plugin ¶
type Plugin struct { Package string Recursive bool OutDir string ModelDir string PkgMap map[string]string // contains filtered or unexported fields }
func (*Plugin) GenerateFile ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(ast *descriptorpb.FileDescriptorProto, files FileInfos, model *model.Model, pkgMap map[string]string) (*Resolver, error)
func (*Resolver) ExportReferred ¶
func (resolver *Resolver) ExportReferred(all, needMain bool) (ret []*PackageReference)
func (*Resolver) GetRefModel ¶
func (*Resolver) LoadAll ¶
func (resolver *Resolver) LoadAll(ast *descriptorpb.FileDescriptorProto) error
func (*Resolver) LoadOne ¶
func (resolver *Resolver) LoadOne(ast *descriptorpb.FileDescriptorProto) (NameSpace, error)
func (*Resolver) ResolveIdentifier ¶
func (*Resolver) ResolveType ¶
func (resolver *Resolver) ResolveType(f *descriptorpb.FieldDescriptorProto, nested []*descriptorpb.DescriptorProto) (*model.Type, error)
type Symbol ¶
type Symbol struct { Space string Name string IsValue bool Type *model.Type Value interface{} Scope *descriptorpb.FileDescriptorProto }
Click to show internal directories.
Click to hide internal directories.