forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.go
59 lines (51 loc) · 1.03 KB
/
manifest.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
package manifest
import (
biproperty "github.com/cloudfoundry/bosh-utils/property"
)
type Manifest struct {
Name string
Template ReleaseJobRef
Properties biproperty.Map
Mbus string
Cert Certificate
Registry Registry
}
type Certificate struct {
CA string
}
type ReleaseJobRef struct {
Name string
Release string
}
type Registry struct {
Username string
Password string
Host string
Port int
SSHTunnel SSHTunnel
}
func (r Registry) IsEmpty() bool {
return r == Registry{}
}
type SSHTunnel struct {
User string
Host string
Port int
Password string
PrivateKey string `yaml:"private_key"`
}
func (m *Manifest) PopulateRegistry(username string, password string, host string, port int, sshTunnel SSHTunnel) {
m.Properties["registry"] = biproperty.Map{
"host": host,
"port": port,
"username": username,
"password": password,
}
m.Registry = Registry{
Username: username,
Password: password,
Host: host,
Port: port,
SSHTunnel: sshTunnel,
}
}