mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
703f7a7666
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
28 lines
420 B
Go
28 lines
420 B
Go
package fileinfo
|
|
|
|
import (
|
|
"io/fs"
|
|
|
|
"github.com/kyverno/kyverno/ext/file"
|
|
)
|
|
|
|
func IsYaml(info fs.FileInfo) bool {
|
|
if info.IsDir() {
|
|
return false
|
|
}
|
|
return file.IsYaml(info.Name())
|
|
}
|
|
|
|
func IsJson(info fs.FileInfo) bool {
|
|
if info.IsDir() {
|
|
return false
|
|
}
|
|
return file.IsJson(info.Name())
|
|
}
|
|
|
|
func IsYamlOrJson(info fs.FileInfo) bool {
|
|
if info.IsDir() {
|
|
return false
|
|
}
|
|
return file.IsYamlOrJson(info.Name())
|
|
}
|