utils

package
v0.0.0-...-7c77b90 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 HandleLogicalCloudError

func HandleLogicalCloudError(err string, w *http.ResponseWriter)

HandleLogicalCloudError is used to handle error for Logical Cloud

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