protomodel

package
v1.11.4-bzc.6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DottedName

func DottedName(o CoreDesc) string

DottedName returns a dotted representation of the coreDesc's name

Types

type CoreDesc

type CoreDesc interface {
	PackageDesc() *PackageDescriptor
	FileDesc() *FileDescriptor
	QualifiedName() []string
	IsHidden() bool
	Class() string
	Location() LocationDescriptor
}

CoreDesc is an interface abstracting the abilities shared by all descriptors

type EnumDescriptor

type EnumDescriptor struct {
	*descriptor.EnumDescriptorProto
	Values []*EnumValueDescriptor // The values of this enum
	// contains filtered or unexported fields
}

func (EnumDescriptor) Class

func (bd EnumDescriptor) Class() string

func (EnumDescriptor) FileDesc

func (bd EnumDescriptor) FileDesc() *FileDescriptor

func (EnumDescriptor) IsHidden

func (bd EnumDescriptor) IsHidden() bool

func (EnumDescriptor) Location

func (bd EnumDescriptor) Location() LocationDescriptor

func (EnumDescriptor) PackageDesc

func (bd EnumDescriptor) PackageDesc() *PackageDescriptor

func (EnumDescriptor) QualifiedName

func (bd EnumDescriptor) QualifiedName() []string

type EnumValueDescriptor

type EnumValueDescriptor struct {
	*descriptor.EnumValueDescriptorProto
	// contains filtered or unexported fields
}

func (EnumValueDescriptor) Class

func (bd EnumValueDescriptor) Class() string

func (EnumValueDescriptor) FileDesc

func (bd EnumValueDescriptor) FileDesc() *FileDescriptor

func (EnumValueDescriptor) IsHidden

func (bd EnumValueDescriptor) IsHidden() bool

func (EnumValueDescriptor) Location

func (bd EnumValueDescriptor) Location() LocationDescriptor

func (EnumValueDescriptor) PackageDesc

func (bd EnumValueDescriptor) PackageDesc() *PackageDescriptor

func (EnumValueDescriptor) QualifiedName

func (bd EnumValueDescriptor) QualifiedName() []string

type FieldDescriptor

type FieldDescriptor struct {
	*descriptor.FieldDescriptorProto
	FieldType CoreDesc // Type of data held by this field
	// contains filtered or unexported fields
}

func (FieldDescriptor) Class

func (bd FieldDescriptor) Class() string

func (FieldDescriptor) FileDesc

func (bd FieldDescriptor) FileDesc() *FileDescriptor

func (FieldDescriptor) IsHidden

func (bd FieldDescriptor) IsHidden() bool

func (*FieldDescriptor) IsRepeated

func (f *FieldDescriptor) IsRepeated() bool

func (FieldDescriptor) Location

func (bd FieldDescriptor) Location() LocationDescriptor

func (FieldDescriptor) PackageDesc

func (bd FieldDescriptor) PackageDesc() *PackageDescriptor

func (FieldDescriptor) QualifiedName

func (bd FieldDescriptor) QualifiedName() []string

type FileDescriptor

type FileDescriptor struct {
	*descriptor.FileDescriptorProto
	Parent       *PackageDescriptor
	AllMessages  []*MessageDescriptor // All the messages defined in this file
	AllEnums     []*EnumDescriptor    // All the enums defined in this file
	Messages     []*MessageDescriptor // Top-level messages defined in this file
	Enums        []*EnumDescriptor    // Top-level enums defined in this file
	Services     []*ServiceDescriptor // All services defined in this file
	Dependencies []*FileDescriptor    // Files imported by this file

	Matter FrontMatter // Title, overview, homeLocation, front_matter
	// contains filtered or unexported fields
}

type FrontMatter

type FrontMatter struct {
	Title        string
	Overview     string
	Description  string
	HomeLocation string
	Extra        []string
	Location     LocationDescriptor
	Mode         Mode
}

type LocationDescriptor

type LocationDescriptor struct {
	*descriptor.SourceCodeInfo_Location
	File *FileDescriptor
}

