-
Notifications
You must be signed in to change notification settings - Fork 1
/
Yaml.go
119 lines (96 loc) · 2.27 KB
/
Yaml.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package cdk8s
import (
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
_init_ "github.com/cdk8s-team/cdk8s-core-go/cdk8s/jsii"
)
// YAML utilities.
type Yaml interface {
}
// The jsii proxy struct for Yaml
type jsiiProxy_Yaml struct {
_ byte // padding
}
// Deprecated: use `stringify(doc[, doc, ...])`
func Yaml_FormatObjects(docs *[]interface{}) *string {
_init_.Initialize()
if err := validateYaml_FormatObjectsParameters(docs); err != nil {
panic(err)
}
var returns *string
_jsii_.StaticInvoke(
"cdk8s.Yaml",
"formatObjects",
[]interface{}{docs},
&returns,
)
return returns
}
// Downloads a set of YAML documents (k8s manifest for example) from a URL or a file and returns them as javascript objects.
//
// Empty documents are filtered out.
//
// Returns: an array of objects, each represents a document inside the YAML.
func Yaml_Load(urlOrFile *string) *[]interface{} {
_init_.Initialize()
if err := validateYaml_LoadParameters(urlOrFile); err != nil {
panic(err)
}
var returns *[]interface{}
_jsii_.StaticInvoke(
"cdk8s.Yaml",
"load",
[]interface{}{urlOrFile},
&returns,
)
return returns
}
// Saves a set of objects as a multi-document YAML file.
func Yaml_Save(filePath *string, docs *[]interface{}) {
_init_.Initialize()
if err := validateYaml_SaveParameters(filePath, docs); err != nil {
panic(err)
}
_jsii_.StaticInvokeVoid(
"cdk8s.Yaml",
"save",
[]interface{}{filePath, docs},
)
}
// Stringify a document (or multiple documents) into YAML.
//
// We convert undefined values to null, but ignore any documents that are
// undefined.
//
// Returns: a YAML string. Multiple docs are separated by `---`.
func Yaml_Stringify(docs ...interface{}) *string {
_init_.Initialize()
args := []interface{}{}
for _, a := range docs {
args = append(args, a)
}
var returns *string
_jsii_.StaticInvoke(
"cdk8s.Yaml",
"stringify",
args,
&returns,
)
return returns
}
// Saves a set of YAML documents into a temp file (in /tmp).
//
// Returns: the path to the temporary file.
func Yaml_Tmp(docs *[]interface{}) *string {
_init_.Initialize()
if err := validateYaml_TmpParameters(docs); err != nil {
panic(err)
}
var returns *string
_jsii_.StaticInvoke(
"cdk8s.Yaml",
"tmp",
[]interface{}{docs},
&returns,
)
return returns
}