-
Notifications
You must be signed in to change notification settings - Fork 492
/
resource.go
78 lines (60 loc) · 1.88 KB
/
resource.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
70
71
72
73
74
75
76
77
78
package api
import (
"build-booster/common/http/httpserver"
"build-booster/gateway/config"
"build-booster/gateway/pkg/register-discover"
"build-booster/server/pkg/engine/apisjob"
"build-booster/server/pkg/engine/distcc"
"build-booster/server/pkg/engine/disttask"
"build-booster/server/pkg/engine/fastbuild"
)
var Rd register_discover.RegisterDiscover
// DistCCServerAPIResource describe all the server api resources
type DistCCServerAPIResource struct {
ActionsV1 []*httpserver.Action
MySQL distcc.MySQL
Conf *config.GatewayConfig
}
var distCCServerAPI = DistCCServerAPIResource{}
func GetDistCCServerAPIResource() *DistCCServerAPIResource {
return &distCCServerAPI
}
func (a *DistCCServerAPIResource) InitActions() {
a.ActionsV1 = append(a.ActionsV1, GetAPIV1Action()...)
}
type FBServerAPIResource struct {
ActionsV1 []*httpserver.Action
MySQL fastbuild.MySQL
Conf *config.GatewayConfig
}
var fbServerAPI = FBServerAPIResource{}
func GetFBServerAPIResource() *FBServerAPIResource {
return &fbServerAPI
}
func (a *FBServerAPIResource) InitActions() {
a.ActionsV1 = append(a.ActionsV1, GetAPIV1Action()...)
}
type XNAPISServerAPIResource struct {
ActionsV1 []*httpserver.Action
MySQL apisjob.MySQL
Conf *config.GatewayConfig
}
var xnAPISServerAPI = XNAPISServerAPIResource{}
func GetXNAPISServerAPIResource() *XNAPISServerAPIResource {
return &xnAPISServerAPI
}
func (a *XNAPISServerAPIResource) InitActions() {
a.ActionsV1 = append(a.ActionsV1, GetAPIV1Action()...)
}
type DistTaskServerAPIResource struct {
ActionsV1 []*httpserver.Action
MySQL disttask.MySQL
Conf *config.GatewayConfig
}
var distTaskServerAPI = DistTaskServerAPIResource{}
func GetDistTaskServerAPIResource() *DistTaskServerAPIResource {
return &distTaskServerAPI
}
func (a *DistTaskServerAPIResource) InitActions() {
a.ActionsV1 = append(a.ActionsV1, GetAPIV1Action()...)
}