Documentation ¶
Index ¶
- type CSErrorResp
- type CSJsonResp
- type ContextService
- func (cs *ContextService) BindToDTO(requestForm, dtoForm interface{}) error
- func (cs *ContextService) BindToRequest(request interface{}) error
- func (cs *ContextService) Json(code int, data interface{}) error
- func (cs *ContextService) JsonEmpty(code int) error
- func (cs *ContextService) JsonError(code int, err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSErrorResp ¶
type CSErrorResp struct {
ErrorMessage string `json:"error_message,omitempty"`
}
Custom error
func (*CSErrorResp) Error ¶
func (e *CSErrorResp) Error() string
type CSJsonResp ¶
type CSJsonResp struct {
Result interface{} `json:"result"`
}
type ContextService ¶
type ContextService struct {
echo.Context
}
func New ¶
func New(c echo.Context) *ContextService
func (*ContextService) BindToDTO ¶
func (cs *ContextService) BindToDTO(requestForm, dtoForm interface{}) error
BindToDTO builds a request of the given form based on the context and converts it to a DTO.
func (*ContextService) BindToRequest ¶
func (cs *ContextService) BindToRequest(request interface{}) error
BindToRequest populates the request fields based on the context path and query parameters and body and validates the result.
func (*ContextService) Json ¶
func (cs *ContextService) Json(code int, data interface{}) error
func (*ContextService) JsonEmpty ¶
func (cs *ContextService) JsonEmpty(code int) error
Click to show internal directories.
Click to hide internal directories.