forked from cloudfoundry/executor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresource_converters.go
More file actions
31 lines (26 loc) · 812 Bytes
/
Copy pathresource_converters.go
File metadata and controls
31 lines (26 loc) · 812 Bytes
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
package executor
import "code.cloudfoundry.org/bbs/models"
func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable {
out := make([]models.EnvironmentVariable, len(envVars))
for i, val := range envVars {
out[i].Name = val.Name
out[i].Value = val.Value
}
return out
}
func EnvironmentVariablesFromModel(envVars []*models.EnvironmentVariable) []EnvironmentVariable {
out := make([]EnvironmentVariable, len(envVars))
for i, val := range envVars {
out[i].Name = val.Name
out[i].Value = val.Value
}
return out
}
func VolumeMountedFilesFromModel(envFiles []*models.File) []VolumeMountedFiles {
out := make([]VolumeMountedFiles, len(envFiles))
for i, envFile := range envFiles {
out[i].Path = envFile.Path
out[i].Content = envFile.Content
}
return out
}