Documentation ¶
Index ¶
- Constants
- func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
- func ReqContext() context.Context
- func RunPythonScript(scriptPath ...string) (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 ProofParamError = 8001 ProofReadLogError = 8002 ProofError = 8003 )
Variables ¶
This section is empty.
Functions ¶
func MonitorShutdown ¶
func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
func ReqContext ¶
func RunPythonScript ¶
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.