Versions in this module Expand all Collapse all v0 v0.1.1 Jun 10, 2024 Changes in this version + const CodeInternalError + const CodeInvalidParams + const CodeInvalidRequest + const CodeMethodNotFound + const CodeParseError + func SwguiSettings(settingsUI map[string]string, rpcPath string) map[string]string + type ErrWithAppCode interface + AppErrCode func() int + type ErrWithCanonicalStatus interface + Status func() status.Code + type ErrWithFields interface + Fields func() map[string]interface{} + type Error struct + Code ErrorCode + Data interface{} + Message string + type ErrorCode int + type Handler struct + Middlewares []usecase.Middleware + OpenAPI *OpenAPI + SkipParamsValidation bool + SkipResultValidation bool + Validator Validator + func (h *Handler) Add(u usecase.Interactor) + func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type JSONSchemaValidator struct + func (jv *JSONSchemaValidator) AddParamsSchema(method string, jsonSchema []byte) error + func (jv *JSONSchemaValidator) AddResultSchema(method string, jsonSchema []byte) error + func (jv *JSONSchemaValidator) ValidateParams(method string, jsonBody []byte) error + func (jv *JSONSchemaValidator) ValidateResult(method string, jsonBody []byte) error + type OpenAPI struct + BasePath string + func (c *OpenAPI) Annotate(name string, setup ...func(op *openapi3.Operation) error) + func (c *OpenAPI) Collect(name string, u usecase.Interactor, v Validator, ...) (err error) + func (c *OpenAPI) Reflector() *openapi3.Reflector + func (c *OpenAPI) ServeHTTP(rw http.ResponseWriter, _ *http.Request) + type Request struct + ID *interface{} + JSONRPC string + Method string + Params json.RawMessage + type Response struct + Error *Error + ID *interface{} + JSONRPC string + Result json.RawMessage + type ValidationErrors map[string][]string + func (re ValidationErrors) Error() string + func (re ValidationErrors) Fields() map[string]interface{} + type Validator interface + AddParamsSchema func(method string, jsonSchema []byte) error + AddResultSchema func(method string, jsonSchema []byte) error + ValidateParams func(method string, jsonBody []byte) error + ValidateResult func(method string, jsonBody []byte) error