utils

package
v1.1.0-1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func DrawChart

func DrawChart(chart *Chart) error

func GetEverythingListOptions

func GetEverythingListOptions() *metav1.ListOptions

func GetLinePoints

func GetLinePoints(dataMap map[string][]int) []interface{}

func GetListOptions

func GetListOptions(selectLabels map[string]string) *metav1.ListOptions

func GetPointsFromSlice

func GetPointsFromSlice(slice []int) plotter.XYs

func SetLogLevel

func SetLogLevel(level int)

Types

type Chart

type Chart struct {
	Title      string
	XLabel     string
	YLabel     string
	Width      vg.Length
	Height     vg.Length
	LinePoints []interface{}
	SvgFile    string
}

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func NewKubeClient

func NewKubeClient(KubeConfigFile string) (*KubeClient, error)

func (*KubeClient) CreateDeployment

func (kc *KubeClient) CreateDeployment(namespace string, deployment *appsv1.Deployment) error

func (*KubeClient) DeleteDeployment

func (kc *KubeClient) DeleteDeployment(namespace, name string) error

func (*KubeClient) GetClientSet

func (kc *KubeClient) GetClientSet() *kubernetes.Clientset

func (*KubeClient) GetConfigMap

func (kc *KubeClient) GetConfigMap(namespace string, name string, getOptions *metav1.GetOptions) (*apiv1.ConfigMap, error)

func (*KubeClient) GetConfigs

func (kc *KubeClient) GetConfigs() *rest.Config

func (*KubeClient) GetDeployment

func (kc *KubeClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)

func (*KubeClient) GetDeploymentInfo

func (kc *KubeClient) GetDeploymentInfo(namespace, appID string) (time.Time, []int, error)

GetDeploymentInfo return basic information of deployment: (createTime, [desired, created, ready] replicas, error)

func (*KubeClient) GetNodes

func (kc *KubeClient) GetNodes(listOptions *metav1.ListOptions) (*apiv1.NodeList, error)

func (*KubeClient) GetPods

func (kc *KubeClient) GetPods(namespace string, listOptions *metav1.ListOptions) (*apiv1.PodList, error)

type Reporter

type Reporter interface {
	GenerateReport()
}

type Results

type Results struct {
	ScenarioResults []*ScenarioResult
}

func NewResults

func NewResults() *Results

func (*Results) CreateScenarioResults

func (r *Results) CreateScenarioResults(scenarioName string) *ScenarioResult

func (*Results) RefreshStatus

func (r *Results) RefreshStatus()

func (*Results) String

func (r *Results) String() string

type ScenarioResult

type ScenarioResult struct {
	Name          string
	Status        VerificationStatus
	Verifications []*Verification
}

func (*ScenarioResult) AddVerification

func (sr *ScenarioResult) AddVerification(name, description string, status VerificationStatus)

func (*ScenarioResult) AddVerificationGroup

func (sr *ScenarioResult) AddVerificationGroup(name, description string) *Verification

type Table

type Table struct {
	Headers []string
	Data    [][]string
}

func (*Table) Output

func (t *Table) Output(file string) error

type Verification

type Verification struct {
	Deep             int
	Name             string
	Status           VerificationStatus
	Description      string
	SubVerifications []*Verification
	Parent           *Verification
}

func (*Verification) AddAssertSubVerification

func (vg *Verification) AddAssertSubVerification(result bool, name, description string) *Verification

func (*Verification) AddErrorSubVerification

func (vg *Verification) AddErrorSubVerification(err error, name, description string) *Verification

func (*Verification) AddSubVerification

func (vg *Verification) AddSubVerification(name, description string, status VerificationStatus) *Verification

func (*Verification) AddSubVerificationGroup

func (vg *Verification) AddSubVerificationGroup(name, description string) *Verification

func (*Verification) IsFailed

func (vg *Verification) IsFailed() bool

func (*Verification) RefreshStatus

func (v *Verification) RefreshStatus()

func (*Verification) String

func (v *Verification) String() string

type VerificationStatus

type VerificationStatus int
const (
	SUCCEEDED VerificationStatus = iota
	FAILED
)

Jump to

Keyboard shortcuts

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