mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
refactor: code cleanup
This commit is contained in:
@@ -1,28 +1,9 @@
|
||||
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"`
|
||||
|
||||
Reference in New Issue
Block a user