feat: added modules

This commit is contained in:
Marvin Zhang
2024-06-14 15:42:50 +08:00
parent 4d0adcb6f0
commit c4d795f47f
626 changed files with 60104 additions and 0 deletions

30
core/entity/task.go Normal file
View File

@@ -0,0 +1,30 @@
package entity
import (
"encoding/json"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TaskMessage struct {
Id primitive.ObjectID `json:"id"`
Key string `json:"key"`
Cmd string `json:"cmd"`
Param string `json:"param"`
}
func (m *TaskMessage) ToString() (string, error) {
data, err := json.Marshal(&m)
if err != nil {
return "", err
}
return string(data), err
}
type TaskRunOptions struct {
}
type StreamMessageTaskData struct {
TaskId primitive.ObjectID `json:"task_id"`
Records []Result `json:"data"`
Logs []string `json:"logs"`
}