-
Notifications
You must be signed in to change notification settings - Fork 375
/
define.go
81 lines (71 loc) · 2.86 KB
/
define.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
79
80
81
// Copyright (c) 2021 Terminus, Inc.
//
// This program is free software: you can use, redistribute, and/or modify
// it under the terms of the GNU Affero General Public License, version 3
// or later ("AGPL"), as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package pipelinesvc
import (
"github.com/erda-project/erda-proto-go/core/pipeline/cms/pb"
"github.com/erda-project/erda/bundle"
"github.com/erda-project/erda/modules/pipeline/dbclient"
"github.com/erda-project/erda/modules/pipeline/pipengine"
"github.com/erda-project/erda/modules/pipeline/services/actionagentsvc"
"github.com/erda-project/erda/modules/pipeline/services/appsvc"
"github.com/erda-project/erda/modules/pipeline/services/crondsvc"
"github.com/erda-project/erda/modules/pipeline/services/extmarketsvc"
"github.com/erda-project/erda/modules/pipeline/services/permissionsvc"
"github.com/erda-project/erda/modules/pipeline/services/pipelinecronsvc"
"github.com/erda-project/erda/modules/pipeline/services/queuemanage"
"github.com/erda-project/erda/modules/pkg/websocket"
"github.com/erda-project/erda/pkg/jsonstore"
"github.com/erda-project/erda/pkg/jsonstore/etcd"
)
type PipelineSvc struct {
appSvc *appsvc.AppSvc
crondSvc *crondsvc.CrondSvc
actionAgentSvc *actionagentsvc.ActionAgentSvc
extMarketSvc *extmarketsvc.ExtMarketSvc
pipelineCronSvc *pipelinecronsvc.PipelineCronSvc
permissionSvc *permissionsvc.PermissionSvc
queueManage *queuemanage.QueueManage
dbClient *dbclient.Client
bdl *bundle.Bundle
publisher *websocket.Publisher
engine *pipengine.Engine
js jsonstore.JsonStore
etcdctl *etcd.Store
// providers
cmsService pb.CmsServiceServer
}
func New(appSvc *appsvc.AppSvc, crondSvc *crondsvc.CrondSvc,
actionAgentSvc *actionagentsvc.ActionAgentSvc, extMarketSvc *extmarketsvc.ExtMarketSvc,
pipelineCronSvc *pipelinecronsvc.PipelineCronSvc, permissionSvc *permissionsvc.PermissionSvc,
queueManage *queuemanage.QueueManage,
dbClient *dbclient.Client, bdl *bundle.Bundle, publisher *websocket.Publisher,
engine *pipengine.Engine, js jsonstore.JsonStore, etcd *etcd.Store) *PipelineSvc {
s := PipelineSvc{}
s.appSvc = appSvc
s.crondSvc = crondSvc
s.actionAgentSvc = actionAgentSvc
s.extMarketSvc = extMarketSvc
s.pipelineCronSvc = pipelineCronSvc
s.permissionSvc = permissionSvc
s.queueManage = queueManage
s.dbClient = dbClient
s.bdl = bdl
s.publisher = publisher
s.engine = engine
s.js = js
s.etcdctl = etcd
return &s
}
func (s *PipelineSvc) WithCmsService(cmsService pb.CmsServiceServer) {
s.cmsService = cmsService
}