-
-
Notifications
You must be signed in to change notification settings - Fork 955
/
provider_installation.go
48 lines (37 loc) · 1.18 KB
/
provider_installation.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
package cliconfig
type ProviderInstallationFilesystemMirror struct {
Location string `hcl:"path,attr"`
Include *[]string `hcl:"include,attr"`
Exclude *[]string `hcl:"exclude,attr"`
}
func NewProviderInstallationFilesystemMirror(location string, include, exclude []string) *ProviderInstallationFilesystemMirror {
res := &ProviderInstallationFilesystemMirror{
Location: location,
}
if len(include) > 0 {
res.Include = &include
}
if len(exclude) > 0 {
res.Exclude = &exclude
}
return res
}
type ProviderInstallationDirect struct {
Include *[]string `hcl:"include,attr"`
Exclude *[]string `hcl:"exclude,attr"`
}
func NewProviderInstallationDirect(include, exclude []string) *ProviderInstallationDirect {
res := new(ProviderInstallationDirect)
if len(include) > 0 {
res.Include = &include
}
if len(exclude) > 0 {
res.Exclude = &exclude
}
return res
}
// ProviderInstallation is the structure of the "provider_installation" nested block within the CLI configuration.
type ProviderInstallation struct {
FilesystemMirror *ProviderInstallationFilesystemMirror `hcl:"filesystem_mirror,block"`
Direct *ProviderInstallationDirect `hcl:"direct,block"`
}