protodesc

package
v0.0.0-...-d4cb099 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Leading  string
	Trailing string
	Detached []string
}

Comment describes the leading, trailing, and detached comments for a proto object.

func (*Comment) GetDetached

func (c *Comment) GetDetached() []string

GetDetached returns the detached leading comments.

func (*Comment) GetLeading

func (c *Comment) GetLeading() string

GetLeading returns the leading comments.

func (*Comment) GetTrailing

func (c *Comment) GetTrailing() string

GetTrailing returns the leading comments.

func (*Comment) String

func (c *Comment) String() string

String returns the leading and trailing comments joined by 2 line breaks (`\n\n`). If either are empty, the line breaks are removed.

type Comments

type Comments map[string]*Comment

Comments is a map of source location paths to values.

func ParseComments

func ParseComments(fd *descriptorpb.FileDescriptorProto) Comments

ParseComments parses all comments within a proto file. The locations are encoded into the map by joining the paths with a "." character. E.g. `4.2.3.0`.

Leading/trailing spaces are trimmed for each comment type (leading, trailing, detached).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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