v3

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Syntax = "proto3"

Variables

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

Functions

This section is empty.

Types

type Enum added in v1.2.11

type Enum struct {
	Name   string
	Fields []EnumField
}

func NewEnum added in v1.2.11

func NewEnum(enumMeta astutils.EnumMeta) Enum

func (Enum) GetName added in v1.2.11

func (e Enum) GetName() string

func (Enum) Inner added in v1.2.11

func (e Enum) Inner() bool

func (Enum) String added in v1.2.11

func (e Enum) String() string

type EnumField added in v1.2.11

type EnumField struct {
	Name   string
	Number int
}

type Field

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

Field represents protobuf message field definition

type Message

type Message struct {
	Name       string
	Fields     []Field
	Comments   []string
	IsInner    bool
	IsScalar   bool
	IsMap      bool
	IsRepeated bool
	IsTopLevel bool
}

Message represents protobuf message definition

func NewMessage

func NewMessage(structmeta astutils.StructMeta) Message

NewMessage returns message instance from astutils.StructMeta

func (Message) GetName added in v1.2.11

func (m Message) GetName() string

func (Message) Inner added in v1.2.11

func (m Message) Inner() bool

func (Message) String

func (m Message) String() string

type ProtobufType added in v1.2.11

type ProtobufType interface {
	GetName() string
	String() string
	Inner() bool
}

func MessageOf

func MessageOf(ft string) ProtobufType

type Rpc

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

func NewRpc

func NewRpc(method astutils.MethodMeta) Rpc

type Service

type Service struct {
	Name      string
	Package   string
	GoPackage string
	Syntax    string
	// go-doudou version
	Version  string
	ProtoVer string
	Rpcs     []Rpc
	Messages []Message
	Enums    []Enum
	Comments []string
	Imports  []string
}

func NewService

func NewService(name, goPackage string) Service

type StreamType added in v1.3.0

type StreamType int

Jump to

Keyboard shortcuts

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