Documentation ¶
Index ¶
- func ConvertMapInterfaceMapString(v interface{}) interface{}
- func CreateK8sResource(client dynamic.Interface, group, version, resource string, object interface{}, ...) error
- func CreateNamespace(client dynamic.Interface, namespace string) error
- func DeleteK8sResource(client dynamic.Interface, group, version, resource, namespace, name string) error
- func FlattenMap(prefix string, src map[string]interface{}, dest map[string]interface{})
- func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
- func ToMapStringInterface(mp interface{}) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMapInterfaceMapString ¶
func ConvertMapInterfaceMapString(v interface{}) interface{}
ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{}
It will also convert []interface{} => []string
func CreateK8sResource ¶
func CreateK8sResource( client dynamic.Interface, group, version, resource string, object interface{}, force bool, ) error
CreateK8sResource takes a dynamic client and resource info and tries to create that resource.
If a resource already exists and has the label controller set to "meshery" then it will try to update the resource.
If a resource exists but does not have the label then the function will return an error however if force parameter is set to true then it will replace that resource with a new resource with the appropriate labels
It will add labels to the resources:
"controller": "meshery" "source" : "pattern"
func DeleteK8sResource ¶
func DeleteK8sResource( client dynamic.Interface, group, version, resource, namespace, name string, ) error
DeleteK8sResouce deletes the given kubernetes resource
func FlattenMap ¶ added in v0.5.46
FlattenMap flattens the given map and writes the flattened map in the dest
func RecursiveCastMapStringInterfaceToMapStringInterface ¶
func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}
func ToMapStringInterface ¶ added in v0.5.46
func ToMapStringInterface(mp interface{}) map[string]interface{}
ToMapStringInterface takes in data of type interface and returns a map[string]interface{} from that data
If the conversion fails then returns an empty map
Types ¶
This section is empty.