Documentation ¶
Index ¶
- Constants
- func AddHandler(app *appsrv.Application, method string, prefix string, ...) *appsrv.SHandlerInfo
- func AddHandler2(app *appsrv.Application, method string, prefix string, ...) *appsrv.SHandlerInfo
- func DelayProcess(process ProcessFunc, session *mcclient.ClientSession, taskId string, ...)
- func InitHandlers(app *appsrv.Application)
- type Context
- func (ctx *Context) Data() jsonutils.JSONObject
- func (ctx *Context) DelayProcess(process ProcessFunc, data jsonutils.JSONObject)
- func (ctx *Context) GetBaremetalManager() *baremetal.SBaremetalManager
- func (ctx *Context) Params() map[string]string
- func (ctx *Context) Query() jsonutils.JSONObject
- func (ctx *Context) Request() *http.Request
- func (ctx *Context) RequestRemoteIP() string
- func (ctx *Context) ResponseError(err error)
- func (ctx *Context) ResponseJson(obj jsonutils.JSONObject)
- func (ctx *Context) ResponseOk()
- func (ctx *Context) ResponseStruct(obj interface{})
- func (ctx *Context) TaskId() string
- func (ctx *Context) UserCred() mcclient.TokenCredential
- type ProcessFunc
Constants ¶
View Source
const ( BM_PREFIX = "baremetals" SERVER_PREFIX = "servers" PARAMS_BMID_KEY = "<bm_id>" PARAMS_SRVID_KEY = "<srv_id>" )
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(app *appsrv.Application, method string, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo
func AddHandler2 ¶
func DelayProcess ¶
func DelayProcess(process ProcessFunc, session *mcclient.ClientSession, taskId string, data jsonutils.JSONObject)
func InitHandlers ¶
func InitHandlers(app *appsrv.Application)
Types ¶
type Context ¶
func NewContext ¶
func (*Context) Data ¶
func (ctx *Context) Data() jsonutils.JSONObject
func (*Context) DelayProcess ¶
func (ctx *Context) DelayProcess(process ProcessFunc, data jsonutils.JSONObject)
func (*Context) GetBaremetalManager ¶
func (ctx *Context) GetBaremetalManager() *baremetal.SBaremetalManager
func (*Context) Query ¶
func (ctx *Context) Query() jsonutils.JSONObject
func (*Context) RequestRemoteIP ¶
func (*Context) ResponseError ¶
func (*Context) ResponseJson ¶
func (ctx *Context) ResponseJson(obj jsonutils.JSONObject)
func (*Context) ResponseOk ¶
func (ctx *Context) ResponseOk()
func (*Context) ResponseStruct ¶
func (ctx *Context) ResponseStruct(obj interface{})
func (*Context) UserCred ¶
func (ctx *Context) UserCred() mcclient.TokenCredential
type ProcessFunc ¶
type ProcessFunc func(data jsonutils.JSONObject) (jsonutils.JSONObject, error)
Click to show internal directories.
Click to hide internal directories.