gen

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

About

The plugin's implementation.

Having internal in its path prevents imports from outside the project.

Code may move into a public package at the root of the repository if there is a use case.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comment

func Comment(format string, args ...interface{}) protogen.Comments

func GenerateFile

func GenerateFile(
	fs flag.FlagSet,
	plugin *protogen.Plugin,
	proto *protogen.File,
	packages *Packages,
) error

Types

type Field

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

func NewField

func NewField(msg *Message, proto *protogen.Field) (*Field, error)

func (*Field) Annotate

func (f *Field) Annotate(symbol string, loc protogen.Location)

func (*Field) Name

func (f *Field) Name() string

func (*Field) P

func (f *Field) P(v ...interface{})

type FieldType

type FieldType struct {
	Go        protogen.GoIdent
	Firestore protogen.GoIdent

	IsPointer  bool // TODO: unused?
	IsEnum     bool
	IsCustom   bool
	IsExternal bool
	IsList     bool
	// contains filtered or unexported fields
}

func NewFieldType

func NewFieldType(field *Field) (*FieldType, error)

func (*FieldType) String

func (t *FieldType) String() string

type File

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

File wraps the input .proto file and keeps information to generate code.

func NewFile

func NewFile(plugin *protogen.Plugin, proto *protogen.File) (*File, error)

func (*File) Annotate

func (f *File) Annotate(symbol string, loc protogen.Location)

func (*File) Enabled

func (f *File) Enabled() bool

func (*File) Gen

func (f *File) Gen()

func (*File) P

func (f *File) P(v ...interface{})

type Message

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

func NewMessage

func NewMessage(file *File, proto *protogen.Message) (*Message, error)

func (*Message) Annotate

func (m *Message) Annotate(symbol string, loc protogen.Location)

func (*Message) CollectionConstantName

func (m *Message) CollectionConstantName() string

func (*Message) CollectionName

func (m *Message) CollectionName() string

func (*Message) CollectionNameTitle

func (m *Message) CollectionNameTitle() string

func (*Message) Gen

func (m *Message) Gen()

func (*Message) P

func (m *Message) P(v ...interface{})

func (*Message) ProtoName

func (m *Message) ProtoName() string

type Package

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

func (*Package) Gen

func (p *Package) Gen()

func (*Package) P

func (p *Package) P(v ...interface{})

type Packages

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

func NewPackages

func NewPackages(plugin *protogen.Plugin) *Packages

func (*Packages) Collect

func (p *Packages) Collect(file *File)

func (*Packages) Gen

func (p *Packages) Gen() error

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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