utils

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2021 The LitmusChaos Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 The LitmusChaos Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DefaultFileName = ".chaosconfig"

	// Default username
	DefaultUsername = "admin"

	// Default installation mode
	DefaultMode = "cluster"

	// Platform list
	PlatformList = "1. AWS\n2. GKE\n3. Openshift\n4. Rancher\n5. Others"

	// AWS identifier
	AWSIdentifier = "aws://"

	// GKE identifier
	GKEIdentifier = "gce://"

	// Openshift identifier
	OpenshiftIdentifier = "node.openshift.io/os_id"

	// Default platform name
	DefaultPlatform = "Others"

	// Label of subscriber agent being deployed
	ChaosAgentLabel = "app=subscriber"

	// Agent type is "external" for agents connected via chaosctl
	AgentType = "external"

	// Default namespace for agent installation
	DefaultNs = "litmus"

	// Default service account used for agent installation
	DefaultSA = "litmus"

	// Chaos agent connection yaml path
	ChaosYamlPath = "api/file"

	ChaosAgentPath = "delegates"

	// Graphql server api path
	GQLAPIPath = "/api/query"

	// Auth server api path
	AuthAPIPath = "/auth"

	HarnessChaosEngineeringCloudEndpoint = "https://cloud.chaosnative.com"
)

Variables

View Source
var (
	Red     = color.New(color.FgRed)
	White_B = color.New(color.FgWhite, color.Bold)
	White   = color.New(color.FgWhite)
)

Functions

func CheckKeyValueFormat

func CheckKeyValueFormat(str string) bool

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

func GetCredentials

func GetCredentials(cmd *cobra.Command) (types.Credentials, error)

func GetLitmusConfigPath

func GetLitmusConfigPath(cmd *cobra.Command) string

func IsValidUrl

func IsValidUrl(toTest string) bool

func PrintError

func PrintError(err error)

func PrintInJsonFormat

func PrintInJsonFormat(inf interface{})

func PrintInYamlFormat

func PrintInYamlFormat(inf interface{})

func Scanner

func Scanner() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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