type MessageDescriptor

type MessageDescriptor struct {
	*descriptor.DescriptorProto
	Parent   *MessageDescriptor   // The containing message, if any
	Messages []*MessageDescriptor // Inner messages, if any
	Enums    []*EnumDescriptor    // Inner enums, if any
	Fields   []*FieldDescriptor   // Fields, if any
	// contains filtered or unexported fields
}

func (MessageDescriptor) Class

func (bd MessageDescriptor) Class() string

func (MessageDescriptor) FileDesc

func (bd MessageDescriptor) FileDesc() *FileDescriptor

func (MessageDescriptor) IsHidden

func (bd MessageDescriptor) IsHidden() bool

func (MessageDescriptor) Location

func (bd MessageDescriptor) Location() LocationDescriptor

func (MessageDescriptor) PackageDesc

func (bd MessageDescriptor) PackageDesc() *PackageDescriptor

func (MessageDescriptor) QualifiedName

func (bd MessageDescriptor) QualifiedName() []string

type MethodDescriptor

type MethodDescriptor struct {
	*descriptor.MethodDescriptorProto
	Input  *MessageDescriptor
	Output *MessageDescriptor
	// contains filtered or unexported fields
}

func (MethodDescriptor) Class

func (bd MethodDescriptor) Class() string

func (MethodDescriptor) FileDesc

func (bd MethodDescriptor) FileDesc() *FileDescriptor

func (MethodDescriptor) IsHidden

func (bd MethodDescriptor) IsHidden() bool

func (MethodDescriptor) Location

func (bd MethodDescriptor) Location() LocationDescriptor

func (MethodDescriptor) PackageDesc

func (bd MethodDescriptor) PackageDesc() *PackageDescriptor

func (MethodDescriptor) QualifiedName

func (bd MethodDescriptor) QualifiedName() []string

type Mode

type Mode string
var (
	ModeUnset   Mode = ""
	ModeFile    Mode = "file"
	ModePackage Mode = "package"
	ModeNone    Mode = "none"
)

type Model

type Model struct {
	AllFilesByName map[string]*FileDescriptor
	AllDescByName  map[string]CoreDesc
	Packages       []*PackageDescriptor
}

model represents a resolved in-memory version of all the input protos

func NewModel

func NewModel(request *plugin.CodeGeneratorRequest, perFile bool) *Model

type PackageDescriptor

type PackageDescriptor struct {
	Files []*FileDescriptor
	Name  string
	// contains filtered or unexported fields
}

PackageDescriptor describes a package, which is a composition of proto files.

func (PackageDescriptor) Class

func (bd PackageDescriptor) Class() string

func (PackageDescriptor) FileDesc

func (bd PackageDescriptor) FileDesc() *FileDescriptor

func (PackageDescriptor) IsHidden

func (bd PackageDescriptor) IsHidden() bool

func (PackageDescriptor) Location

func (bd PackageDescriptor) Location() LocationDescriptor

func (PackageDescriptor) PackageDesc

func (bd PackageDescriptor) PackageDesc() *PackageDescriptor

func (PackageDescriptor) QualifiedName

func (bd PackageDescriptor) QualifiedName() []string

type ServiceDescriptor

type ServiceDescriptor struct {
	*descriptor.ServiceDescriptorProto
	Methods []*MethodDescriptor // Methods, if any
	// contains filtered or unexported fields
}

func (ServiceDescriptor) Class

func (bd ServiceDescriptor) Class() string

func (ServiceDescriptor) FileDesc

func (bd ServiceDescriptor) FileDesc() *FileDescriptor

func (ServiceDescriptor) IsHidden

func (bd ServiceDescriptor) IsHidden() bool

func (ServiceDescriptor) Location

func (bd ServiceDescriptor) Location() LocationDescriptor

func (ServiceDescriptor) PackageDesc

func (bd ServiceDescriptor) PackageDesc() *PackageDescriptor

func (ServiceDescriptor) QualifiedName

func (bd ServiceDescriptor) QualifiedName() []string

Jump to

Keyboard shortcuts

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