Documentation ¶
Index ¶
- Variables
- func AddAuthDetails(req *http.Request, filepath string) error
- func AddContextToConfig(contextName string, context models.Context, configPath string, set bool) error
- func AskForConfirmation(s string) bool
- func ContentTypeIsHTML(resp *http.Response) bool
- func CreateConfigFile() error
- func DownloadFile(filepath string, url string) error
- func GenerateConfigAKS(resourceGroup, clusterName string) error
- func GenerateConfigEKS(region, cluster string) error
- func GenerateConfigGKE(SAName, namespc string) error
- func GenerateConfigMinikube() error
- func GetLatestStableReleaseTag() (string, error)
- func GetMesheryGitHubOrg() string
- func GetMesheryGitHubRepo() string
- func IsMesheryRunning() bool
- func IsValidSubcommand(available []*cobra.Command, sub string) bool
- func PerfError(msg string) string
- func PreReqCheck(subcommand string) error
- func RootError(msg string) string
- func SafeClose(co io.Closer)
- func SetFileLocation() error
- func StringWithCharset(length int) string
- func SystemError(msg string) string
- func UpdateAuthDetails(filepath string) error
- func UpdateMesheryContainers() error
- func UploadFileWithParams(uri string, params map[string]string, paramName, path string) (*http.Request, error)
- func ValidateURL(URL string) error
- type DockerCompose
- type Service
- type Volumes
Constants ¶
This section is empty.
Variables ¶
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" // DefaultConfigPath is the detail path to mesheryctl config DefaultConfigPath = "config.yaml" // ViperCompose is an instance of viper for docker-compose ViperCompose = viper.New() // SilentFlag skips waiting for user input and proceeds with default options SilentFlag bool )
var ListOfAdapters = []string{"meshery-istio", "meshery-linkerd", "meshery-consul", "meshery-octarine", "meshery-nsm", "meshery-kuma", "meshery-cpx", "meshery-osm", "meshery-nginx-sm"}
ListOfAdapters returns the list of adapters available
var TemplateContext = models.Context{ Endpoint: "http://localhost:9081", Token: models.Token{ Name: "Default", Location: AuthConfigFile, }, Platform: "docker", Adapters: ListOfAdapters, Channel: "stable", }
TemplateContext is the template context provided when creating a config file
Functions ¶
func AddAuthDetails ¶
AddAuthDetails Adds authentication cookies to the request
func AddContextToConfig ¶ added in v0.5.1
func AddContextToConfig(contextName string, context models.Context, configPath string, set bool) error
AddContextToConfig adds context passed to it to mesheryctl config file
func AskForConfirmation ¶ added in v0.5.1
AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func ContentTypeIsHTML ¶ added in v0.3.18
ContentTypeIsHTML Checks if the response is an HTML resposnse
func CreateConfigFile ¶ added in v0.5.1
func CreateConfigFile() error
CreateConfigFile creates config file in Meshery Folder
func DownloadFile ¶
DownloadFile from url and save to configured file location
func GenerateConfigAKS ¶ added in v0.5.1
GenerateConfigAKS generates kube config file in ~/.meshery/kubeconfig.yaml for a AKS cluster
func GenerateConfigEKS ¶ added in v0.5.1
GenerateConfigEKS generates kube config file in .meshery/kubeconfig.yaml for an EKS cluster
func GenerateConfigGKE ¶
GenerateConfigGKE generates kube config file in ~/.meshery/kubeconfig.yaml for a GKE cluster
func GenerateConfigMinikube ¶
func GenerateConfigMinikube() error
GenerateConfigMinikube generates kube config file in ~/.meshery/kubeconfig.yaml for a Minikube cluster
func GetLatestStableReleaseTag ¶ added in v0.5.1
GetLatestStableReleaseTag fetches and returns the latest release tag from GitHub
func GetMesheryGitHubOrg ¶ added in v0.4.11
func GetMesheryGitHubOrg() string
GetMesheryGitHubOrg retrieves the name of the GitHub organization under which the Meshery repository resides.
func GetMesheryGitHubRepo ¶ added in v0.4.11
func GetMesheryGitHubRepo() string
GetMesheryGitHubRepo retrieves the name of the Meshery repository
func IsMesheryRunning ¶
func IsMesheryRunning() bool
IsMesheryRunning checks if the meshery server containers are up and running
func IsValidSubcommand ¶
IsValidSubcommand checks if the passed subcommand is supported by the parent command
func PerfError ¶
PerfError returns a formatted error message with a link to 'perf' command usage page at in addition to the error message
func RootError ¶
RootError returns a formatted error message with a link to 'root' command usage page at in addition to the error message
func StringWithCharset ¶
StringWithCharset generates a random string with a given length
func SystemError ¶
SystemError returns a formatted error message with a link to 'system' command usage page in addition to the error message
func UpdateAuthDetails ¶
UpdateAuthDetails checks gets the token (old/refreshed) from meshery server and writes it back to the config file
func UpdateMesheryContainers ¶ added in v0.5.1
func UpdateMesheryContainers() error
UpdateMesheryContainers runs the update command for meshery client
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
func ValidateURL ¶ added in v0.5.1
ValidateURL validates url provided for meshery backend to mesheryctl context