Documentation
¶
Index ¶
- func ParseBody(data []byte, destination interface{}) error
- type Collection
- type Config
- type ContentResponse
- type ContentResponseContext
- type ContentResponseMeta
- type ContextTPL
- type Kind
- type Message
- type MessageTPL
- type Messages
- type ParamHolder
- type ParamItem
- type PrivateTPL
- type RawBody
- type RawHeaders
- type RawParams
- type Reason
- type Req
- type ResultError
- type StreamResult
- type TPL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection []Config
type Config ¶
type Config struct {
Kind Kind
IsStream bool
IsPrivate bool
Key string
Path string
Method string
Input func() interface{}
Build func(meta.RequestId, RawHeaders, RawBody, RawParams) (TPL, error)
BuildMessages func(meta.RequestId, RawHeaders, RawBody, RawParams) (MessageTPL, error)
Direct func(req Req) (interface{}, error)
Auth func(Req) error
Before []func(Config, Req) error
After func(Config, Req)
}
type ContentResponse ¶
type ContentResponse struct {
Content interface{} `json:"content"`
ContentResponseContext
ContentResponseMeta
}
func ToContentResponse ¶
func ToContentResponse(
resources interface{},
meta ContentResponseMeta,
) ContentResponse
type ContentResponseContext ¶ added in v0.1.7
type ContentResponseMeta ¶
type ContextTPL ¶ added in v0.1.14
type MessageTPL ¶ added in v0.1.2
type ParamHolder ¶ added in v0.1.3
type PrivateTPL ¶ added in v0.0.26
type RawHeaders ¶ added in v0.0.26
type RawHeaders []ParamItem
func (RawHeaders) Assign ¶ added in v0.1.3
func (ps RawHeaders) Assign(v interface{}) error
type Req ¶ added in v0.1.14
type Req struct {
ID meta.RequestId
Headers RawHeaders
Body RawBody
Params RawParams
Input interface{}
Timer *servertiming.Header
Context *gin.Context
}
type ResultError ¶
type ResultError struct {
Status int `json:"-"`
Field string `json:"-"`
ErrMessage string `json:"-"`
Message string `json:"message"`
Reasons []map[string]interface{} `json:"reasons"`
}
func ToResultError ¶
func ToResultError(err error, message string, status int) *ResultError
func (*ResultError) Error ¶
func (m *ResultError) Error() string
func (*ResultError) GetDetails ¶
func (m *ResultError) GetDetails() ResultError
func (*ResultError) GetMessage ¶
func (m *ResultError) GetMessage() string
func (*ResultError) GetStatus ¶
func (m *ResultError) GetStatus() int
type StreamResult ¶ added in v0.0.56
Click to show internal directories.
Click to hide internal directories.