gen

package
v0.0.0-...-14c54dd Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 GeneratedIndex struct {
	StorageKey string
	Fields     []string
	UNIQUE     bool
}

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.

func (GoIdent) String

func (id GoIdent) String() string

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.

Jump to

Keyboard shortcuts

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