Initial v1.0.0 commit

This commit is contained in:
Jakub Vavřík
2021-01-28 17:37:47 +01:00
commit 1481d27782
4164 changed files with 1264675 additions and 0 deletions

59
vendor/github.com/rancher/wrangler/pkg/data/data.go generated vendored Normal file
View File

@@ -0,0 +1,59 @@
package data
import (
"github.com/rancher/wrangler/pkg/data/convert"
)
type List []map[string]interface{}
type Object map[string]interface{}
func New() Object {
return map[string]interface{}{}
}
func (o Object) Map(names ...string) Object {
v := GetValueN(o, names...)
m := convert.ToMapInterface(v)
return m
}
func (o Object) Slice(names ...string) (result []Object) {
v := GetValueN(o, names...)
for _, item := range convert.ToInterfaceSlice(v) {
result = append(result, convert.ToMapInterface(item))
}
return
}
func (o Object) Values() (result []Object) {
for k := range o {
result = append(result, o.Map(k))
}
return
}
func (o Object) String(names ...string) string {
v := GetValueN(o, names...)
return convert.ToString(v)
}
func (o Object) StringSlice(names ...string) []string {
v := GetValueN(o, names...)
return convert.ToStringSlice(v)
}
func (o Object) Set(key string, obj interface{}) {
if o == nil {
return
}
o[key] = obj
}
func (o Object) SetNested(obj interface{}, key ...string) {
PutValue(o, obj, key...)
}
func (o Object) Bool(key ...string) bool {
return convert.ToBool(GetValueN(o, key...))
}