common

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemSuccess = iota + 1
	ItemFailure
)

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(ctx context.Context, managerNamespace, managerSvc string) (*ctrlclient.CtrlClient, context.CancelFunc, error)

func MarshalChaos

func MarshalChaos(s interface{}) (string, error)

MarshalChaos returns json in readable format

func PrettyPrint

func PrettyPrint(s string, indentLevel int, color Color)

PrettyPrint print with tab number and color

func PrintResult

func PrintResult(result []*ChaosResult)

PrintResult prints result to users in prettier format

Types

type ChaosResult

type ChaosResult struct {
	Name string
	Pods []PodResult
}

type ClientSet

type ClientSet struct {
	CtrlCli client.Client
	KubeCli *kubernetes.Clientset
}

ClientSet contains two different clients

func InitClientSet

func InitClientSet() (*ClientSet, error)

InitClientSet inits two different clients that would be used

type Color

type Color string
const (
	Blue    Color = "Blue"
	Red     Color = "Red"
	Green   Color = "Green"
	Cyan    Color = "Cyan"
	NoColor Color = ""
)

type ItemResult

type ItemResult struct {
	Name    string
	Value   string
	Status  int    `json:",omitempty"`
	SucInfo string `json:",omitempty"`
	ErrInfo string `json:",omitempty"`
}

type PodResult

type PodResult struct {
	Name  string
	Items []ItemResult
}

Jump to

Keyboard shortcuts

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