[agent-go] 调通Executor的代码
This commit is contained in:
@@ -2,6 +2,8 @@ package config
|
||||
|
||||
import (
|
||||
"agent-go/utils"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -30,11 +32,18 @@ func (m *OctopusMessage) BuildOctopusMsg(omType string, content interface{}) *Oc
|
||||
// 当前时间
|
||||
curTimeString := utils.CurTimeString()
|
||||
|
||||
// must write to string format, otherwise it's very hard to deserialize
|
||||
|
||||
bytes, err := json.Marshal(content)
|
||||
if err != nil {
|
||||
fmt.Sprintf("OctopusMessage Build Error ! %v", err)
|
||||
}
|
||||
|
||||
return &OctopusMessage{
|
||||
UUID: curTimeString,
|
||||
InitTime: time.Now(),
|
||||
Type: omType,
|
||||
Content: content,
|
||||
Content: string(bytes),
|
||||
Result: nil,
|
||||
ACTime: time.Time{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user