This repository has been archived by the owner on Jul 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
user.go
54 lines (50 loc) · 1.51 KB
/
user.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
package config
import (
"github.com/enaml-ops/omg-cli/utils"
"gopkg.in/urfave/cli.v2"
)
func RequiredUserFlags() []string {
return []string{
"nats-user",
"mysql-bootstrap-username",
"cc-staging-upload-user",
"db-ccdb-username",
"db-uaa-username",
"mysql-proxy-api-username",
"db-console-username",
"router-user",
"cc-internal-api-user",
"db-autoscale-username",
"db-notifications-username",
}
}
func NewUser(c *cli.Context) User {
return User{
NATSUser: c.String("nats-user"),
MySQLBootstrapUser: c.String("mysql-bootstrap-username"),
StagingUploadUser: c.String("cc-staging-upload-user"),
CCDBUsername: c.String("db-ccdb-username"),
UAADBUserName: c.String("db-uaa-username"),
AutoscaleDBUser: c.String("db-autoscale-username"),
MySQLProxyAPIUsername: c.String("mysql-proxy-api-username"),
ConsoleDBUserName: c.String("db-console-username"),
RouterUser: c.String("router-user"),
CCInternalAPIUser: c.String("cc-internal-api-user"),
AutoscaleBrokerUser: utils.NewPassword(16),
NotificationsDBUser: c.String("db-notifications-username"),
}
}
type User struct {
CCInternalAPIUser string
MySQLBootstrapUser string
NATSUser string
StagingUploadUser string
CCDBUsername string
ConsoleDBUserName string
MySQLProxyAPIUsername string
UAADBUserName string
AutoscaleDBUser string
RouterUser string
AutoscaleBrokerUser string
NotificationsDBUser string
}