tree

package
v0.0.0-...-8cb7ee9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

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

Field is wrapper for descriptor.FieldDescriptorProto.

func (Field) CastType

func (field Field) CastType() string

func (Field) CustomType

func (field Field) CustomType() string

func (Field) File

func (field Field) File() *File

func (Field) Forest

func (field Field) Forest() *Forest

func (Field) IsBool

func (field Field) IsBool() bool

func (Field) IsBytes

func (field Field) IsBytes() bool

func (Field) IsDuration

func (field Field) IsDuration() bool

IsDuration returns true if field stores a duration value (protobuf or cast to a standard library type)

func (Field) IsEnum

func (field Field) IsEnum() bool

func (Field) IsInt32

func (field Field) IsInt32() bool

func (Field) IsInt64

func (field Field) IsInt64() bool

func (Field) IsMap

func (field Field) IsMap() bool

IsMap returns true if field stores a map.

func (Field) IsMessage

func (field Field) IsMessage() bool

IsMessage returns true if field is a message.

func (Field) IsNullable

func (field Field) IsNullable() bool

func (Field) IsOptional

func (field Field) IsOptional() bool

func (Field) IsRepeated

func (field Field) IsRepeated() bool

func (Field) IsRequired

func (field Field) IsRequired() bool

func (Field) IsString

func (field Field) IsString() bool

func (Field) IsTime

func (field Field) IsTime() bool

func (Field) IsUint32

func (field Field) IsUint32() bool

func (Field) IsUint64

func (field Field) IsUint64() bool

func (Field) JSONName

func (field Field) JSONName() string

func (Field) LeadingComments

func (field Field) LeadingComments() string

func (Field) Message

func (field Field) Message() *Message

func (Field) Name

func (field Field) Name() string

func (Field) Path

func (field Field) Path() string

func (Field) TypeMessage

func (field Field) TypeMessage() *Message

func (Field) TypeName

func (field Field) TypeName() string

type File

type File struct {
	Messages []*Message
	// contains filtered or unexported fields
}

File is a wrapper for generator.FileDescriptor which is used to keep track of all seen messages.

func (File) Forest

func (file File) Forest() *Forest

func (File) GetMessageByName

func (file File) GetMessageByName(name string) (*Message, bool)

func (File) Name

func (file File) Name() string

func (File) Package

func (file File) Package() string

type Forest

type Forest struct {
	*gogogen.Generator
	// contains filtered or unexported fields
}

Forest is a forest of file trees. It's a wrapper for generator.Generator.

func NewForest

func NewForest(gen *gogogen.Generator) *Forest

NewForest creates a Forest of file trees wrapping the given Generator. The Forest is used to keep track of trees built when processing proto messages.

func (*Forest) AddFile

func (forest *Forest) AddFile(fileDesc *gogodesc.FileDescriptorProto) *File

AddFile adds a proto file to the Forest. The function returns a *File containing the location map (where each message is located in the source), the list of Messages from the file, and Message indices by Descriptor and name for easier lookups.

type Location

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

Location is a wrapper for descriptor.SourceCodeInfo_Location.

func (Location) LeadingComments

func (location Location) LeadingComments() string

type Message

type Message struct {
	Fields []*Field
	// contains filtered or unexported fields
}

Message is a wrapper for generator.Descriptor.

func (Message) File

func (message Message) File() *File

func (Message) Forest

func (message Message) Forest() *Forest

func (Message) GetField

func (message Message) GetField(name string) (*Field, bool)

func (Message) LeadingComments

func (message Message) LeadingComments() string

func (Message) Name

func (message Message) Name() string

func (Message) Path

func (message Message) Path() string

Jump to

Keyboard shortcuts

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