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)boolanynull
-
uint8 -
uint16 -
uint32 -
uint64 -
int8 -
int16 -
int32 -
int64
float32float64
string
timestamp- for date/time
- form:
[]<type> - ie.
[]string[]uint8[][]string- ..
- form:
map<key,value> - ie.
map<string,any>map<string,map<string,any>>map<string,[]uint8>map<int64,[]string>map<string,User>- whereUseris a struct type defined in schema
- enum, see examples
blobaka..[]byte- TODO: https://github.com/PsychoLlama/bin-json might have some ideas for us
- struct or object
- think of it just as a Javascript object or JSON object
- fields of an object can be
optional - fields of an object are by default required, unless made optional
- fields of an object 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