Esempio n. 1
0
// ジョブ実行結果が得られないようなエラーが発生した場合のレスポンスメッセージを生成する。
func (s *Session) createErrorResponse(req *message.Request, err error) *message.Response {
	res := new(message.Response)
	res.NID = req.NID
	res.JID = req.JID
	res.Stat = db.ABNORMAL
	res.Detail = err.Error()
	return res
}
Esempio n. 2
0
func doTestRequest(req *message.Request, conf *config.ServantConfig, stCh chan<- string) *message.Response {
	res := new(message.Response)
	res.NID = req.NID
	res.RC = 1
	res.Detail = "detail"
	res.JID = req.JID
	res.Stat = db.NORMAL
	res.St = "20150331131524.123456789"
	res.Et = "20150331131525.123456789"

	return res
}
Esempio n. 3
0
func testSendRequest_Abnormal(host string, port int, reqMsg string, stCh chan<- string) (string, error) {
	req := new(message.Request)
	req.ParseJSON("reqMsg")

	res := new(message.Response)
	res.NID = req.NID
	res.JID = req.JID
	res.RC = 1
	res.Stat = 9
	res.Detail = "testerror"
	res.Var = "testvar"
	res.St = "2015-04-01 12:34:56.789"
	res.Et = "2015-04-01 12:35:46.123"

	resMsg, _ := res.GenerateJSON()
	return resMsg, nil
}