jrpc

command
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 14 Imported by: 0

README

JRPC

JRPC generates code from def files to assist with JSON-based RPCs.

Types

A message field can have one of the following types. The table shows the corresponding generated types. Fields can be marked as repeated by prepending the type with [].

JRPC type Golang type
bool bool
string string
int8 int8
int32 int32
int64 int64
uint8 byte
uint32 uint32
uint64 uint64
float32 float32
float64 float64
bytes []byte
time time.Time
any interface{}
map[x]y map[x]y
rgb util.RGB
Field options

Message fields can take various options which are used to generate validation functions. The router code (template_router.go) automatically calls the validation functions in the generated handlers.

required If set, the value in the incoming JSON must be set. This holds for repeated fields as well, i.e. the field must be set (but could be an empty array).

min Can be used on numeric fields to enforce a minimum allowed value.

max Can be used on numeric fields to enforce a maximum allowed value.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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