generator

package
v0.0.0-...-2c76a10 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(

	protoImportPath []string,

	inputProtoFiles []string,

	outputDir string,

	options Options,
) error

Types

type Enum

type Enum struct {
	desc.EnumDescriptor
	FullName string
}

Enum is the representation of a source proto enum.

func NewEnum

func NewEnum(parent *Message, descr *desc.EnumDescriptor) *Enum

func (*Enum) GetName

func (e *Enum) GetName() string

type Field

type Field struct {
	desc.FieldDescriptor
	// contains filtered or unexported fields
}

Field is the representation of a source proto field.

func (*Field) GetCapitalName

func (f *Field) GetCapitalName() string

func (*Field) GetName

func (f *Field) GetName() string

type File

type File struct {
	Messages map[string]*Message
}

File that is parsed from a source proto.

type Message

type Message struct {
	desc.MessageDescriptor

	// FullName is the full unique name of this message (includes parent names).
	FullName string

	// Fields of this message.
	Fields []*Field

	// FieldsMap maps the name of the field to its representation.
	FieldsMap map[string]*Field

	// FlagsTypeAlias is the name of the type alias for the _flags field.
	FlagsTypeAlias string

	// FlagsTypeAlias is the underlying unsigned integer type of the _flags field.
	FlagsUnderlyingType string

	// FlagsBitCount is the number of the bits that the _flags field contains.
	FlagsBitCount int

	// DecodedFlags are definitions for "decoded" flags. Each such flag indicates
	// that a particular field of the message is already decoded.
	DecodedFlags []flagBitDef
	// DecodedFlagName maps the field to its "decoded" const name.
	DecodedFlagName map[*Field]string

	// DecodedFlags are definitions for "present" flags. Each such flag indicates
	// that a particular field of the message is present. Used for "Has" methods.
	PresenceFlags []flagBitDef
	// PresenceFlagName maps the field to its "present" const name.
	PresenceFlagName map[*Field]string
}

Message is the representation of a source proto "message".

func NewMessage

func NewMessage(parent *Message, descr *desc.MessageDescriptor) *Message

func (*Message) GetName

func (f *Message) GetName() string

type Options

type Options struct {
	WithPresence bool
}

Jump to

Keyboard shortcuts

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