utils

package
v0.0.0-...-bb2f907 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainCluster

func ContainCluster(clusterProvider, clusterName string, lcClusterRefs []common.Cluster) bool

func ConvertType

func ConvertType(in, out interface{}) error

func EnsureDirectory

func EnsureDirectory(f string) error

EnsureDirectory makes sure that the directories specified in the path exist If not, it will create them, if possible.

func ExtractTarBall

func ExtractTarBall(r io.Reader) (string, error)

ExtractTarBall provides functionality to extract a tar.gz file into a temporary location for later use. It returns the path to the new location

func HasDuplication

func HasDuplication(list []string) bool

func HasIntersection

func HasIntersection(list1 []string, list2 []string) bool

func ListDifference

func ListDifference(list1 []string, list2 []string) []string

func MapKeys

func MapKeys(m map[string]interface{}) []string

func StructToMap

func StructToMap(s interface{}) (map[string]interface{}, error)

Types

type ListYamlStruct

type ListYamlStruct struct {
	APIVersion string `yaml:"apiVersion,omitempty"`
	Kind       string `yaml:"kind,omitempty"`
	// contains filtered or unexported fields
}

ListYamlStruct is applied when the kind is list

type YamlStruct

type YamlStruct struct {
	APIVersion string `yaml:"apiVersion,omitempty"`
	Kind       string `yaml:"kind,omitempty"`
	Metadata   struct {
		Name      string `yaml:"name,omitempty"`
		Namespace string `yaml:"namespace,omitempty"`
		Labels    struct {
			RouterDeisIoRoutable string `yaml:"router.deis.io/routable,omitempty"`
		} `yaml:"labels"`
		Annotations struct {
			RouterDeisIoDomains string `yaml:"router.deis.io/domains,omitempty"`
		} `yaml:"annotations,omitempty"`
	} `yaml:"metadata,omitempty"`
	Spec struct {
		Type     string `yaml:"type,omitempty"`
		Selector struct {
			App string `yaml:"app,omitempty"`
		} `yaml:"selector,omitempty"`
		Ports []struct {
			Name     string `yaml:"name,omitempty"`
			Port     int    `yaml:"port,omitempty"`
			NodePort int    `yaml:"nodePort,omitempty"`
		} `yaml:"ports"`
	} `yaml:"spec"`
}

YamlStruct represents normal parameters in a manifest file. Over the course of time, Pls add more parameters as and when you require.

func ExtractYamlParameters

func ExtractYamlParameters(f string) (YamlStruct, error)

ExtractYamlParameters is a method which takes in the abolute path of a manifest file and returns a struct accordingly

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL