webrpc is a design/schema driven approach to writing backend servers, with fully-generated client libraries. Write your schema, and it will generate strongly-typed bindings between your server and client. The type system is described below.
Some example webrpc schemas:
byte
(aka uint8)bool
any
null
-
uint8
-
uint16
-
uint32
-
uint64
-
int8
-
int16
-
int32
-
int64
float32
float64
string
timestamp
- for date/time (serialized to ECMA Script ISO 8601 format:YYYY-MM-DDTHH:mm:ss.sssZ
)
- List represents a JSON array over the wire
- form:
[]<type>
- ie.
[]string
[]uint8
[][]string
- ..
- Map represents a JSON object with 0..N properties (key:value pairs) over the wire
- form:
map<key,value>
- ie.
map<string,any>
map<string,map<string,any>>
map<string,[]uint8>
map<int64,[]string>
map<string,User>
- whereUser
is a struct type defined in schema
- enum, see examples
- struct represents a JSON object over the wire
- struct has 0..N fields
- field can be
optional
- fields are by default required, unless made optional
- fields always return default values by default, ie. default of int is 0, string is "", etc. (like in Go)
- otherwise someone should make it optional which will have it be nullable
- field can be