Documentation
¶
Index ¶
Constants ¶
View Source
const ( MRPC_PATH string = "github.com/mslmio/mrpc-go" INT128_PATH string = "github.com/mslmio/int128-go" )
Fixed paths.
View Source
const ( BYTE_KIND int = iota UINT8_KIND UINT16_KIND UINT32_KIND UINT64_KIND UINT128_KIND INT8_KIND INT16_KIND INT32_KIND INT64_KIND INT128_KIND FLOAT32_KIND FLOAT64_KIND BOOL_KIND STRING_KIND UUID_KIND )
Base types.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Doc string // Documentation, if any.
Recv *Field // Receiver.
Name string // The name of the API.
Type *FuncSig // API signature.
Parent Decl // The declaration to which the API belongs to.
Stream StreamType // Streaming type.
Package *Package // The package to which the API belongs to.
ParentPath string // The parent path of the API.
Path string // The full path of the API.
Public bool // Set if the API is exposed.
}
APIs.
type Base ¶
type Base struct {
Kind int
}
Base type.
var ( BYTE *Base = &Base{BYTE_KIND} UINT8 *Base = &Base{UINT8_KIND} UINT16 *Base = &Base{UINT16_KIND} UINT32 *Base = &Base{UINT32_KIND} UINT64 *Base = &Base{UINT64_KIND} UINT128 *Base = &Base{UINT128_KIND} INT8 *Base = &Base{INT8_KIND} INT16 *Base = &Base{INT16_KIND} INT32 *Base = &Base{INT32_KIND} INT64 *Base = &Base{INT64_KIND} INT128 *Base = &Base{INT128_KIND} FLOAT32 *Base = &Base{FLOAT32_KIND} FLOAT64 *Base = &Base{FLOAT64_KIND} BOOL *Base = &Base{BOOL_KIND} STRING *Base = &Base{STRING_KIND} UUID *Base = &Base{UUID_KIND} )
type Client ¶
type Client struct {
Doc string // Documentation, if any.
Name string // The name of the client.
Protocol string // The protocol for the client.
APIs []*API // A list of APIs for the client.
Package *Package // The package to which the client belongs to.
}
Client declaration.
Clients are implemented through the `struct` type.
type Field ¶
type Field struct {
Doc string // Documentation, if any.
Name string // The name of the field.
Type Type // The type of the field.
Tags []string // Tag used for the field.
}
Fields.
type File ¶
type File struct {
Package *Package // The package to which the file belongs to.
Imports []*Import // Packages imported by the file.
Decls []Decl // A list of declarations in the file.
// contains filtered or unexported fields
}
This file includes any messages or servers exported by the protocol file.
type Import ¶
type Import struct {
Doc string // Documentation, if any.
Name string // The name of the import, if any.
Path string // The corresponding path.
}
Golang import.
type Message ¶
type Message struct {
Doc string // Documentation, if any.
Name string // The name of the message.
Fields []*Field // A list of fields.
Package *Package // The package to which the message belongs to.
Path string // The full path of the message.
}
Message declaration.
Messages are translated to the `struct` data type in Golang.
type OneofField ¶
Oneof field.
type Package ¶
type Package struct {
Doc string // Documentation, if any.
Name string // The name of the package.
Path string // The corresponding path.
Files []*File // A list of files.
Imports []*Package // A list of packages imported.
}
`Package` defines the main Golang package file for the Mrpc protocol file.
type Server ¶
type Server struct {
Doc string // Documentation, if any.
Name string // The name of the server.
Protocol string // The protocol for the server.
APIs []*API // A list of APIs for the server.
Package *Package // The package to which the server belongs to.
Path string // The full path of the server.
}
Server declaration.
Servers are implemented through the `interface` type.
type StreamType ¶
type StreamType int
Streaming types.
const ( NONE StreamType = iota SERVER CLIENT BOTH )
Click to show internal directories.
Click to hide internal directories.