-
Notifications
You must be signed in to change notification settings - Fork 17
/
DockerIgnoreStrategy.go
171 lines (141 loc) · 4.38 KB
/
DockerIgnoreStrategy.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package awscdk
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import cdk "github.com/aws/aws-cdk-go/awscdk"
//
// dockerIgnoreStrategy := cdk.NewDockerIgnoreStrategy(jsii.String("absoluteRootPath"), []*string{
// jsii.String("patterns"),
// })
//
type DockerIgnoreStrategy interface {
IgnoreStrategy
// Adds another pattern.
Add(pattern *string)
// Determines whether a given file path should be ignored or not.
//
// Returns: `true` if the file should be ignored.
Ignores(absoluteFilePath *string) *bool
}
// The jsii proxy struct for DockerIgnoreStrategy
type jsiiProxy_DockerIgnoreStrategy struct {
jsiiProxy_IgnoreStrategy
}
func NewDockerIgnoreStrategy(absoluteRootPath *string, patterns *[]*string) DockerIgnoreStrategy {
_init_.Initialize()
if err := validateNewDockerIgnoreStrategyParameters(absoluteRootPath, patterns); err != nil {
panic(err)
}
j := jsiiProxy_DockerIgnoreStrategy{}
_jsii_.Create(
"aws-cdk-lib.DockerIgnoreStrategy",
[]interface{}{absoluteRootPath, patterns},
&j,
)
return &j
}
func NewDockerIgnoreStrategy_Override(d DockerIgnoreStrategy, absoluteRootPath *string, patterns *[]*string) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.DockerIgnoreStrategy",
[]interface{}{absoluteRootPath, patterns},
d,
)
}
// Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
//
// Returns: `DockerIgnorePattern` associated with the given patterns.
func DockerIgnoreStrategy_Docker(absoluteRootPath *string, patterns *[]*string) DockerIgnoreStrategy {
_init_.Initialize()
if err := validateDockerIgnoreStrategy_DockerParameters(absoluteRootPath, patterns); err != nil {
panic(err)
}
var returns DockerIgnoreStrategy
_jsii_.StaticInvoke(
"aws-cdk-lib.DockerIgnoreStrategy",
"docker",
[]interface{}{absoluteRootPath, patterns},
&returns,
)
return returns
}
// Creates an IgnoreStrategy based on the `ignoreMode` and `exclude` in a `CopyOptions`.
//
// Returns: `IgnoreStrategy` based on the `CopyOptions`.
func DockerIgnoreStrategy_FromCopyOptions(options *CopyOptions, absoluteRootPath *string) IgnoreStrategy {
_init_.Initialize()
if err := validateDockerIgnoreStrategy_FromCopyOptionsParameters(options, absoluteRootPath); err != nil {
panic(err)
}
var returns IgnoreStrategy
_jsii_.StaticInvoke(
"aws-cdk-lib.DockerIgnoreStrategy",
"fromCopyOptions",
[]interface{}{options, absoluteRootPath},
&returns,
)
return returns
}
// Ignores file paths based on the [`.gitignore specification`](https://git-scm.com/docs/gitignore).
//
// Returns: `GitIgnorePattern` associated with the given patterns.
func DockerIgnoreStrategy_Git(absoluteRootPath *string, patterns *[]*string) GitIgnoreStrategy {
_init_.Initialize()
if err := validateDockerIgnoreStrategy_GitParameters(absoluteRootPath, patterns); err != nil {
panic(err)
}
var returns GitIgnoreStrategy
_jsii_.StaticInvoke(
"aws-cdk-lib.DockerIgnoreStrategy",
"git",
[]interface{}{absoluteRootPath, patterns},
&returns,
)
return returns
}
// Ignores file paths based on simple glob patterns.
//
// Returns: `GlobIgnorePattern` associated with the given patterns.
func DockerIgnoreStrategy_Glob(absoluteRootPath *string, patterns *[]*string) GlobIgnoreStrategy {
_init_.Initialize()
if err := validateDockerIgnoreStrategy_GlobParameters(absoluteRootPath, patterns); err != nil {
panic(err)
}
var returns GlobIgnoreStrategy
_jsii_.StaticInvoke(
"aws-cdk-lib.DockerIgnoreStrategy",
"glob",
[]interface{}{absoluteRootPath, patterns},
&returns,
)
return returns
}
func (d *jsiiProxy_DockerIgnoreStrategy) Add(pattern *string) {
if err := d.validateAddParameters(pattern); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
d,
"add",
[]interface{}{pattern},
)
}
func (d *jsiiProxy_DockerIgnoreStrategy) Ignores(absoluteFilePath *string) *bool {
if err := d.validateIgnoresParameters(absoluteFilePath); err != nil {
panic(err)
}
var returns *bool
_jsii_.Invoke(
d,
"ignores",
[]interface{}{absoluteFilePath},
&returns,
)
return returns
}