-
Notifications
You must be signed in to change notification settings - Fork 51
/
model.go
69 lines (63 loc) · 1.54 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package interfaces
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Model interface {
GetId() (id primitive.ObjectID)
SetId(id primitive.ObjectID)
}
type ModelId int
const (
ModelIdArtifact = iota
ModelIdTag
ModelIdNode
ModelIdProject
ModelIdSpider
ModelIdTask
ModelIdJob
ModelIdSchedule
ModelIdUser
ModelIdSetting
ModelIdToken
ModelIdVariable
ModelIdTaskQueue
ModelIdTaskStat
ModelIdPlugin
ModelIdSpiderStat
ModelIdDataSource
ModelIdDataCollection
ModelIdResult
ModelIdPassword
ModelIdExtraValue
ModelIdPluginStatus
ModelIdGit
)
const (
ModelColNameArtifact = "artifacts"
ModelColNameTag = "tags"
ModelColNameNode = "nodes"
ModelColNameProject = "projects"
ModelColNameSpider = "spiders"
ModelColNameTask = "tasks"
ModelColNameJob = "jobs"
ModelColNameSchedule = "schedules"
ModelColNameUser = "users"
ModelColNameSetting = "settings"
ModelColNameToken = "tokens"
ModelColNameVariable = "variables"
ModelColNameTaskQueue = "task_queue"
ModelColNameTaskStat = "task_stats"
ModelColNamePlugin = "plugins"
ModelColNameSpiderStat = "spider_stats"
ModelColNameDataSource = "data_sources"
ModelColNameDataCollection = "data_collections"
ModelColNamePasswords = "passwords"
ModelColNameExtraValues = "extra_values"
ModelColNamePluginStatus = "plugin_status"
ModelColNameGit = "gits"
)
type ModelWithTags interface {
Model
SetTags(tags []Tag)
GetTags() (tags []Tag)
}