handler

package
v0.0.0-...-e15d670 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPath = "/tmp/"

Variables

This section is empty.

Functions

func ChaosHubIconHandler

func ChaosHubIconHandler() gin.HandlerFunc

ChaosHubIconHandler is used for fetching ChaosHub icons

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 DefaultChaosHubIconHandler

func DefaultChaosHubIconHandler() gin.HandlerFunc

func DownloadRemoteHub

func DownloadRemoteHub(hubDetails model.CreateRemoteChaosHub, projectID string) error

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

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, projectID string, isDefault bool) 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 IsFileExisting

func IsFileExisting(path string) (bool, error)

func ListPredefinedWorkflowDetails

func ListPredefinedWorkflowDetails(name string, projectID string) ([]*model.PredefinedExperimentList, 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, projectID string) error

SyncRemoteRepo is used to sync the remote ChaosHub

func UnzipRemoteHub

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

UnzipRemoteHub is used to unzip the zip file

func ValidateLocalRepository

func ValidateLocalRepository(hub chaos_hub.ChaosHub) (bool, error)

ValidateLocalRepository validates the repository directory and checks it by plain opening it.

Types

type Annotation

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

type ChaosChart

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

func ReadExperimentFile

func ReadExperimentFile(path string) (ChaosChart, error)

ReadExperimentFile is used for reading experiment file from given path

type ChaosCharts

type ChaosCharts []ChaosChart

type ExecutionPlaneDetails

type ExecutionPlaneDetails struct {
	ExecutionPlane []struct {
		Name     string `yaml:"name"`
		Category []struct {
			Name string `yaml:"name"`
			CSV  string `yaml:"CSV"`
		} `yaml:"category"`
	} `yaml:"executionPlane"`
}

type Faults

type Faults struct {
	Name        string   `yaml:"name" json:"name"`
	DisplayName string   `json:"displayName" json:"displayName"`
	Description string   `yaml:"description" json:"description"`
	Plan        []string `json:"plan" json:"plan"`
}
type Link struct {
	Name string `yaml:"name" json:"name"`
	URL  string `yaml:"url" json:"url"`
}

type Maintainer

type Maintainer struct {
	Name  string `yaml:"name" json:"name"`
	Email string `yaml:"email" json:"email"`
}

type Metadata

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

type PackageInformation

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

type Spec

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

Jump to

Keyboard shortcuts

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