proto

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version2 = "proto2"
	Version3 = "proto3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Syntax   string
	Package  string
	Options  []*Option
	Messages []*Message
	Services []*Service
}

File

func Unmarshal

func Unmarshal(data any, multiple bool) (f *File, err error)

func (*File) Marshal

func (f *File) Marshal() ([]byte, error)

func (*File) Refine

func (f *File) Refine(includeRpcs, excludeRpcs []string) *File

Refine refine messages and rpcs

type Message

type Message struct {
	Name   string
	Descs  []string
	Fields []*MessageField
}

type MessageField

type MessageField struct {
	Name            string
	Descs           []string
	TypeName        string
	Repeated        bool
	CustomTypeNames []string
	Tags            []string
}

func (*MessageField) Unmarshal

func (v *MessageField) Unmarshal(data any) error

type MessageFieldType added in v1.2.1

type MessageFieldType int32
const (
	MessageFieldTypeNormal MessageFieldType = iota + 1
	MessageFieldTypeSlice
	MessageFieldTypeMap
)

type Option

type Option struct {
	Name  string
	Value string
}

type Service

type Service struct {
	Name  string
	Descs []string
	Rpcs  []*ServiceRpc
}

type ServiceRpc

type ServiceRpc struct {
	Name     string
	Descs    []string
	Request  *Message
	Response *Message
}

Jump to

Keyboard shortcuts

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