Documentation
¶
Index ¶
- Constants
- func NewGen(env *typecheck.Data) *typescriptGen
- type API
- type Array
- type Base
- type Client
- type Decl
- type Def
- type Field
- type File
- type FuncSig
- type Import
- type JSONTags
- type Map
- type Message
- type Metadata
- type Oneof
- type OneofField
- type Package
- type Pointer
- type Serialize
- type StreamType
- type Type
Constants ¶
View Source
const ( BYTE_KIND int = iota UINT32_KIND UINT64_KIND UINT128_KIND INT32_KIND INT64_KIND INT128_KIND FLOAT32_KIND FLOAT64_KIND BOOL_KIND STRING_KIND UUID_KIND )
Base types.
View Source
const (
MRPC_PATH string = "mrpc-ts/mrpc"
)
Fixed paths.
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} UINT32 *Base = &Base{UINT32_KIND} UINT64 *Base = &Base{UINT64_KIND} UINT128 *Base = &Base{UINT128_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. Path string // The full path of the client. }
Client declaration.
Clients are translated to classes in Typescript.
type Field ¶
type Field struct { Doc string // Documentation, if any. Name string // The name of the field. Tag string // Tag used for JSON. Type Type // The type of 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. Metadata []Metadata // List of file-specific metadata. // 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 classes in Typescript.
type OneofField ¶
Oneof field.
type Package ¶
type Package struct { Name string // The name of the package. Path string // The path of the package. Files []*File // A list of files. Imports []*Package // A list of packages imported (dependencies). }
`Package` defines the overall Typescript group that defines the entire package.
type StreamType ¶
type StreamType int
Streaming types.
const ( NONE StreamType = iota SERVER CLIENT BOTH )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.