scope

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package scope provides a set of code-generator-friendly types describing the heirarchy of definitions within a generation request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum added in v0.1.4

type Enum struct {
	File       *File
	Descriptor *descriptorpb.EnumDescriptorProto
	GoTypeName string
	// contains filtered or unexported fields
}

Enum encapsulates information about a single enum type.

func (*Enum) Members added in v0.1.4

func (e *Enum) Members() []*EnumMember

Members returns members of the enum.

type EnumMember added in v0.1.4

type EnumMember struct {
	Enum           *Enum
	AliasFor       *EnumMember
	Descriptor     *descriptorpb.EnumValueDescriptorProto
	GoConstantName string
}

EnumMember encapsulates information about a single member of an enum.

type Field

type Field struct {
	Message     *Message
	Descriptor  *descriptorpb.FieldDescriptorProto
	GoFieldName string
	OneOfOption *OneOfOption
}

Field encapsulates information about a single field within a message.

func (*Field) GoType

func (f *Field) GoType() jen.Code

GoType returns the code snippet that refers to the type of the field.

type File

type File struct {
	Request       *Request
	Descriptor    *descriptorpb.FileDescriptorProto
	GoPackagePath string
	GoPackageName string
	// contains filtered or unexported fields
}

File encapsulates information about a single .proto file.

func (*File) Enums added in v0.1.4

func (f *File) Enums() []*Enum

Enums returns the set of enum types defined in this file.

func (*File) Messages

func (f *File) Messages() []*Message

Messages returns the set of messages defined in this file.

type Message

type Message struct {
	File       *File
	Descriptor *descriptorpb.DescriptorProto
	GoTypeName string
	// contains filtered or unexported fields
}

Message encapsulates information about a single message type.

func (*Message) Fields

func (m *Message) Fields() []*Field

Fields returns the set of fields within the message.

func (*Message) OneOfGroups

func (m *Message) OneOfGroups() []*OneOfGroup

OneOfGroups returns the set of one-of groups within the message.

type OneOfGroup

type OneOfGroup struct {
	Message     *Message
	Descriptor  *descriptorpb.OneofDescriptorProto
	GoFieldName string
	Options     []*OneOfOption
}

OneOfGroup describes a one-of group.

type OneOfOption

type OneOfOption struct {
	Group                  *OneOfGroup
	Field                  *Field
	DiscriminatorTypeName  string
	DiscriminatorFieldName string
}

OneOfOption describes a field that is part of a one-of.

type Parameters

type Parameters struct {
	Module string
}

Parameters encapsulates the options passed to the generator via the --primo_opt flag.

The are referred to as "options" on the protoc command line, but "parameters" within the Protocol Buffers plugin system.

type Request

type Request struct {
	GeneratorVersion string
	PluginRequest    *pluginpb.CodeGeneratorRequest
	PluginParameters Parameters
	// contains filtered or unexported fields
}

Request describes a request to generate code from one or more .proto files.

Jump to

Keyboard shortcuts

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