[agent-go] 调通Executor的代码

This commit is contained in:
zeaslity
2023-03-27 16:06:33 +08:00
parent 5accd999f8
commit 31f9267401
9 changed files with 124 additions and 54 deletions

View File

@@ -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{},
}