Versions in this module Expand all Collapse all v1 v1.0.0 Aug 2, 2017 Changes in this version + const Version + var Filter func(context.Context, *Request) *Error + func DebugHandler(w http.ResponseWriter, r *http.Request) + func Handler(w http.ResponseWriter, r *http.Request) + func Methods() map[string]Metadata + func ParseRequest(r *http.Request) ([]Request, bool, *Error) + func PurgeMethods() + func RegisterMethod(method string, f Func, params, result interface{}) error + func SendResponse(w http.ResponseWriter, resp []Response, batch bool) error + func TakeMethod(r Request) (Func, *Error) + type Client struct + Url string + func NewClient(url string) *Client + func (c *Client) Call(method string, params interface{}, id int) (*Resp, error) + func (c *Client) CallTimeout(method string, params interface{}, id int, timeout time.Duration) (*Resp, error) + type Controller struct + F Func + Name string + Params interface{} + Result interface{} + type Error struct + Code ErrorCode + Data interface{} + Message string + func ErrInternal() *Error + func ErrInvalidParams() *Error + func ErrInvalidRequest() *Error + func ErrMethodNotFound() *Error + func ErrParse() *Error + func Unmarshal(params *json.RawMessage, dst interface{}) *Error + func (e *Error) Error() string + type ErrorCode int + const ErrorCodeInternal + const ErrorCodeInvalidParams + const ErrorCodeInvalidRequest + const ErrorCodeMethodNotFound + const ErrorCodeParse + type Func func(c context.Context, params *json.RawMessage) (result interface{}, err *Error) + type Metadata struct + Func Func + Params interface{} + Result interface{} + type MethodReference struct + Function string + Name string + Params *jsonschema.Schema + Result *jsonschema.Schema + type MethodRepository struct + type Request struct + ID *json.RawMessage + Method string + Params *json.RawMessage + Version string + type Resp struct + Error *RespError + Id int + Result interface{} + type RespError struct + Code int + Data interface{} + Message string + func (this *RespError) Error() string + type Response struct + Error *Error + ID *json.RawMessage + Result interface{} + Version string + func NewResponse(r Request) Response