Documentation
¶
Index ¶
- Constants
- func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
- func ReqContext() context.Context
- func RunPythonScript(scriptPath ...string) (string, error)
- func SaveMcsFileByUrlToFile(fileName, mcsUrl string) error
- func StreamPythonScriptOutput(wg *sync.WaitGroup, scriptPath ...string)
- type BasicResponse
- type MixedResponse
- type PageInfo
- type ShutdownHandler
- type StopFunc
Constants ¶
View Source
const ( SuccessCode = 200 JsonError = 400 ServerError = 500 BadParamError = 5001 SpaceSignatureError = 6001 ProofParamError = 7001 ProofReadLogError = 7002 ProofError = 7003 UbiTaskParamError = 8001 UbiTaskReadLogError = 8002 UbiTaskError = 8003 CheckResourcesError = 9001 CheckAvailableResources = 9002 CheckWhiteListError = 9003 )
Variables ¶
This section is empty.
Functions ¶
func MonitorShutdown ¶
func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
func ReqContext ¶
func RunPythonScript ¶
func SaveMcsFileByUrlToFile ¶
Types ¶
type BasicResponse ¶
type BasicResponse struct { Status string `json:"status"` Code int `json:"code"` Data interface{} `json:"data,omitempty"` Message string `json:"message,omitempty"` PageInfo *PageInfo `json:"page_info,omitempty"` }
func CreateErrorResponse ¶
func CreateErrorResponse(code int, errMsg ...string) BasicResponse
func CreateSuccessResponse ¶
func CreateSuccessResponse(_data interface{}) BasicResponse
type MixedResponse ¶
type MixedResponse struct { BasicResponse MixData struct { Success interface{} `json:"success"` Fail interface{} `json:"fail"` } `json:"mix_data"` }
type ShutdownHandler ¶
Click to show internal directories.
Click to hide internal directories.