Documentation ¶
Index ¶
- func GetPostedJson(ctx *gin.Context, output interface{}) (rawData []byte, err error)
- type Config
- type HandlerBasicInformation
- type IRequestHandler
- type Parameters
- type Response
- func (c *Response) BadRequest(data interface{})
- func (c *Response) ForbiddenRequest(data interface{})
- func (c *Response) InternalServerError(data interface{})
- func (c *Response) NotFoundRequest(data interface{})
- func (c *Response) OK(data interface{})
- func (c *Response) ServiceError(code int64, data interface{})
- func (c *Response) ServiceSuccess(data interface{})
- type Server
- type ServiceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Address string `json:"address"` BasePath string `json:"base_path"` EnableTLS bool `json:"enable_tls"` AllowCORS bool `json:"allow_cors"` RequestHandler []IRequestHandler `json:"-"` }
type HandlerBasicInformation ¶
type HandlerBasicInformation struct { Path string Method string Description string Parameters Parameters }
type IRequestHandler ¶
type IRequestHandler interface { Handle(ctx *gin.Context) RouteRegister(router gin.IRouter) BasicInformation() (info HandlerBasicInformation) }
type Parameters ¶
type Parameters struct { Type string Template interface{} }
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func (*Response) BadRequest ¶
func (c *Response) BadRequest(data interface{})
func (*Response) ForbiddenRequest ¶
func (c *Response) ForbiddenRequest(data interface{})
func (*Response) InternalServerError ¶
func (c *Response) InternalServerError(data interface{})
func (*Response) NotFoundRequest ¶
func (c *Response) NotFoundRequest(data interface{})
func (*Response) ServiceError ¶
service response will always set http status to 200.
func (*Response) ServiceSuccess ¶
func (c *Response) ServiceSuccess(data interface{})
type ServiceResult ¶
Click to show internal directories.
Click to hide internal directories.