Documentation ¶
Index ¶
- Variables
- func ConvertMapToJwtString(param map[string]interface{}) (jwtString string, err error)
- func CorsChecked(r *http.Request, w http.ResponseWriter) bool
- func RedisHttpStart(path string, port int64)
- func ToStruct(r *http.Request, v interface{}) error
- type HttpContext
- func (svcCtx *HttpContext) DelHandler() (result interface{}, err error)
- func (svcCtx *HttpContext) GetHandler() (ret interface{}, err error)
- func (svc *HttpContext) JsonBodyBytes() (data []byte)
- func (svc *HttpContext) KeyFieldAtJwt() (operation string, err error)
- func (svc *HttpContext) MergeJwtField(paramIn map[string]interface{})
- func (svc *HttpContext) MsgpackBody() (bytes []byte, err error)
- func (svc *HttpContext) MsgpackBodyBytes() (data []byte)
- func (svc *HttpContext) ParseJwtToken() (err error)
- func (svcCtx *HttpContext) PostHandler() (ret interface{}, err error)
- func (svcCtx *HttpContext) PutHandler() (data interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadCommand = errors.New("error bad command")
View Source
var ErrEmptyKeyOrField = errors.New("empty key or field")
View Source
var ErrIncompleteRequest = errors.New("incomplete request")
View Source
var ErrOperationNotPermited = errors.New("operation permission denied")
Functions ¶
func ConvertMapToJwtString ¶
func CorsChecked ¶
func CorsChecked(r *http.Request, w http.ResponseWriter) bool
func RedisHttpStart ¶
listten to a port and start http server
Types ¶
type HttpContext ¶
type HttpContext struct { Req *http.Request Rsb http.ResponseWriter Ctx context.Context RedisDataSource string // case get Cmd string Key string Field string ResponseContentType string // contains filtered or unexported fields }
func NewHttpContext ¶
func NewHttpContext(ctx context.Context, r *http.Request, w http.ResponseWriter) (httpCtx *HttpContext, err error)
func (*HttpContext) DelHandler ¶
func (svcCtx *HttpContext) DelHandler() (result interface{}, err error)
func (*HttpContext) GetHandler ¶
func (svcCtx *HttpContext) GetHandler() (ret interface{}, err error)
func (*HttpContext) JsonBodyBytes ¶
func (svc *HttpContext) JsonBodyBytes() (data []byte)
func (*HttpContext) KeyFieldAtJwt ¶
func (svc *HttpContext) KeyFieldAtJwt() (operation string, err error)
func (*HttpContext) MergeJwtField ¶
func (svc *HttpContext) MergeJwtField(paramIn map[string]interface{})
func (*HttpContext) MsgpackBody ¶
func (svc *HttpContext) MsgpackBody() (bytes []byte, err error)
Ensure the body is msgpack format
func (*HttpContext) MsgpackBodyBytes ¶
func (svc *HttpContext) MsgpackBodyBytes() (data []byte)
func (*HttpContext) ParseJwtToken ¶
func (svc *HttpContext) ParseJwtToken() (err error)
func (*HttpContext) PostHandler ¶
func (svcCtx *HttpContext) PostHandler() (ret interface{}, err error)
func (*HttpContext) PutHandler ¶
func (svcCtx *HttpContext) PutHandler() (data interface{}, err error)
Click to show internal directories.
Click to hide internal directories.