Documentation ¶
Index ¶
- type Annotation
- type File
- type GeneratedFile
- func (g *GeneratedFile) P(v ...interface{})
- func (g *GeneratedFile) QualifiedGoIdent(ident GoIdent) string
- func (g *GeneratedFile) Replace(src, des string) error
- func (g *GeneratedFile) SetUrl(url string) error
- func (g *GeneratedFile) Timestamp()
- func (g *GeneratedFile) WriteFile(filepath string) error
- type GeneratedIndex
- type GoIdent
- type GoImportPath
- type GoPackageName
- type Location
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { // Location is the source .proto file for the element. Location Location // Semantic is the symbol's effect on the element in the original .proto file. Semantic *descriptorpb.GeneratedCodeInfo_Annotation_Semantic }
An Annotation provides semantic detail for a generated proto element.
See the google.protobuf.GeneratedCodeInfo.Annotation documentation in descriptor.proto for details.
type File ¶
type File struct { Desc protoreflect.FileDescriptor Proto *descriptorpb.FileDescriptorProto GoDescriptorIdent GoIdent // name of Go variable for the file descriptor GoPackageName GoPackageName // name of this file's Go package GoImportPath GoImportPath // import path of this file's Go package }
A File describes a .proto source file.
type GeneratedFile ¶
type GeneratedFile struct { ApiModel []string ServiceName string TableName string StructName string Url string Urls []string Index []GeneratedIndex // contains filtered or unexported fields }
func NewGeneratedFile ¶
func NewGeneratedFile() *GeneratedFile
func (*GeneratedFile) P ¶
func (g *GeneratedFile) P(v ...interface{})
P prints a line to the generated output. It converts each parameter to a string following the same rules as fmt.Print. It never inserts spaces between parameters.
func (*GeneratedFile) QualifiedGoIdent ¶
func (g *GeneratedFile) QualifiedGoIdent(ident GoIdent) string
QualifiedGoIdent returns the string to use for a Go identifier.
If the identifier is from a different Go package than the generated file, the returned name will be qualified (package.name) and an import statement for the identifier's package will be included in the file.
func (*GeneratedFile) Replace ¶
func (g *GeneratedFile) Replace(src, des string) error
func (*GeneratedFile) SetUrl ¶
func (g *GeneratedFile) SetUrl(url string) error
func (*GeneratedFile) Timestamp ¶
func (g *GeneratedFile) Timestamp()
func (*GeneratedFile) WriteFile ¶
func (g *GeneratedFile) WriteFile(filepath string) error
type GeneratedIndex ¶
type GoIdent ¶
type GoIdent struct { GoName string GoImportPath GoImportPath }
A GoIdent is a Go identifier, consisting of a name and import path. The name is a single identifier and may not be a dot-qualified selector.
type GoImportPath ¶
type GoImportPath string
A GoImportPath is the import path of a Go package. For example: "google.golang.org/protobuf/compiler/protogen"
func (GoImportPath) Ident ¶
func (p GoImportPath) Ident(s string) GoIdent
Ident returns a GoIdent with s as the GoName and p as the GoImportPath.
func (GoImportPath) String ¶
func (p GoImportPath) String() string
type GoPackageName ¶
type GoPackageName string
A GoPackageName is the name of a Go package. e.g., "protobuf".
type Location ¶
type Location struct { SourceFile string Path protoreflect.SourcePath }
A Location is a location in a .proto source file.
See the google.protobuf.SourceCodeInfo documentation in descriptor.proto for details.