This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
100 lines (84 loc) · 2.93 KB
/
types.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package types
type Version struct {
Ref string `json:"ref"`
}
type CheckRequest struct {
Source Source `json:"source"`
Version Version `json:"version"`
}
type CheckResponse []Version
type InRequest struct {
Source Source `json:"source"`
Version Version `json:"version"`
Params InParams `json:"params"`
}
type InParams struct {
Product string `json:"product"`
Stemcell bool `json:"stemcell"`
Unpack bool `json:"unpack"`
}
type InResponse struct {
Version Version `json:"version"`
Metadata Metadata `json:"metadata"`
}
type OutRequest struct {
Source Source `json:"source"`
Version Version `json:"version"`
}
type OutResponse struct {
Version Version `json:"version"`
Metadata Metadata `json:"metadata"`
}
type Metadata []MetadataField
type MetadataField struct {
Name string `json:"name"`
Value string `json:"value"`
}
type Source struct {
ConfigProvider ConfigProviderEnum `json:"config_provider"`
FileProvider FileProviderEnum `json:"file_provider"`
VersionRoot string `json:"version_root"`
URI string `json:"uri"`
Branch string `json:"branch"`
PrivateKey string `json:"private_key"`
Username string `json:"username"`
Password string `json:"password"`
Path string `json:"path"`
PivnetToken string `json:"pivnet_token"`
Bucket string `json:"bucket"`
AccessKeyID string `json:"access_key_id"`
SecretAccessKey string `json:"secret_access_key"`
RegionName string `json:"region_name"`
Endpoint string `json:"endpoint"`
DisableSSL bool `json:"disable_ssl"`
SkipSSLVerification bool `json:"skip_ssl_verification"`
ServerSideEncryption string `json:"server_side_encryption"`
UseV2Signing bool `json:"use_v2_signing"`
BaseHTTPURI string `json:"base_http_uri"`
}
type ConfigProviderEnum string
const (
ConfigProviderUnspecified ConfigProviderEnum = ""
ConfigProviderGit ConfigProviderEnum = "git"
)
type FileProviderEnum string
const (
FileProviderUnspecified FileProviderEnum = ""
FileProviderPivnet FileProviderEnum = "pivnet"
FileProviderS3 FileProviderEnum = "s3"
FileProviderHTTP FileProviderEnum = "http"
)
type VersionInfo struct {
Version string `yaml:"version"`
PivotalProduct string `yaml:"product"`
FilePattern string `yaml:"file_pattern"`
StemcellVersion string `yaml:"stemcell_version"`
StemcellFilePattern string `yaml:"stemcell_file_pattern"`
StemcellProduct string `yaml:"stemcell_product"`
}
func (v *VersionInfo) StemcellProductPath() string {
if v.StemcellProduct == "" {
return "stemcells"
}
return v.StemcellProduct
}