Documentation ¶
Index ¶
- func ReadData(r io.Reader, d interface{}) error
- func UUID() string
- func WriteData(w io.Writer, d interface{}) error
- type BaseHandler
- type BasicHandler
- func (this *BasicHandler) HandlerInit(h Handler)
- func (this *BasicHandler) ProcessAdd(context *HttpContext) error
- func (this *BasicHandler) ProcessDelete(context *HttpContext) error
- func (this *BasicHandler) ProcessExtend(context *HttpContext) error
- func (this *BasicHandler) ProcessModify(context *HttpContext) error
- func (this *BasicHandler) ProcessRequest(context *HttpContext) error
- func (this *BasicHandler) ProcessResponse(context *HttpContext) error
- func (this *BasicHandler) ProcessUpdate(context *HttpContext) error
- func (this *BasicHandler) ServeHTTP(rsp http.ResponseWriter, req *http.Request)
- type CommandRequest
- type CommandResponse
- type Handler
- type HttpContext
- func MakeFailure(context *HttpContext, err error) *HttpContext
- func MakeFailure2(context *HttpContext, code int, err error) *HttpContext
- func MakeFailureResponse(context *HttpContext, code int, err error, data interface{}) *HttpContext
- func MakeSuccess(context *HttpContext) *HttpContext
- func MakeSuccessResponse(context *HttpContext, data interface{}) *HttpContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseHandler ¶
type BaseHandler struct{}
func (*BaseHandler) ServeHTTP ¶
func (this *BaseHandler) ServeHTTP(rsp http.ResponseWriter, req *http.Request)
type BasicHandler ¶
type BasicHandler struct { BaseHandler // contains filtered or unexported fields }
func (*BasicHandler) HandlerInit ¶
func (this *BasicHandler) HandlerInit(h Handler)
func (*BasicHandler) ProcessAdd ¶
func (this *BasicHandler) ProcessAdd(context *HttpContext) error
func (*BasicHandler) ProcessDelete ¶
func (this *BasicHandler) ProcessDelete(context *HttpContext) error
func (*BasicHandler) ProcessExtend ¶
func (this *BasicHandler) ProcessExtend(context *HttpContext) error
func (*BasicHandler) ProcessModify ¶
func (this *BasicHandler) ProcessModify(context *HttpContext) error
func (*BasicHandler) ProcessRequest ¶
func (this *BasicHandler) ProcessRequest(context *HttpContext) error
func (*BasicHandler) ProcessResponse ¶
func (this *BasicHandler) ProcessResponse(context *HttpContext) error
func (*BasicHandler) ProcessUpdate ¶
func (this *BasicHandler) ProcessUpdate(context *HttpContext) error
func (*BasicHandler) ServeHTTP ¶
func (this *BasicHandler) ServeHTTP( rsp http.ResponseWriter, req *http.Request)
type CommandRequest ¶
type CommandRequest struct { Id string `json:"id"` Cmd string `json:"command"` Data json.RawMessage `json:"data,omitempty"` }
type CommandResponse ¶
type Handler ¶
type Handler interface { HandlerInit(h Handler) ProcessAdd(context *HttpContext) error ProcessModify(context *HttpContext) error ProcessUpdate(context *HttpContext) error ProcessDelete(context *HttpContext) error ProcessExtend(context *HttpContext) error ProcessRequest(context *HttpContext) error ProcessResponse(context *HttpContext) error }
type HttpContext ¶
type HttpContext struct { HttpReq *http.Request HttpRsp http.ResponseWriter ReqData *CommandRequest RspData *CommandResponse }
func MakeFailure ¶
func MakeFailure( context *HttpContext, err error) *HttpContext
func MakeFailure2 ¶
func MakeFailure2( context *HttpContext, code int, err error) *HttpContext
func MakeFailureResponse ¶
func MakeFailureResponse(context *HttpContext, code int, err error, data interface{}) *HttpContext
func MakeSuccess ¶
func MakeSuccess(context *HttpContext) *HttpContext
func MakeSuccessResponse ¶
func MakeSuccessResponse( context *HttpContext, data interface{}) *HttpContext
func (*HttpContext) GetCmd ¶
func (this *HttpContext) GetCmd() string
func (*HttpContext) ID ¶
func (this *HttpContext) ID() string
func (*HttpContext) Init ¶
func (this *HttpContext) Init() error
Click to show internal directories.
Click to hide internal directories.