gen

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: Apache-2.0 Imports: 15 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 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

	Values []*EnumValue

	Location Location
	Comments CommentSet
}

type EnumValue

type EnumValue struct {
	Desc string

	GoIdent GoIdent

	Parent *Enum

	Location Location
	Comments CommentSet
}

type Extension

type Extension = Field

type ExtensionType

type ExtensionType struct{}

type Field

type Field struct {
	Desc     string
	GoName   string
	GoIdent  GoIdent
	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
	GoPackageName     GoPackageName
	GoImportPath      GoImportPath

	Enums      []*Enum
	Messages   []*Message
	Extensions []*Extension
	Services   []*Service

	Generate bool

	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

	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
	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       []*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