v3

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Syntax = "proto3"

Variables

View Source
var (
	Double = &Message{
		Name: "double",
	}
	Float = &Message{
		Name: "float",
	}
	Int32 = &Message{
		Name: "int32",
	}
	Int64 = &Message{
		Name: "int64",
	}
	Uint32 = &Message{
		Name: "uint32",
	}
	Uint64 = &Message{
		Name: "uint64",
	}
	Bool = &Message{
		Name: "bool",
	}
	String = &Message{
		Name: "string",
	}
	Bytes = &Message{
		Name: "bytes",
	}
	Any = &Message{
		Name: "google.protobuf.Any",
	}
)
View Source
var EnumStore = make(map[string]*Message)
View Source
var MessageStore = make(map[string]*Message)

Functions

This section is empty.

Types

type Field

type Field struct {
	Name     string
	Type     *Message
	Number   int
	Comments []string
	JsonName string
}

Field represents protobuf message field definition

func NewField

func NewField(field astutils.FieldMeta, index int) *Field

type Message

type Message struct {
	Name     string
	Fields   []*Field
	Comments []string
}

Message represents protobuf message definition

func MessageOf

func MessageOf(ft string) *Message

func NewMessage

func NewMessage(structmeta astutils.StructMeta) *Message

NewMessage returns message instance from astutils.StructMeta

func NewRequest

func NewRequest(name string, params []astutils.FieldMeta) *Message

func NewResponse

func NewResponse(name string, params []astutils.FieldMeta) *Message

func (*Message) String

func (m *Message) String() string

type Rpc

type Rpc struct {
	Name     string
	Request  *Message
	Response *Message
	Comments []string
}

func NewRpc

func NewRpc(method astutils.MethodMeta) *Rpc

type Service

type Service struct {
	Name      string
	Package   string
	GoPackage string
	Rpcs      []*Rpc
	Messages  []*Message
	Comments  []string
	Imports   []string
	Syntax    string
}

func NewService

func NewService(name, goPackage string) *Service

Jump to

Keyboard shortcuts

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