internal

package
v0.0.0-...-c1575fe Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 14 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 {
	// 位置是元素的来源. proto 文件。
	Location Location
}

type CommentSet

type CommentSet struct {
	LeadingDetached []Comments
	Leading         Comments
	Trailing        Comments
}

type Comments

type Comments string

func (Comments) String

func (c Comments) String() string

type Descriptor

type Descriptor string

type Enum

type Enum struct {
	Desc string

	GoIdent GoIdent // Go 类型

	Values []*EnumValue // 价值申报

	Location Location   // 此enum 的位置
	Comments CommentSet // 与本集相关的评论
}

type EnumValue

type EnumValue struct {
	Desc string

	GoIdent GoIdent // 生成的 Go 声明名称

	Parent *Enum // 声明此值的千兆

	Location Location   // 此enum 值的位置
	Comments CommentSet // 与此宏值相关的注释
}

type Extension

type Extension = Field

type ExtensionType

type ExtensionType struct{}

type Field

type Field struct {
	Desc     string
	GoName   string     // 例如, “ 字段Name”
	GoIdent  GoIdent    // 例如, “ 邮件Name_ fieldName”
	Parent   *Message   // 声明此字段的信息; 如果最高扩展
	Oneof    *Oneof     // 含有; 如果不是其中之一的一部分,则无
	Extendee *Message   // 扩展字段的扩展消息;其他无
	Enum     *Enum      // 输入字段的类型类型; 无效
	Message  *Message   // 用于信件或组字段或组字段的类型;否则为零
	Location Location   // 此字段位置
	Comments CommentSet // 与此字段相关的评论意见
}

type FieldNumber

type FieldNumber string

type File

type File struct {
	GoDescriptorIdent GoIdent       // 文件描述符的 Go 名称变量
	GoPackageName     GoPackageName // 此文件的 Go 软件包的名称
	GoImportPath      GoImportPath  // 此文件的 Go 软件包导入路径

	Enums      []*Enum      // 高层全体全体宣言
	Messages   []*Message   // 最高一级信息公告
	Extensions []*Extension // 最高一级延期声明
	Services   []*Service   // 最高一级服务

	Generate bool // 如果我们为此文件生成代码, 是否真实

	// 生成的FilenamePrefix 用于构建与此源文件相关的生成文件的文件名。 例如, 源文件“ dir/ foo. proto” 可能有“ dir/ foo” 的文件名前缀。 附加的“. pb.go” 产生一个“ dir/ foo. pb.go. ” 输出文件 。
	// files associated with this source file.
	//
	// For example, the source file "dir/foo.proto" might have a filename prefix
	// of "dir/foo". Appending ".pb.go" produces an output file of "dir/foo.pb.go".
	GeneratedFilenamePrefix string
	// contains filtered or unexported fields
}

type FileInfo

type FileInfo struct {
	*File
	// contains filtered or unexported fields
}

type FullName

type FullName string

type GeneratedCodeInfo

type GeneratedCodeInfo struct{}

type GeneratedFile

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

func (*GeneratedFile) Annotate

func (g *GeneratedFile) Annotate(symbol string, loc Location)

func (*GeneratedFile) AnnotateSymbol

func (g *GeneratedFile) AnnotateSymbol(symbol string, info Annotation)

func (*GeneratedFile) Content

func (g *GeneratedFile) Content() ([]byte, error)

func (*GeneratedFile) Import

func (g *GeneratedFile) Import(importPath GoImportPath)

func (*GeneratedFile) P

func (g *GeneratedFile) P(v ...interface{})

func (*GeneratedFile) QualifiedGoIdent

func (g *GeneratedFile) QualifiedGoIdent(ident GoIdent) string

func (*GeneratedFile) Skip

func (g *GeneratedFile) Skip()

func (*GeneratedFile) Unskip

func (g *GeneratedFile) Unskip()

func (*GeneratedFile) Write

func (g *GeneratedFile) Write(p []byte) (n int, err error)

type GoIdent

type GoIdent struct {
	GoName       string
	GoImportPath GoImportPath
}

func (GoIdent) String

func (id GoIdent) String() string

type GoImportPath

type GoImportPath string

func (GoImportPath) Ident

func (p GoImportPath) Ident(s string) GoIdent

func (GoImportPath) String

func (p GoImportPath) String() string

type GoPackageName

type GoPackageName string

type Location

type Location struct {
	SourceFile string
	Path       string
}

type Message

type Message struct {
	Desc string

	GoIdent GoIdent // Go 类型

	Fields []*Field // 消息字段声明
	Oneofs []*Oneof // 声明信息之一

	Enums      []*Enum      // 嵌套的昆虫声明
	Messages   []*Message   // 嵌套信件声明
	Extensions []*Extension // 嵌套扩展声明

	Location Location   // 此信件地址
	Comments CommentSet // 与此信件相关的注释
}

type Method

type Method struct {
	Desc string

	GoName string

	Parent *Service // 声明使用此方法的服务

	Input  *Message
	Output *Message

	Location Location   // 此方法的位置
	Comments CommentSet // 与此方法相关的注释
}

type Oneof

type Oneof struct {
	GoName   string     // 例如,“其中之一”
	GoIdent  GoIdent    // 例如, “ 信件Name_ one ofName”
	Parent   *Message   // 此一电文中声明该电文
	Fields   []*Field   // 字段的一部分
	Location Location   // 此位置
	Comments CommentSet // 与本
}

type Options

type Options struct {
	ParamFunc func(name, value string) error

	ImportRewriteFunc func(GoImportPath) GoImportPath
}

func (Options) New

func (opts Options) New(req string) (*Plugin, error)

func (Options) Run

func (opts Options) Run(f func(*Plugin) error)

type Plugin

type Plugin struct {
	// 请求是原程序提供的代码操作请求 。
	Request string

	// 文件是要生成的文件集及其导入的所有文件集。 文件以表层顺序显示, 所以每个文件都出现在任何导入文件之前 。
	// Files appear in topological order, so each file appears before any
	// file that imports it.
	Files       []*File
	FilesByPath map[string]*File

	SupportedFeatures uint64
	// contains filtered or unexported fields
}

func (*Plugin) Error

func (gen *Plugin) Error(err error)

func (*Plugin) NewGeneratedFile

func (gen *Plugin) NewGeneratedFile(filename string, goImportPath GoImportPath) *GeneratedFile

type Service

type Service struct {
	GoName string

	Methods []*Method // 工具方法声明

	Location Location   // 本服务所在地
	Comments CommentSet // 与此服务相关的注释
}

type Types

type Types struct{}

Jump to

Keyboard shortcuts

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