-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathprimer.go
More file actions
129 lines (105 loc) · 2.61 KB
/
primer.go
File metadata and controls
129 lines (105 loc) · 2.61 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package primer
import (
"github.com/ActiveState/cli/internal/analytics"
"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/prompt"
"github.com/ActiveState/cli/internal/subshell"
"github.com/ActiveState/cli/internal/svcctl"
"github.com/ActiveState/cli/pkg/platform/authentication"
"github.com/ActiveState/cli/pkg/platform/model"
"github.com/ActiveState/cli/pkg/project"
"github.com/ActiveState/cli/pkg/projectfile"
)
type Values struct {
project *project.Project
projectfile *projectfile.Project
output output.Outputer
auth *authentication.Auth
prompt prompt.Prompter
subshell subshell.SubShell
config *config.Instance
ipComm svcctl.IPCommunicator
svcModel *model.SvcModel
analytics analytics.Dispatcher
}
func New(
project *project.Project, output output.Outputer, auth *authentication.Auth, prompt prompt.Prompter,
subshell subshell.SubShell, config *config.Instance,
ipComm svcctl.IPCommunicator, svcModel *model.SvcModel, an analytics.Dispatcher) *Values {
v := &Values{
output: output,
auth: auth,
prompt: prompt,
subshell: subshell,
config: config,
ipComm: ipComm,
svcModel: svcModel,
analytics: an,
}
if project != nil {
v.project = project
v.projectfile = project.Source()
}
return v
}
type Projecter interface {
Project() *project.Project
}
type Projectfiler interface {
Projectfile() *projectfile.Project
}
type Outputer interface {
Output() output.Outputer
}
type Auther interface {
Auth() *authentication.Auth
}
type Prompter interface {
Prompt() prompt.Prompter
}
type Configurer interface {
Config() *config.Instance
}
type IPCommunicator interface {
IPComm() svcctl.IPCommunicator
}
type SvcModeler interface {
SvcModel() *model.SvcModel
}
type Analyticer interface {
Analytics() analytics.Dispatcher
}
type Subsheller interface {
Subshell() subshell.SubShell
}
func (v *Values) Project() *project.Project {
return v.project
}
func (v *Values) Projectfile() *projectfile.Project {
return v.projectfile
}
func (v *Values) Output() output.Outputer {
return v.output
}
func (v *Values) Auth() *authentication.Auth {
return v.auth
}
func (v *Values) Prompt() prompt.Prompter {
return v.prompt
}
func (v *Values) Subshell() subshell.SubShell {
return v.subshell
}
func (v *Values) IPComm() svcctl.IPCommunicator {
return v.ipComm
}
func (v *Values) SvcModel() *model.SvcModel {
return v.svcModel
}
func (v *Values) Config() *config.Instance {
return v.config
}
func (v *Values) Analytics() analytics.Dispatcher {
return v.analytics
}