utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertYAMLtoJSONHelper

func ConvertYAMLtoJSONHelper(i interface{}) interface{}

ConvertYAMLtoJSONHelper converts the yaml to json recursively

func CopyFile

func CopyFile(source, target string)

func CreateCopyKustomizeNamespace

func CreateCopyKustomizeNamespace(namespace string)

CreateCopyKustomizeNamespace create copy of `/deploy/namespaced` folder with kustomization file for overriding namespace

func GenUniqID

func GenUniqID() string

func JSONToYAMLConvert

func JSONToYAMLConvert(cnfg interface{}) []byte

func LoadUserProjectConfig

func LoadUserProjectConfig(path string) *v1.AtlasProject

LoadUserProjectConfig load configuration into object

func ReadInYAMLFileAndConvert

func ReadInYAMLFileAndConvert(pathToYamlFile string, cnfg interface{}) interface{}

ReadInYAMLFileAndConvert reads in the yaml file given by the path given

func SaveToFile

func SaveToFile(path string, data []byte)

Types

type AC

type AC struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec            ClusterSpec        `json:"spec,omitempty"`
}

func LoadUserClusterConfig

func LoadUserClusterConfig(path string) AC

LoadUserClusterConfig load configuration into object

func (*AC) ClusterFileName

func (ac *AC) ClusterFileName() string

func (*AC) GetClusterNameResource

func (ac *AC) GetClusterNameResource() string

type ClusterSpec

type ClusterSpec v1.AtlasClusterSpec

type ISpec

type ISpec interface {
	ProjectName(string) ISpec
	SecretRef(string) ISpec
	// TODO WhiteIP
	CompleteK8sConfig(string) []byte
}

func NewProject

func NewProject() ISpec

type ProjectSpec

type ProjectSpec v1.AtlasProjectSpec

func (ProjectSpec) CompleteK8sConfig

func (s ProjectSpec) CompleteK8sConfig(k8sname string) []byte

func (*ProjectSpec) ProjectName

func (s *ProjectSpec) ProjectName(name string) ISpec

func (*ProjectSpec) SecretRef

func (s *ProjectSpec) SecretRef(name string) ISpec

Jump to

Keyboard shortcuts

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