handler

package
v0.0.0-...-d4d4b81 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyZipItems

func CopyZipItems(file *zip.File, extractPath string, chartsPath string) error

CopyZipItems is used to copy the content from the extracted zip file to the ChaosHub directory

func DownloadRemoteHub

func DownloadRemoteHub(hubDetails model.CreateRemoteChaosHub) error

DownloadRemoteHub is used to download a remote hub from the url provided by the user

func GetCSVData

func GetCSVData(request model.ExperimentRequest) string

GetCSVData returns the ChartServiceYAML details according to the given filetype

func GetChartsData

func GetChartsData(ChartsPath string) ([]*model.Chart, error)

GetChartsData is used to get details of charts like experiments.

func GetChartsPath

func GetChartsPath(chartsInput model.CloningInput) string

GetChartsPath is used to construct path for given chart.

func GetExperimentData

func GetExperimentData(experimentFilePath string) (*model.Chart, error)

GetExperimentData is used for getting details of selected Experiment path

func GetExperimentYAMLPath

func GetExperimentYAMLPath(request model.ExperimentRequest) string

GetExperimentYAMLPath is used to construct path for given experiment/engine.

func GetPredefinedExperimentManifest

func GetPredefinedExperimentManifest(request model.ExperimentRequest) string

GetPredefinedExperimentManifest is used to construct path for given chartsversion.yaml.

func IsFileExisting

func IsFileExisting(path string) (bool, error)

func ListPredefinedWorkflowDetails

func ListPredefinedWorkflowDetails(hubName string, projectID string) ([]*model.PredefinedWorkflowList, error)

ListPredefinedWorkflowDetails reads the workflow directory for all the predefined experiments and returns the csv, workflow manifest and workflow name

func ReadExperimentYAMLFile

func ReadExperimentYAMLFile(path string) (string, error)

ReadExperimentYAMLFile is used for reading experiment/engine file from given path

func SyncRemoteRepo

func SyncRemoteRepo(hubData model.CloningInput) error

SyncRemoteRepo is used to sync the remote ChaosHub

func UnzipRemoteHub

func UnzipRemoteHub(zipPath string, hubDetails model.CreateRemoteChaosHub) error

UnzipRemoteHub is used to unzip the zip file

Types

type Annotation

type Annotation struct {
	Categories       string `yaml:"categories"`
	Vendor           string `yaml:"vendor"`
	CreatedAt        string `yaml:"createdAt"`
	Repository       string `yaml:"repository"`
	Support          string `yaml:"support"`
	ChartDescription string `yaml:"chartDescription"`
}

Annotation ...

type ChaosChart

type ChaosChart struct {
	APIVersion  string             `yaml:"apiVersion"`
	Kind        string             `yaml:"kind"`
	Metadata    Metadata           `yaml:"metadata"`
	Spec        Spec               `yaml:"spec"`
	PackageInfo PackageInformation `yaml:"packageInfo"`
}

ChaosChart ...

func ReadExperimentFile

func ReadExperimentFile(path string) (ChaosChart, error)

ReadExperimentFile is used for reading experiment file from given path

type Link struct {
	Name string
	URL  string
}

Link ...

type Maintainer

type Maintainer struct {
	Name  string
	Email string
}

Maintainer ...

type Metadata

type Metadata struct {
	Name        string     `yaml:"name"`
	Version     string     `yaml:"version"`
	Annotations Annotation `yaml:"annotations"`
}

Metadata ...

type PackageInformation

type PackageInformation struct {
	PackageName string `yaml:"packageName"`
	Experiments []struct {
		Name string `yaml:"name"`
		CSV  string `yaml:"CSV"`
		Desc string `yaml:"desc"`
	} `yaml:"experiments"`
}

PackageInformation ...

type Spec

type Spec struct {
	DisplayName         string       `yaml:"displayName"`
	CategoryDescription string       `yaml:"categoryDescription"`
	Keywords            []string     `yaml:"keywords"`
	Maturity            string       `yaml:"maturity"`
	Maintainers         []Maintainer `yaml:"maintainers"`
	MinKubeVersion      string       `yaml:"minKubeVersion"`
	Provider            struct {
		Name string `yaml:"name"`
	} `yaml:"provider"`
	Links           []Link   `yaml:"links"`
	Experiments     []string `yaml:"experiments"`
	ChaosExpCRDLink string   `yaml:"chaosexpcrdlink"`
	Platforms       []string `yaml:"platforms"`
	ChaosType       string   `yaml:"chaosType"`
}

Spec ...

Jump to

Keyboard shortcuts

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