-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcmd.go
More file actions
133 lines (123 loc) · 3.91 KB
/
cmd.go
File metadata and controls
133 lines (123 loc) · 3.91 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
130
131
132
133
package cmd
import (
"fmt"
"io"
"time"
"github.com/deis/controller-sdk-go/api"
)
// Commander is interface definition for running commands
type Commander interface {
AppCreate(string, string, string, bool) error
AppsList(int) error
AppInfo(string) error
AppOpen(string) error
AppLogs(string, int) error
AppRun(string, string) error
AppDestroy(string, string) error
AppTransfer(string, string) error
AutoscaleList(string) error
AutoscaleSet(string, string, int, int, int) error
AutoscaleUnset(string, string) error
Register(string, string, string, string, bool) error
Login(string, string, string, bool) error
Logout() error
Passwd(string, string, string) error
Cancel(string, string, bool) error
Whoami(bool) error
Regenerate(string, bool) error
BuildsList(string, int) error
BuildsCreate(string, string, string) error
CertsList(int, time.Time) error
CertAdd(string, string, string) error
CertRemove(string) error
CertInfo(string) error
CertAttach(string, string) error
CertDetach(string, string) error
ConfigList(string, bool) error
ConfigSet(string, []string) error
ConfigUnset(string, []string) error
ConfigPull(string, bool, bool) error
ConfigPush(string, string) error
DomainsList(string, int) error
DomainsAdd(string, string) error
DomainsRemove(string, string) error
GitRemote(string, string, bool) error
GitRemove(string) error
HealthchecksList(string, string) error
HealthchecksSet(string, string, string, *api.Healthcheck) error
HealthchecksUnset(string, string, []string) error
KeysList(int) error
KeyRemove(string) error
KeyAdd(string) error
LimitsList(string) error
LimitsSet(string, []string, string) error
LimitsUnset(string, []string, string) error
MaintenanceInfo(string) error
MaintenanceEnable(string) error
MaintenanceDisable(string) error
PermsList(string, bool, int) error
PermCreate(string, string, bool) error
PermDelete(string, string, bool) error
PsList(string, int) error
PsScale(string, []string) error
PsRestart(string, string) error
RegistryList(string) error
RegistrySet(string, []string) error
RegistryUnset(string, []string) error
ReleasesList(string, int) error
ReleasesInfo(string, int) error
ReleasesRollback(string, int) error
RoutingInfo(string) error
RoutingEnable(string) error
RoutingDisable(string) error
ShortcutsList() error
TagsList(string) error
TagsSet(string, []string) error
TagsUnset(string, []string) error
TLSInfo(string) error
TLSEnable(string) error
TLSDisable(string) error
UsersList(results int) error
WhitelistAdd(string, string) error
WhitelistList(string) error
WhitelistRemove(string, string) error
Println(...interface{}) (int, error)
Print(...interface{}) (int, error)
Printf(string, ...interface{}) (int, error)
PrintErrln(...interface{}) (int, error)
PrintErr(...interface{}) (int, error)
PrintErrf(string, ...interface{}) (int, error)
Version(bool) error
}
// DeisCmd is an implementation of Commander.
type DeisCmd struct {
ConfigFile string
Warned bool
WOut io.Writer
WErr io.Writer
WIn io.Reader
}
// Println prints a line to an output writer.
func (d *DeisCmd) Println(a ...interface{}) (n int, err error) {
return fmt.Fprintln(d.WOut, a...)
}
// Print prints a line to an output writer.
func (d *DeisCmd) Print(a ...interface{}) (n int, err error) {
return fmt.Fprint(d.WOut, a...)
}
// Printf prints a line to an error writer.
func (d *DeisCmd) Printf(s string, a ...interface{}) (n int, err error) {
return fmt.Fprintf(d.WOut, s, a...)
}
// PrintErrln prints a line to an error writer.
func (d *DeisCmd) PrintErrln(a ...interface{}) (n int, err error) {
return fmt.Fprintln(d.WErr, a...)
}
// PrintErr prints a line to an error writer.
func (d *DeisCmd) PrintErr(a ...interface{}) (n int, err error) {
return fmt.Fprint(d.WErr, a...)
}
// PrintErrf prints a line to an error writer.
func (d *DeisCmd) PrintErrf(s string, a ...interface{}) (n int, err error) {
return fmt.Fprintf(d.WErr, s, a...)
}