Documentation ¶
Index ¶
- Constants
- func AttachDebug(je *Error, err error)
- func ErrorHandler(re *Error, c echo.Context)
- type Address
- type Context
- type Error
- func ErrInternal(message ...interface{}) *Error
- func ErrInvalidParams(message ...interface{}) *Error
- func ErrInvalidRequest(message ...interface{}) *Error
- func ErrMethodNotFound(message ...interface{}) *Error
- func ErrParse(message ...interface{}) *Error
- func ErrScore(err error, debug bool) *Error
- func ErrScoreWithStatus(s module.Status) *Error
- func ErrServer(message ...interface{}) *Error
- func NewError(code ErrorCode, err error, debug bool) *Error
- type ErrorCode
- type ErrorResponse
- type Handler
- type HexBytes
- type HexInt
- type IconOptions
- func (opts IconOptions) Del(key string)
- func (opts IconOptions) Get(key string) string
- func (opts IconOptions) GetBool(key string) (bool, error)
- func (opts IconOptions) GetInt(key string) (int64, error)
- func (opts IconOptions) Set(key, value string)
- func (opts IconOptions) SetBool(key string, value bool)
- func (opts IconOptions) SetInt(key string, v int64)
- func (opts IconOptions) ToHeaderValue() string
- type MethodRepository
- type Params
- type Request
- type Response
- type Validator
Constants ¶
View Source
const ( HeaderKeyIconOptions = "Icon-Options" IconOptionsDebug = "debug" IconOptionsTimeout = "timeout" )
View Source
const Version = "2.0"
Variables ¶
This section is empty.
Functions ¶
func AttachDebug ¶
func ErrorHandler ¶
func ErrorHandler(re *Error, c echo.Context)
Types ¶
type Context ¶
type Context struct { echo.Context // contains filtered or unexported fields }
func NewContext ¶
func NewContext(c echo.Context) *Context
func (*Context) IncludeDebug ¶
type Error ¶
type Error struct { Code ErrorCode `json:"code"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
func ErrInternal ¶
func ErrInternal(message ...interface{}) *Error
func ErrInvalidParams ¶
func ErrInvalidParams(message ...interface{}) *Error
func ErrInvalidRequest ¶
func ErrInvalidRequest(message ...interface{}) *Error
func ErrMethodNotFound ¶
func ErrMethodNotFound(message ...interface{}) *Error
func ErrScoreWithStatus ¶
type ErrorCode ¶
type ErrorCode int
const ( ErrorCodeJsonParse ErrorCode = -32700 ErrorCodeInvalidRequest ErrorCode = -32600 ErrorCodeMethodNotFound ErrorCode = -32601 ErrorCodeInvalidParams ErrorCode = -32602 ErrorCodeInternal ErrorCode = -32603 ErrorCodeServer ErrorCode = -32000 ErrorCodeSystem ErrorCode = -31000 ErrorCodeScore ErrorCode = -30000 )
func (ErrorCode) NewWithData ¶
type ErrorResponse ¶
type IconOptions ¶
func NewIconOptionsByHeader ¶
func NewIconOptionsByHeader(h http.Header) IconOptions
func (IconOptions) Del ¶
func (opts IconOptions) Del(key string)
func (IconOptions) Get ¶
func (opts IconOptions) Get(key string) string
func (IconOptions) Set ¶
func (opts IconOptions) Set(key, value string)
func (IconOptions) SetBool ¶
func (opts IconOptions) SetBool(key string, value bool)
func (IconOptions) SetInt ¶
func (opts IconOptions) SetInt(key string, v int64)
func (IconOptions) ToHeaderValue ¶
func (opts IconOptions) ToHeaderValue() string
type MethodRepository ¶
type MethodRepository struct {
// contains filtered or unexported fields
}
func NewMethodRepository ¶
func NewMethodRepository() *MethodRepository
func (*MethodRepository) Handle ¶
func (mr *MethodRepository) Handle(c echo.Context) (err error)
func (*MethodRepository) InvokeMethod ¶
func (mr *MethodRepository) InvokeMethod(c echo.Context, r *Request) (interface{}, error)
func (*MethodRepository) RegisterMethod ¶
func (mr *MethodRepository) RegisterMethod(method string, handler Handler)
func (*MethodRepository) TakeMethod ¶
func (mr *MethodRepository) TakeMethod(r *Request) (Handler, error)
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func (*Params) RawMessage ¶
type Request ¶
type Request struct { Version string `json:"jsonrpc" validate:"required,version"` Method string `json:"method" validate:"required"` Params json.RawMessage `json:"params,omitempty"` ID interface{} `json:"id"` }
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *Validator
func (*Validator) RegisterAlias ¶
func (*Validator) RegisterStructValidation ¶
func (v *Validator) RegisterStructValidation(fn validator.StructLevelFunc, types ...interface{})
func (*Validator) RegisterValidation ¶
Click to show internal directories.
Click to hide internal directories.