Documentation ¶
Index ¶
- Constants
- Variables
- func AddAuthDetails(req *http.Request, filepath string) error
- func AppError(msg string) string
- func AppViewError(msg string) string
- func ApplyManifest(manifest []byte, client *meshkitkube.Client, update bool, delete bool) error
- func ApplyManifestFiles(manifestArr []Manifest, requestedAdapters []string, client *meshkitkube.Client, ...) error
- func ApplyOperatorManifest(client *meshkitkube.Client, update bool, delete bool) error
- func AreAllPodsRunning() (bool, error)
- func AreMesheryComponentsRunning(currPlatform string) (bool, error)
- func AskForConfirmation(s string) bool
- func AskForInput(prompt string, allowed []string) string
- func BackupConfigFile(cfgFile string)
- func CanUseCachedManifests(currCtx *(config.Context)) error
- func CanUseCachedOperatorManifests(_ *config.Context) error
- func ChangeManifestVersion(channel, version, filePath string) error
- func CheckFileExists(name string) (bool, error)
- func CheckK8sVersion(versionInfo *version.Info) error
- func CheckKubectlVersion() error
- func CheckMesheryNsDelete() (bool, error)
- func ClearLine()
- func ContainsStringPrefix(arr []string, str string) bool
- func ContentTypeIsHTML(resp *http.Response) bool
- func ConvertMapInterfaceMapString(v interface{}) interface{}
- func ConvertRespToSSE(resp *http.Response) (chan Event, error)
- func CreateComponentsMetadataAndCreateSVGsForMDStyle(components []ComponentCSV, path, svgDir string) (string, error)
- func CreateComponentsMetadataAndCreateSVGsForMDXStyle(components []ComponentCSV, path, svgDir string) (string, error)
- func CreateConfigFile() error
- func CreateDefaultSpinner(suffix string, finalMsg string) *spinner.Spinner
- func CreateManifestsFolder() error
- func CreateTempAuthServer(fn func(http.ResponseWriter, *http.Request)) (*http.Server, int, error)
- func DeleteConfiguration(mesheryServerUrl, id, configuration string) error
- func DownloadDockerComposeFile(ctx *config.Context, force bool) error
- func DownloadManifests(manifestArr []Manifest, rawManifestsURL string) error
- func DownloadOperatorManifest() error
- func Equals(tb testing.TB, exp, act interface{})
- func ErrAttachAuthToken(err error) error
- func ErrCreatingRequest(err error) error
- func ErrFailReqStatus(statusCode int) error
- func ErrFailRequest(err error) error
- func ErrFileRead(err error) error
- func ErrInvalidAPIResponse(err error) error
- func ErrInvalidFile(err error) error
- func ErrInvalidNameOrID(err error) error
- func ErrInvalidToken() error
- func ErrJSONToYAML(err error) error
- func ErrLoadConfig(err error) error
- func ErrMarshal(err error) error
- func ErrMarshalIndent(err error) error
- func ErrNotFound(err error) error
- func ErrOutFormatFlag() error
- func ErrParseGithubFile(err error, URL string) error
- func ErrParsingUrl(err error) error
- func ErrReadConfigFile(err error) error
- func ErrReadResponseBody(err error) error
- func ErrReadToken(err error) error
- func ErrRequestResponse(err error) error
- func ErrResponseStatus(statusCode int) error
- func ErrResponseStatusBody(statusCode int, body string) error
- func ErrUnauthenticated() error
- func ErrUnmarshal(err error) error
- func ExpError(msg string) string
- func FilterDeleteError(msg string) string
- func FilterError(msg string) string
- func FilterImportError(msg string) string
- func FilterListError(msg string) string
- func FilterViewError(msg string) string
- func FindClosestArg(argPassed string, validArgs []string) string
- func ForceCleanupCluster() error
- func GenerateConfigGKE(configPath, SAName, namespc string) error
- func GenerateJSStyleDocs(model ModelCSV, docsJSON, imgPath string) (string, error)
- func GenerateMDStyleDocs(model ModelCSV, components []ComponentCSV, modelPath, imgPath string) error
- func GenerateMDXStyleDocs(model ModelCSV, components []ComponentCSV, modelPath, imgPath string) error
- func GetBasePath(t *testing.T) string
- func GetChannelAndVersion(currCtx *(config.Context)) (string, string, error)
- func GetCleanPodName(name string) string
- func GetCurrentAuthToken() (string, error)
- func GetDeploymentVersion(filePath string) (string, error)
- func GetEphemeralPort() (int, error)
- func GetID(mesheryServerUrl, configuration string) ([]string, error)
- func GetIndexForRegisterCol(cols []string, shouldRegister string) int
- func GetK8sVersionInfo() (*version.Info, error)
- func GetManifestTreeURL(version string) (string, error)
- func GetManifestURL(manifest Manifest, rawManifestsURL string) string
- func GetName(mesheryServerUrl, configuration string) (map[string]string, error)
- func GetPodList(client *meshkitkube.Client, namespace string) (*v1core.PodList, error)
- func GetProviderInfo(mctCfg *config.MesheryCtlConfig) (map[string]Provider, error)
- func GetRequiredPods(specifiedPods []string, availablePods []v1core.Pod) (map[string]string, error)
- func GetSessionData(mctlCfg *config.MesheryCtlConfig) (*models.Preference, error)
- func GetTokenLocation(token config.Token) (string, error)
- func InitiateLogin(mctlCfg *config.MesheryCtlConfig, option string) ([]byte, error)
- func InstallprereqDocker() error
- func IsAdapterValid(manifestArr []Manifest, componentManifest string) bool
- func IsMesheryRunning(currPlatform string) (bool, error)
- func IsServerRunning(serverAddr string) error
- func IsValidSubcommand(available []*cobra.Command, sub string) bool
- func MakeRequest(req *http.Request) (*http.Response, error)
- func MapGet(mp map[string]interface{}, key ...string) (interface{}, bool)
- func MapSet(mp map[string]interface{}, value interface{}, key ...string)
- func MeshError(msg string) string
- func NavigateToBrowser(endpoint string) error
- func NewRequest(method string, url string, body io.Reader) (*http.Request, error)
- func ParseURLGithub(URL string) (string, string, error)
- func PatternError(msg string) string
- func PatternViewError(msg string) string
- func PerfError(msg string) string
- func Populate(src, dst string) error
- func PrintToTable(header []string, data [][]string)
- func PrintToTableInStringFormat(header []string, data [][]string) string
- func PrintToTableWithFooter(header []string, data [][]string, footer []string)
- func ReadToken(filepath string) (map[string]string, error)
- func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
- func RegistryError(msg string, cmd string) string
- func RootError(msg string) string
- func SafeClose(co io.Closer)
- func SetFileLocation() error
- func SetFileLocationTesting(dir string)
- func SetKubeConfig()
- func SetOverrideValues(ctx *config.Context, mesheryImageVersion string) map[string]interface{}
- func SetupContextEnv(t *testing.T)
- func SetupCustomContextEnv(t *testing.T, pathToContext string)
- func SetupLogrusFormatter()
- func SetupLogrusGrabTesting(_ *testing.T, _ bool) *bytes.Buffer
- func SetupMeshkitLogger(debugLevel bool, output io.Writer)
- func SetupMeshkitLoggerTesting(_ *testing.T, verbose bool) *bytes.Buffer
- func StartMockMesheryServer(t *testing.T) error
- func StartMockery(t *testing.T)
- func Startdockerdaemon(subcommand string) error
- func StopMockery(_ *testing.T)
- func StringContainedInSlice(str string, slice []string) int
- func StringInSlice(str string, slice []string) bool
- func StringWithCharset(length int) string
- func SystemChannelSubError(msg string, cmd string) string
- func SystemContextSubError(msg string, cmd string) string
- func SystemError(msg string) string
- func SystemLifeCycleError(msg string, cmd string) string
- func SystemModelSubError(msg string, cmd string) string
- func SystemProviderSubError(msg string, cmd string) string
- func SystemTokenError(msg string) string
- func TransformYAML(yamlByt []byte, transform func(interface{}) (interface{}, error), ...) ([]byte, error)
- func TruncateID(id 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 ValidId(mesheryServerUrl, args string, configuration string) (string, bool, error)
- func ValidName(mesheryServerUrl, args string, configuration string) (string, string, bool, error)
- func ValidateURL(URL string) error
- func WaitForNamespaceDeleted(c *meshkitkube.Client, namespace string, timeout int) error
- func WaitForPodRunning(c *meshkitkube.Client, desiredPod, namespace string, timeout int) error
- type CmdTestInput
- type ComponentCSV
- type ComponentCSVHelper
- type Containers
- type DockerCompose
- type Event
- type EventData
- type GoldenFile
- type K8sCompose
- type Manifest
- type ManifestList
- type MockURL
- type ModelCSV
- type ModelCSVHelper
- type Paginator
- type PortForward
- type Provider
- type Service
- type Spec
- type SystemType
- type Template
- type TemplateSpec
- type TerminalFormatter
- type TestHelper
- type Volumes
Constants ¶
const ( OperatorURL = baseConfigURL + "manifests/default.yaml" BrokerURL = baseConfigURL + "samples/meshery_v1alpha1_broker.yaml" MeshsyncURL = baseConfigURL + "samples/meshery_v1alpha1_meshsync.yaml" // Meshery Server Location EndpointProtocol = "http" )
const ( HelmChartURL = "https://meshery.io/charts/" HelmChartName = "meshery" HelmChartOperatorName = "meshery-operator" )
Variables ¶
var ( ErrFailRequestCode = "1163" ErrInvalidTokenCode = "1164" ErrFailReqStatusCode = "1165" ErrAttachAuthTokenCode = "1166" ErrUnmarshalCode = "1167" ErrFileReadCode = "1168" ErrCreatingRequestCode = "1169" ErrMarshalCode = "1170" ErrReadResponseBodyCode = "1171" ErrParsingUrlCode = "1172" ErrNotFoundCode = "1173" ErrUnauthenticatedCode = "1174" ErrInvalidFileCode = "1175" ErrInvalidNameOrIDCode = "1176" ErrInvalidAPIResponseCode = "1177" ErrReadConfigFileCode = "1178" ErrMarshalIndentCode = "1179" ErrLoadConfigCode = "1180" ErrResponseStatusBodyCode = "1181" ErrResponseStatusCode = "1182" ErrJSONToYAMLCode = "1183" ErrOutFormatFlagCode = "1184" ErrParseGithubFileCode = "1185" ErrReadTokenCode = "1186" ErrRequestResponseCode = "1187" )
Please reference the following before contributing an error code: https://docs.meshery.io/project/contributing/contributing-error https://github.com/meshery/meshkit/blob/master/errors/errors.go
var ( // ResetFlag indicates if a reset is required ResetFlag bool // SkipResetFlag indicates if fetching the updated manifest files is required SkipResetFlag bool // MesheryDefaultHost is the default host on which Meshery is exposed MesheryDefaultHost = "localhost" // MesheryDefaultPort is the default port on which Meshery is exposed MesheryDefaultPort = 9081 // MesheryEndpoint is the default URL in which Meshery is exposed MesheryEndpoint = fmt.Sprintf("http://%s:%v", MesheryDefaultHost, MesheryDefaultPort) // 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" // MesheryNamespace is the namespace to which Meshery is deployed in the Kubernetes cluster MesheryNamespace = "meshery" // MesheryDeployment is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s MesheryDeployment = "meshery-deployment.yaml" // MesheryService is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s MesheryService = "meshery-service.yaml" //MesheryOperator is the file for default Meshery operator //check https://github.com/layer5io/meshery-operator/blob/master/config/manifests/default.yaml MesheryOperator = "default.yaml" //MesheryOperatorBroker is the file for the Meshery broker //check https://github.com/layer5io/meshery-operator/blob/master/config/samples/meshery_v1alpha1_broker.yaml MesheryOperatorBroker = "meshery_v1alpha1_broker.yaml" //MesheryOperatorMeshsync is the file for the Meshery Meshsync Operator //check https://github.com/layer5io/meshery-operator/blob/master/config/samples/meshery_v1alpha1_meshsync.yaml MesheryOperatorMeshsync = "meshery_v1alpha1_meshsync.yaml" // ServiceAccount is the name of a Kubernetes manifest file required to setup Meshery // check https://github.com/layer5io/meshery/tree/master/install/deployment_yamls/k8s ServiceAccount = "service-account.yaml" // To upload with param name ParamName = "k8sfile" // kubeconfig file name KubeConfigYaml = "kubeconfig.yaml" // ViperCompose is an instance of viper for docker-compose ViperCompose = viper.New() // ViperMeshconfig is an instance of viper for the meshconfig file ViperMeshconfig = viper.New() // SilentFlag skips waiting for user input and proceeds with default options SilentFlag bool // PlatformFlag sets the platform for the initial config file PlatformFlag string // Paths to kubeconfig files ConfigPath string KubeConfig string // KeepNamespace indicates if the namespace should be kept when Meshery is uninstalled KeepNamespace bool // TokenFlag sets token location passed by user with --token TokenFlag = "Not Set" // global logger variable Log logger.Handler )
var ( // ManifestsFolder is where the Kubernetes manifests are stored ManifestsFolder = "manifests" ReleaseTag string )
var CfgFile string
var ListOfComponents = []string{}
ListOfComponents returns the list of components available
var Services = map[string]Service{ "meshery": { Image: "layer5/meshery:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Environment: []string{ "PROVIDER_BASE_URLS=https://meshery.layer5.io", "ADAPTER_URLS=meshery-istio:10000 meshery-linkerd:10001 meshery-consul:10002 meshery-nsm:10004 meshery-app-mesh:10005 meshery-kuma:10007 meshery-osm:10009 meshery-traefik-mesh:10006 meshery-nginx-sm:10010 meshery-cilium:10012", "EVENT=mesheryLocal", "PORT=9081", }, Volumes: []string{"$HOME/.kube:/home/appuser/.kube:ro", "$HOME/.minikube:$HOME/.minikube:ro"}, Ports: []string{"9081:9081"}, }, "meshery-istio": { Image: "layer5/meshery-istio:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10000:10000"}, }, "meshery-linkerd": { Image: "layer5/meshery-linkerd:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10001:10001"}, }, "meshery-consul": { Image: "layer5/meshery-consul:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10002:10002"}, }, "meshery-nsm": { Image: "layer5/meshery-nsm:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10004:10004"}, }, "meshery-app-mesh": { Image: "layer5/meshery-app-mesh:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10005:10005"}, }, "meshery-traefik-mesh": { Image: "layer5/meshery-traefik-mesh:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10006:10006"}, }, "meshery-kuma": { Image: "layer5/meshery-kuma:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10007:10007"}, }, "meshery-osm": { Image: "layer5/meshery-osm:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10009:10009"}, }, "meshery-nginx-sm": { Image: "layer5/meshery-nginx-sm:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10010:10010"}, }, "meshery-cilium": { Image: "layer5/meshery-cilium:stable-latest", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, Ports: []string{"10012:10012"}, }, "watchtower": { Image: "containrrr/watchtower", Labels: []string{"com.centurylinklabs.watchtower.enable=true"}, }, }
var TemplateContext = config.Context{ Endpoint: EndpointProtocol + "://localhost:9081", Token: "default", Platform: "kubernetes", Components: ListOfComponents, Channel: "stable", Version: "latest", Provider: "Meshery", }
TemplateContext is the template context provided when creating a config file
var TemplateToken = config.Token{ Name: "default", Location: AuthConfigFile, }
TemplateToken is the template token provided when creating a config file
Functions ¶
func AddAuthDetails ¶
AddAuthDetails Adds authentication cookies to the request
func AppError ¶ added in v0.6.7
AppError returns a formatted error message with a link to 'app' command usage page in addition to the error message
func AppViewError ¶ added in v0.6.137
AppError returns a formatted error message with a link to 'app view' command usage page in addition to the error message
func ApplyManifest ¶ added in v0.5.2
ApplyManifest is a wrapper function for client.ApplyManifest
func ApplyManifestFiles ¶ added in v0.5.2
func ApplyManifestFiles(manifestArr []Manifest, requestedAdapters []string, client *meshkitkube.Client, update bool, delete bool) error
ApplyManifestFiles applies/updates/deletes all the required manifests into the Kubernetes cluster
func ApplyOperatorManifest ¶ added in v0.5.12
func ApplyOperatorManifest(client *meshkitkube.Client, update bool, delete bool) error
ApplyOperatorManifest applies/updates/deletes the operator manifest
func AreAllPodsRunning ¶ added in v0.5.33
AreAllPodsRunning checks if all the deployment pods under kubernetes are running
func AreMesheryComponentsRunning ¶ added in v0.6.2
AreMesheryComponentsRunning checks if the meshery containers are up and running
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 AskForInput ¶ added in v0.5.15
AskForInput asks the user for an input and checks if it is in the available values
func BackupConfigFile ¶ added in v0.5.32
func BackupConfigFile(cfgFile string)
func CanUseCachedManifests ¶ added in v0.5.50
CanUseCachedManifests returns an error if it is not possible to use cached manifests
func CanUseCachedOperatorManifests ¶ added in v0.5.50
CanUseCachedOperatorManifests returns an error if it is not possible to use cached operator manifests
func ChangeManifestVersion ¶ added in v0.5.3
ChangeManifestVersion changes the tag of the images in the manifest according to the pinned version
func CheckFileExists ¶ added in v0.6.2
CheckFileExists checks if the given file exists in system or not
func CheckK8sVersion ¶ added in v0.5.3
func CheckKubectlVersion ¶ added in v0.5.3
func CheckKubectlVersion() error
CheckKubectlVersion validates whether the installed kubectl version is running a minimum kubectl version.
func CheckMesheryNsDelete ¶ added in v0.6.2
CheckMesheryNsDelete waits for Meshery namespace to be deleted, returns (done, error)
func ContainsStringPrefix ¶ added in v0.5.46
ContainsStringPrefix takes a string slice and a string and returns true if it is present
func ContentTypeIsHTML ¶ added in v0.3.18
ContentTypeIsHTML Checks if the response is an HTML resposnse
func ConvertMapInterfaceMapString ¶ added in v0.5.39
func ConvertMapInterfaceMapString(v interface{}) interface{}
ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{}
It will also convert []interface{} => []string
func ConvertRespToSSE ¶ added in v0.5.46
ConvertRespToSSE converts a connection to a stream of server sent events
func CreateComponentsMetadataAndCreateSVGsForMDStyle ¶ added in v0.7.14
func CreateComponentsMetadataAndCreateSVGsForMDStyle(components []ComponentCSV, path, svgDir string) (string, error)
func CreateComponentsMetadataAndCreateSVGsForMDXStyle ¶ added in v0.7.14
func CreateComponentsMetadataAndCreateSVGsForMDXStyle(components []ComponentCSV, path, svgDir string) (string, error)
func CreateConfigFile ¶ added in v0.5.1
func CreateConfigFile() error
CreateConfigFile creates config file in Meshery Folder
func CreateDefaultSpinner ¶ added in v0.5.24
Indicate an ongoing Process at a given time on CLI
func CreateManifestsFolder ¶ added in v0.5.13
func CreateManifestsFolder() error
CreateManifestsFolder creates a new folder (.meshery/manifests)
func CreateTempAuthServer ¶ added in v0.5.32
CreateTempAuthServer creates a temporary http server
It implements a custom mux and has a catch all route, the function passed as the parameter is binded to the catch all route
func DeleteConfiguration ¶ added in v0.6.31
Delete configuration from meshery server endpoint /api/{configurations}/{id}
func DownloadDockerComposeFile ¶ added in v0.5.1
DownloadDockerComposeFile fetches docker-compose.yaml based on passed context if it does not exists. Use force to override download anyway
func DownloadManifests ¶ added in v0.5.1
DownloadManifests downloads all the Kubernetes manifest files
func DownloadOperatorManifest ¶ added in v0.5.13
func DownloadOperatorManifest() error
DownloadOperatorManifest downloads the operator manifest files
func ErrAttachAuthToken ¶ added in v0.6.2
func ErrCreatingRequest ¶ added in v0.6.132
func ErrFailReqStatus ¶ added in v0.6.2
func ErrFailRequest ¶ added in v0.6.2
func ErrFileRead ¶ added in v0.6.132
func ErrInvalidAPIResponse ¶ added in v0.6.132
func ErrInvalidFile ¶ added in v0.6.132
func ErrInvalidNameOrID ¶ added in v0.6.132
func ErrInvalidToken ¶ added in v0.6.132
func ErrInvalidToken() error
func ErrJSONToYAML ¶ added in v0.6.137
func ErrLoadConfig ¶ added in v0.6.137
func ErrMarshal ¶ added in v0.6.137
func ErrMarshalIndent ¶ added in v0.6.137
func ErrNotFound ¶ added in v0.6.132
func ErrOutFormatFlag ¶ added in v0.6.137
func ErrOutFormatFlag() error
func ErrParseGithubFile ¶ added in v0.6.137
func ErrParsingUrl ¶ added in v0.6.132
func ErrReadConfigFile ¶ added in v0.6.137
func ErrReadResponseBody ¶ added in v0.6.132
func ErrReadToken ¶ added in v0.6.137
func ErrRequestResponse ¶ added in v0.6.137
func ErrResponseStatus ¶ added in v0.6.137
func ErrResponseStatusBody ¶ added in v0.6.137
func ErrUnauthenticated ¶ added in v0.6.2
func ErrUnauthenticated() error
func ErrUnmarshal ¶ added in v0.6.132
func ExpError ¶ added in v0.6.7
ExpError returns a formatted error message with a link to 'exp' command usage page in addition to the error message
func FilterDeleteError ¶ added in v0.6.107
FilterDeleteError returns a formatted error message with a link to 'filter delete' command usage page in addition to the error message
func FilterError ¶ added in v0.6.7
FilterError returns a formatted error message with a link to 'filter' command usage page in addition to the error message
func FilterImportError ¶ added in v0.6.107
FilterImportError returns a formatted error message with a link to 'filter import' command usage page in addition to the error message
func FilterListError ¶ added in v0.6.107
FilterListError returns a formatted error message with a link to 'filter list' command usage page in addition to the error message
func FilterViewError ¶ added in v0.6.107
FilterViewError returns a formatted error message with a link to 'filter view' command usage page in addition to the error message
func FindClosestArg ¶ added in v0.6.64
func ForceCleanupCluster ¶ added in v0.6.2
func ForceCleanupCluster() error
func GenerateConfigGKE ¶
TODO@Aisuko this function is so hard to read and maintain, please refactor it
func GenerateJSStyleDocs ¶ added in v0.7.14
func GenerateMDStyleDocs ¶ added in v0.7.14
func GenerateMDStyleDocs(model ModelCSV, components []ComponentCSV, modelPath, imgPath string) error
func GenerateMDXStyleDocs ¶ added in v0.7.14
func GenerateMDXStyleDocs(model ModelCSV, components []ComponentCSV, modelPath, imgPath string) error
func GetChannelAndVersion ¶ added in v0.5.46
returns the Channel and Version given a context
func GetCleanPodName ¶ added in v0.6.2
GetCleanPodName cleans the pod names in the MesheryNamespace to make it more readable
func GetCurrentAuthToken ¶ added in v0.6.2
GetCurrentAuthToken returns location of current context token
func GetDeploymentVersion ¶ added in v0.5.50
func GetEphemeralPort ¶ added in v0.6.2
GetEphemeralPort selects a port for the port-forwarding. It binds to a free ephemeral port and returns the port number.
func GetID ¶ added in v0.6.31
GetID returns a array of IDs from meshery server endpoint /api/{configurations}
func GetIndexForRegisterCol ¶ added in v0.7.14
func GetK8sVersionInfo ¶ added in v0.5.3
GetK8sVersionInfo returns version.Info for the Kubernetes cluster.
func GetManifestTreeURL ¶ added in v0.5.2
GetManifestTreeURL returns the manifest tree url based on version
func GetManifestURL ¶ added in v0.5.1
GetManifestURL returns the URLs for the manifest files
func GetName ¶ added in v0.6.107
GetName returns a of name:id from meshery server endpoint /api/{configurations}
func GetPodList ¶ added in v0.6.2
GetPods lists all the available pods in the MesheryNamespace
func GetProviderInfo ¶ added in v0.5.32
func GetProviderInfo(mctCfg *config.MesheryCtlConfig) (map[string]Provider, error)
GetProviderInfo queries meshery API for the provider info
func GetRequiredPods ¶ added in v0.5.13
GetRequiredPodsMap checks if the pods specified by the user is valid returns a map of the required pods
func GetSessionData ¶ added in v0.5.38
func GetSessionData(mctlCfg *config.MesheryCtlConfig) (*models.Preference, error)
Get Meshery Session Data/Details (Adapters)
func GetTokenLocation ¶ added in v0.6.2
Function checks the location of token and returns appropriate location of the token
func InitiateLogin ¶ added in v0.5.32
func InitiateLogin(mctlCfg *config.MesheryCtlConfig, option string) ([]byte, error)
InitiateLogin initates the login process
func InstallprereqDocker ¶ added in v0.5.12
func InstallprereqDocker() error
func IsAdapterValid ¶ added in v0.5.1
IsAdapterValid checks if the component mentioned by the user is a valid component
func IsMesheryRunning ¶
IsMesheryRunning checks if the meshery server containers are up and running
func IsServerRunning ¶ added in v0.6.181
func IsValidSubcommand ¶
IsValidSubcommand checks if the passed subcommand is supported by the parent command
func MakeRequest ¶ added in v0.6.2
Function returns a new http response given a http request Function will test the response and return any errors associated with it
func MapGet ¶ added in v0.5.39
MapGet takes in the map keys - each key goes one level deeper in the map
func MapSet ¶ added in v0.5.39
MapSet takes in the map that needs to be manipulated, the value that needs to be assgined to be assigned and the key - each key goes one level deeper in the map
func MeshError ¶ added in v0.6.7
MeshError returns a formatted error message with a link to 'mesh' command usage page in addition to the error message
func NavigateToBrowser ¶ added in v0.5.12
NavigateToBroswer naviagtes to the endpoint displaying Meshery UI in the broswer.
func NewRequest ¶ added in v0.6.2
NewRequest creates *http.Request and handles adding authentication for Meshery itself Function returns a http response generated by the new request
func ParseURLGithub ¶ added in v0.5.38
ParseURLGithub checks URL and returns raw repo, path, error
func PatternError ¶ added in v0.6.7
PatternError returns a formatted error message with a link to 'pattern' command usage page in addition to the error message
func PatternViewError ¶ added in v0.6.137
PatternViewError returns a formatted error message with a link to the 'pattern view' commad usage page in addition to the error message
func PerfError ¶
PerfError returns a formatted error message with a link to 'perf' command usage page at in addition to the error message
func PrintToTable ¶ added in v0.5.2
PrintToTable prints the given data into a table format
func PrintToTableInStringFormat ¶ added in v0.5.26
PrintToTableInStringFormat prints the given data into a table format but return as a string
func PrintToTableWithFooter ¶ added in v0.5.11
PrintToTableWithFooter prints the given data into a table format but with a footer
func RecursiveCastMapStringInterfaceToMapStringInterface ¶ added in v0.5.39
func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}
func RegistryError ¶ added in v0.7.14
func RootError ¶
RootError returns a formatted error message with a link to 'root' command usage page at in addition to the error message
func SetFileLocationTesting ¶ added in v0.5.37
func SetFileLocationTesting(dir string)
Set file location for testing stuff
func SetKubeConfig ¶ added in v0.5.61
func SetKubeConfig()
Sets the path to user's kubeconfig file into global variables
func SetOverrideValues ¶ added in v0.5.67
SetOverrideValues returns the value overrides based on current context to install/upgrade helm chart
func SetupContextEnv ¶ added in v0.5.26
use default context /pkg/utils/TestConfig.yaml
func SetupCustomContextEnv ¶ added in v0.5.37
setup custom context with SetupCustomContextEnv
func SetupLogrusFormatter ¶ added in v0.5.26
func SetupLogrusFormatter()
Call this function to setup logrus
func SetupLogrusGrabTesting ¶ added in v0.5.46
setup logrus formatter and return the buffer in which commands output is to be set.
func SetupMeshkitLogger ¶ added in v0.6.2
Initialize Meshkit Logger instance
func SetupMeshkitLoggerTesting ¶ added in v0.6.2
setup meshkit logger for testing and return the buffer in which commands output is to be set.
func StartMockMesheryServer ¶ added in v0.7.1
func StartMockery ¶ added in v0.5.26
Start mock HTTP client to mock requests
func Startdockerdaemon ¶ added in v0.5.12
func StringContainedInSlice ¶ added in v0.5.13
StringContainedInSlice returns the index in which a string is a substring in a list of strings
func StringInSlice ¶ added in v0.5.15
StringInSlice checks if a string is present in a slice
func StringWithCharset ¶
StringWithCharset generates a random string with a given length
func SystemChannelSubError ¶ added in v0.6.7
SystemChannelSubError returns a formatted error message with a link to `channel` command usage page in addition to the error message
func SystemContextSubError ¶ added in v0.6.7
SystemContextSubError returns a formatted error message with a link to `context` command usage page in addition to the error message
func SystemError ¶
SystemError returns a formatted error message with a link to 'system' command usage page in addition to the error message
func SystemLifeCycleError ¶ added in v0.6.30
func SystemModelSubError ¶ added in v0.6.181
SystemProviderSubError returns a formatted error message with a link to `provider` command usage page in addition to the error message
func SystemProviderSubError ¶ added in v0.6.46
SystemProviderSubError returns a formatted error message with a link to `provider` command usage page in addition to the error message
func SystemTokenError ¶ added in v0.6.48
SystemTokenError returns a formatted error message with a link to 'token' command usage page in addition to the error message
func TransformYAML ¶ added in v0.5.39
func TransformYAML(yamlByt []byte, transform func(interface{}) (interface{}, error), keys ...string) ([]byte, error)
TransformYAML takes in:
yamlByt - YAML Byte slice that needs to be modified transform - function that will be executed on that value, the returned value will replace the current value keys - takes in a series of keys which are supposed to be nested, numbers can also be passed to access an array
func TruncateID ¶ added in v0.5.11
TruncateID shortens an id to 8 characters
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 ValidId ¶ added in v0.6.107
ValidId - Check if args is a valid ID or a valid ID prefix and returns the full ID
func ValidName ¶ added in v0.6.107
ValidId - Check if args is a valid name or a valid name prefix and returns the full name and ID
func ValidateURL ¶ added in v0.5.1
ValidateURL validates url provided for meshery backend to mesheryctl context
func WaitForNamespaceDeleted ¶ added in v0.6.2
func WaitForNamespaceDeleted(c *meshkitkube.Client, namespace string, timeout int) error
Wait up to timeout seconds for `namespace` to be deleted.
func WaitForPodRunning ¶ added in v0.6.2
func WaitForPodRunning(c *meshkitkube.Client, desiredPod, namespace string, timeout int) error
Wait up to timeout seconds for pod in 'namespace' to enter running state. Returns an error if no pods are found or not all discovered pods enter running state.
Types ¶
type CmdTestInput ¶ added in v0.5.26
type ComponentCSV ¶ added in v0.7.14
type ComponentCSV struct { Registrant string `json:"registrant"` Model string `json:"model"` Component string `json:"component"` Shape string `json:"shape"` PrimaryColor string `json:"primaryColor"` SecondaryColor string `json:"secondaryColor"` SVGColor string `json:"svgColor"` SVGWhite string `json:"svgWhite"` SVGComplete string `json:"svgComplete"` HasSchema string `json:"hasSchema"` Description string `json:"description"` Docs string `json:"docs"` StyleOverrides string `json:"styleOverrides"` Styles string `json:"styles"` ShapePolygonPoints string `json:"shapePolygonPoints"` DefaultData string `json:"defaultData"` Capabilities string `json:"capabilities"` LogoURL string `json:"logoURL"` Genealogy string `json:"genealogy"` IsAnnotation string `json:"isAnnotation"` }
type ComponentCSVHelper ¶ added in v0.7.14
type ComponentCSVHelper struct { SpreadsheetID int64 SpreadsheetURL string Title string CSVPath string Components map[string]map[string][]ComponentCSV }
func NewComponentCSVHelper ¶ added in v0.7.14
func NewComponentCSVHelper(sheetURL, spreadsheetName string, spreadsheetID int64) (*ComponentCSVHelper, error)
func (ComponentCSVHelper) Cleanup ¶ added in v0.7.14
func (m ComponentCSVHelper) Cleanup() error
func (*ComponentCSVHelper) ParseComponentsSheet ¶ added in v0.7.14
func (mch *ComponentCSVHelper) ParseComponentsSheet() error
type Containers ¶ added in v0.5.3
type DockerCompose ¶ added in v0.5.1
type GoldenFile ¶ added in v0.5.26
type GoldenFile struct {
// contains filtered or unexported fields
}
func NewGoldenFile ¶ added in v0.5.26
func NewGoldenFile(t *testing.T, name string, directory string) *GoldenFile
func (*GoldenFile) LoadByte ¶ added in v0.5.26
func (tf *GoldenFile) LoadByte() []byte
Load a Golden file
func (*GoldenFile) Write ¶ added in v0.5.26
func (tf *GoldenFile) Write(content string)
write a Golden file
func (*GoldenFile) WriteInByte ¶ added in v0.5.26
func (tf *GoldenFile) WriteInByte(content []byte)
write a Golden file
type K8sCompose ¶ added in v0.5.3
type Manifest ¶ added in v0.5.1
type Manifest struct { Path string `json:"path,omitempty"` Mode string `json:"mode,omitempty"` Typ string `json:"type,omitempty"` SHA string `json:"sha,omitempty"` Size json.Number `json:"size,omitempty"` URL string `json:"url,omitempty"` }
func FetchManifests ¶ added in v0.5.2
FetchManifests is a wrapper function that identifies the required manifest files as downloads them
func ListManifests ¶ added in v0.5.1
ListManifests lists the manifest files stored in GitHub
type ManifestList ¶ added in v0.5.1
type ModelCSV ¶ added in v0.7.14
type ModelCSV struct { ModelDisplayName string `json:"modelDisplayName"` Model string `json:"model"` Registrant string `json:"registrant"` Category string `json:"category"` SubCategory string `json:"subCategory"` Description string `json:"description"` SourceURL string `json:"sourceURL"` Website string `json:"website"` Docs string `json:"docs"` Shape string `json:"shape"` PrimaryColor string `json:"primaryColor"` SecondaryColor string `json:"secondaryColor"` StyleOverrides string `json:"styleOverrides"` Styles string `json:"styles"` ShapePolygonPoints string `json:"shapePolygonPoints"` DefaultData string `json:"defaultData"` Capabilities string `json:"capabilities"` LogoURL string `json:"logoURL"` SVGColor string `json:"svgColor"` SVGWhite string `json:"svgWhite"` SVGComplete string `json:"svgComplete"` PublishToRegistry string `json:"publishToRegistry"` IsAnnotation string `json:"isAnnotation"` AboutProject string `json:"aboutProject"` PageSubtTitle string `json:"pageSubtitle"` DocsURL string `json:"docsURL"` StandardBlurb string `json:"standardBlurb"` Feature1 string `json:"feature1"` Feature2 string `json:"feature2"` Feature3 string `json:"feature3"` HowItWorks string `json:"howItWorks"` HowItWorksDetails string `json:"howItWorksDetails"` Screenshots string `json:"screenshots"` FullPage string `json:"fullPage"` PublishToSites string `json:"publishToSites"` }
func (ModelCSV) CreateJSONItem ¶ added in v0.7.14
Creates JSON formatted meshmodel attribute item for JSON Style docs
func (ModelCSV) CreateMarkDownForMDStyle ¶ added in v0.7.14
func (ModelCSV) CreateMarkDownForMDXStyle ¶ added in v0.7.14
template := `--- title: <model-display-name> subtitle: <Page Subtitle> integrationIcon: ../../../assets/images/service-mesh-icons/aws-app-mesh.svg darkModeIntegrationIcon: ../../../assets/images/service-mesh-icons/aws-app-mesh_white.svg docURL: <Docs URL> category: <Category> subcategory: <Sub-Category> featureList: [<Feature 1>,<Feature 2>,<Feature 3>] workingSlides: [
../_images/meshmap-visualizer.png, ../_images/meshmap-designer.png]
howItWorks: <howItWorks> howItWorksDetails: howItWorksDetails published: <Publish> --- <p>
<About Project>
</p> <p>
<Standard Blurb>
</p>`
type ModelCSVHelper ¶ added in v0.7.14
type ModelCSVHelper struct { SpreadsheetID int64 SpreadsheetURL string Title string CSVPath string Models []ModelCSV }
func NewModelCSVHelper ¶ added in v0.7.14
func NewModelCSVHelper(sheetURL, spreadsheetName string, spreadsheetID int64) (*ModelCSVHelper, error)
func (ModelCSVHelper) Cleanup ¶ added in v0.7.14
func (m ModelCSVHelper) Cleanup() error
func (*ModelCSVHelper) ParseModelsSheet ¶ added in v0.7.14
func (mch *ModelCSVHelper) ParseModelsSheet() error
type Paginator ¶ added in v0.7.13
type Paginator struct {
// contains filtered or unexported fields
}
func NewPaginator ¶ added in v0.7.13
type PortForward ¶ added in v0.6.2
type PortForward struct {
// contains filtered or unexported fields
}
PortForward provides a port-forward connection into a Kubernetes cluster.
func NewPortForward ¶ added in v0.6.2
func NewPortForward( ctx context.Context, client *meshkitkube.Client, namespace, deployName string, host string, localPort, remotePort int, emitLogs bool, ) (*PortForward, error)
NewPortForward returns an instance of the PortForward struct that can be used to establish a port-forward connection to a pod in the deployment that's specified by namespace and deployName. If localPort is 0, it will use a random ephemeral port. Note that the connection remains open for the life of the process, as this function is typically called by the CLI.
func (*PortForward) AddressAndPort ¶ added in v0.6.2
func (pf *PortForward) AddressAndPort() string
AddressAndPort returns the address and port for the port-forward connection.
func (*PortForward) GetStop ¶ added in v0.6.2
func (pf *PortForward) GetStop() <-chan struct{}
GetStop returns the stopCh. Receiving on stopCh will block until the port forwarding stops.
func (*PortForward) Init ¶ added in v0.6.2
func (pf *PortForward) Init() error
Init creates and runs a port-forward connection. This function blocks until the connection is established, in which case it returns nil. It's the caller's responsibility to call Stop() to finish the connection.
func (*PortForward) Stop ¶ added in v0.6.2
func (pf *PortForward) Stop()
Stop terminates the port-forward connection. It is the caller's responsibility to call Stop even in case of errors
func (*PortForward) URLFor ¶ added in v0.6.2
func (pf *PortForward) URLFor(path string) string
URLFor returns the URL for the port-forward connection.
type SystemType ¶ added in v0.7.14
type SystemType int
const ( Meshery SystemType = iota Docs RemoteProvider )
func (SystemType) String ¶ added in v0.7.14
func (dt SystemType) String() string
type Template ¶ added in v0.5.3
type Template struct { Metadata interface{} `yaml:"metadata,omitempty"` Spec TemplateSpec `yaml:"spec,omitempty"` }
type TemplateSpec ¶ added in v0.5.3
type TemplateSpec struct { ServiceAccount string `yaml:"serviceAccount,omitempty"` ServiceAccountName string `yaml:"serviceAccountName,omitempty"` Containers []Containers `yaml:"containers,omitempty"` RestartPolicy string `yaml:"restartPolicy,omitempty"` }
type TerminalFormatter ¶ added in v0.5.26
type TerminalFormatter struct{}
TerminalFormatter is exported
type TestHelper ¶ added in v0.5.26
func NewTestHelper ¶ added in v0.5.26
func NewTestHelper(_ *testing.T) *TestHelper