-
Notifications
You must be signed in to change notification settings - Fork 0
/
appdefs.go
51 lines (44 loc) · 1.58 KB
/
appdefs.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
/*
Kubermatic Enterprise Read-Only License
Version 1.0 ("KERO-1.0”)
Copyright © 2023 Kubermatic GmbH
1. You may only view, read and display for studying purposes the source
code of the software licensed under this license, and, to the extent
explicitly provided under this license, the binary code.
2. Any use of the software which exceeds the foregoing right, including,
without limitation, its execution, compilation, copying, modification
and distribution, is expressly prohibited.
3. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
END OF TERMS AND CONDITIONS
*/
package appdefs
import (
"embed"
"io/fs"
)
//go:embed application-definitions
var f embed.FS
func GetAppDefFiles() ([]fs.File, error) {
dirname := "application-definitions"
files := []fs.File{}
entries, err := f.ReadDir(dirname)
if err != nil {
return nil, err
}
for _, entry := range entries {
if !entry.IsDir() {
file, err := f.Open(dirname + "/" + entry.Name())
if err != nil {
return nil, err
}
files = append(files, file)
}
}
return files, nil
}