-
Notifications
You must be signed in to change notification settings - Fork 92
/
template.go
80 lines (67 loc) · 1.88 KB
/
template.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
package tmpl
import (
"testing"
"github.com/linode/terraform-provider-linode/linode/acceptance"
objkey "github.com/linode/terraform-provider-linode/linode/objkey/tmpl"
)
type TemplateData struct {
Key objkey.TemplateData
Label string
ACL string
CORSEnabled bool
Versioning bool
Cert string
PrivKey string
}
func Basic(t *testing.T, label string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_basic", TemplateData{Label: label})
}
func Updates(t *testing.T, label string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_updates", TemplateData{Label: label})
}
func Access(t *testing.T, label, acl string, cors bool) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_access", TemplateData{
Label: label,
ACL: acl,
CORSEnabled: cors,
})
}
func Cert(t *testing.T, label, cert, privKey string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_cert", TemplateData{
Label: label,
Cert: cert,
PrivKey: privKey,
})
}
func Versioning(t *testing.T, label, keyName string, versioning bool) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_versioning", TemplateData{
Key: objkey.TemplateData{Label: keyName},
Label: label,
Versioning: versioning,
})
}
func LifeCycle(t *testing.T, label, keyName string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_lifecycle", TemplateData{
Key: objkey.TemplateData{Label: keyName},
Label: label,
})
}
func LifeCycleUpdates(t *testing.T, label, keyName string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_lifecycle_updates", TemplateData{
Key: objkey.TemplateData{Label: keyName},
Label: label,
})
}
func DataBasic(t *testing.T, label string) string {
return acceptance.ExecuteTemplate(t,
"object_bucket_data_basic", TemplateData{
Label: label,
})
}