protocomment

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeMessage is the number of the message type index in the FileDescriptorProto.
	TypeMessage       = 4
	TypeNestedType    = 3
	TypeNestedEnum    = 4
	TypeEnum          = 5
	TypeEnumValue     = 2
	TypeMessageField  = 2
	TypeService       = 6
	TypeServiceMethod = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum

type Enum struct {
	*Location

	Values map[int32]*Location
}

type File

type File struct {
	Messages map[int32]*Message
	Enums    map[int32]*Enum
	Services map[int32]*Service
}

File is an indexed data structure for comments.

type Message

type Message struct {
	*Location

	NestedTypes map[int32]*Message
	NestedEnums map[int32]*Enum
	Fields      map[int32]*Location
}

type Registry

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

Registry holds indexed files that hold comments and locations for various proto types for quick lookups.

func NewRegistry

func NewRegistry(descriptorRegistry *descriptor.Registry) *Registry

func (*Registry) LookupEnum

func (r *Registry) LookupEnum(enum *descriptor.Enum) *Enum

func (*Registry) LookupField

func (r *Registry) LookupField(field *descriptor.Field) *Location

LookupField looks up comments for a field.

NOTE: Avoid using this method unless an arbitrary field access is needed. A more efficient way when iterating over fields of a message is to use the Message object directly.

func (*Registry) LookupMessage

func (r *Registry) LookupMessage(message *descriptor.Message) *Message

func (*Registry) LookupService

func (r *Registry) LookupService(service *descriptor.Service) *Service

type Service

type Service struct {
	*Location

	Methods map[int32]*Location
}

Jump to

Keyboard shortcuts

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