unordered

package
v4.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum

type Enum struct {
	EnumName string
	EnumBody *EnumBody

	// Comments are the optional ones placed at the beginning.
	Comments []*parser.Comment
	// InlineComment is the optional one placed at the ending.
	InlineComment *parser.Comment
	// InlineCommentBehindLeftCurly is the optional one placed behind a left curly.
	InlineCommentBehindLeftCurly *parser.Comment
	// Meta is the meta information.
	Meta meta.Meta
}

Enum consists of a name and an enum body.

func InterpretEnum

func InterpretEnum(src *parser.Enum) (*Enum, error)

InterpretEnum interprets *parser.Enum to *Enum.

type EnumBody

type EnumBody struct {
	Options         []*parser.Option
	EnumFields      []*parser.EnumField
	Reserveds       []*parser.Reserved
	EmptyStatements []*parser.EmptyStatement
}

EnumBody is unordered in nature, but each slice field preserves the original order.

type Extend

type Extend struct {
	MessageType string
	ExtendBody  *ExtendBody

	// Comments are the optional ones placed at the beginning.
	Comments []*parser.Comment
	// InlineComment is the optional one placed at the ending.
	InlineComment *parser.Comment
	// InlineCommentBehindLeftCurly is the optional one placed behind a left curly.
	InlineCommentBehindLeftCurly *parser.Comment
	// Meta is the meta information.
	Meta meta.Meta
}

Extend consists of a messageType and a extend body.

func InterpretExtend

func InterpretExtend(src *parser.Extend) (*Extend, error)

InterpretExtend interprets *parser.Extend to *Extend.

type ExtendBody

type ExtendBody struct {
	Fields          []*parser.Field
	EmptyStatements []*parser.EmptyStatement
}

ExtendBody is unordered in nature, but each slice field preserves the original order.

type Message

type Message struct {
	MessageName string
	MessageBody *MessageBody

	// Comments are the optional ones placed at the beginning.
	Comments []*parser.Comment
	// InlineComment is the optional one placed at the ending.
	InlineComment *parser.Comment
	// InlineCommentBehindLeftCurly is the optional one placed behind a left curly.
	InlineCommentBehindLeftCurly *parser.Comment
	// Meta is the meta information.
	Meta meta.Meta
}

Message consists of a message name and a message body.

func InterpretMessage

func InterpretMessage(src *parser.Message) (*Message, error)

InterpretMessage interprets *parser.Message to *Message.

type MessageBody

type MessageBody struct {
	Fields          []*parser.Field
	Enums           []*Enum
	Messages        []*Message
	Options         []*parser.Option
	Oneofs          []*parser.Oneof
	Maps            []*parser.MapField
	Groups          []*parser.GroupField
	Reserves        []*parser.Reserved
	Extends         []*parser.Extend
	EmptyStatements []*parser.EmptyStatement
	Extensions      []*parser.Extensions
}

MessageBody is unordered in nature, but each slice field preserves the original order.

type Proto

type Proto struct {
	Syntax    *parser.Syntax
	ProtoBody *ProtoBody
}

Proto represents a protocol buffer definition.

func InterpretProto

func InterpretProto(src *parser.Proto) (*Proto, error)

InterpretProto interprets *parser.Proto to *Proto.

type ProtoBody

type ProtoBody struct {
	Imports         []*parser.Import
	Packages        []*parser.Package
	Options         []*parser.Option
	Messages        []*Message
	Extends         []*Extend
	Enums           []*Enum
	Services        []*Service
	EmptyStatements []*parser.EmptyStatement
}

ProtoBody is unordered in nature, but each slice field preserves the original order.

type Service

type Service struct {
	ServiceName string
	ServiceBody *ServiceBody

	// Comments are the optional ones placed at the beginning.
	Comments []*parser.Comment
	// InlineComment is the optional one placed at the ending.
	InlineComment *parser.Comment
	// InlineCommentBehindLeftCurly is the optional one placed behind a left curly.
	InlineCommentBehindLeftCurly *parser.Comment
	// Meta is the meta information.
	Meta meta.Meta
}

Service consists of RPCs.

func InterpretService

func InterpretService(src *parser.Service) (*Service, error)

InterpretService interprets *parser.Service to *Service.

type ServiceBody

type ServiceBody struct {
	Options []*parser.Option
	RPCs    []*parser.RPC
}

ServiceBody is unordered in nature, but each slice field preserves the original order.

Jump to

Keyboard shortcuts

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