utils

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ResetFlag indicates if a reset is required
	ResetFlag bool
	// MesheryFolder is the default relative location of the meshery config
	// related configuration files.
	MesheryFolder = ".meshery"
	// DockerComposeFile is the default location within the MesheryFolder
	// where the docker compose file is located?
	DockerComposeFile = "meshery.yaml"
	// AuthConfigFile is the location of the auth file for performing perf testing
	AuthConfigFile = "auth.json"
)

Functions

func AddAuthDetails

func AddAuthDetails(req *http.Request, filepath string) error

AddAuthDetails Adds authentication cookies to the request

func ContentTypeIsHTML added in v0.3.18

func ContentTypeIsHTML(resp *http.Response) bool

ContentTypeIsHTML Checks if the response is an HTML resposnse

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile from url and save to configured file location

func GenerateConfigGKE

func GenerateConfigGKE(SAName, namespc string) error

GenerateConfigGKE generates kube config file in /tmp/meshery/kubeconfig.yaml for a GKE cluster

func GenerateConfigMinikube

func GenerateConfigMinikube() error

GenerateConfigMinikube generates kube config file in /tmp/meshery/kubeconfig.yaml for a Minikube cluster

func IsMesheryRunning

func IsMesheryRunning() bool

IsMesheryRunning checks if the meshery server containers are up and running

func IsValidSubcommand

func IsValidSubcommand(available []*cobra.Command, sub string) bool

IsValidSubcommand checks if the passed subcommand is supported by the parent command

func PerfError

func PerfError(msg string) string

PerfError returns a formatted error message with a link to 'perf' command usage page at in addition to the error message

func PreReqCheck

func PreReqCheck() error

PreReqCheck prerequisites check

func RootError

func RootError(msg string) string

RootError returns a formatted error message with a link to 'root' command usage page at in addition to the error message

func SafeClose

func SafeClose(co io.Closer)

SafeClose is a helper function help to close the io

func SetFileLocation

func SetFileLocation() error

SetFileLocation to set absolute path

func StringWithCharset

func StringWithCharset(length int) string

StringWithCharset generates a random string with a given length

func SystemError

func SystemError(msg string) string

SystemError returns a formatted error message with a link to 'system' command usage page in addition to the error message

func UpdateAuthDetails

func UpdateAuthDetails(filepath string) error

UpdateAuthDetails checks gets the token (old/refreshed) from meshery server and writes it back to the config file

func UploadFileWithParams

func UploadFileWithParams(uri string, params map[string]string, paramName, path string) (*http.Request, error)

UploadFileWithParams returns a request configured to upload files with other values

Types

This section is empty.

Jump to

Keyboard shortcuts

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