mesh

package
v0.0.0-...-9e9d5e8 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrGettingSessionDataCode                = "1098"
	ErrNoAdaptersCode                        = "1099"
	ErrPromptCode                            = "1100"
	ErrCreatingDeployRequestCode             = "1101"
	ErrCreatingDeployResponseRequestCode     = "1102"
	ErrCreatingDeployResponseStreamCode      = "1103"
	ErrCreatingValidateResponseStreamCode    = "1104"
	ErrTimeoutWaitingForDeployResponseCode   = "1105"
	ErrFailedDeployingMeshCode               = "1106"
	ErrCreatingValidateRequestCode           = "1107"
	ErrCreatingValidateResponseRequestCode   = "1108"
	ErrTimeoutWaitingForValidateResponseCode = "1109"
	ErrSMIConformanceTestsFailedCode         = "1110"
	ErrValidateAdapterCode                   = "1111"
	ErrSendOperationCode                     = "1112"
	ErrValidMeshNameCode                     = "1113"
	ErrWaitValidateResponseCode              = "1114"
)

Please reference the following before contributing an error code: https://docs.khulnasoft.com/project/contributing/contributing-error https://github.com/khulnasoft/meshkit/blob/master/errors/errors.go

Variables

View Source
var (
	// no adapters found
	ErrNoAdapters = errors.New(ErrNoAdaptersCode, errors.Fatal,
		[]string{"Unable to validate adapter"},
		[]string{"Adapter for required mesh not found"},
		[]string{"Unable to fetch Mesh adapter, adapter not valid."},
		[]string{"Deploy a proper Meshplay Adapter for your service mesh. See https://docs.khulnasoft.com/concepts/architecture/adapters for list of adapters"})

	ErrFailedDeployingMesh = errors.New(ErrFailedDeployingMeshCode, errors.Fatal,
		[]string{"Failed to deploy the service mesh"},
		[]string{"Failed to deploy the service mesh"},
		[]string{"Network error or wrong environment configurations"},
		[]string{"Ensure your have a strong connection and the right environment configuration"})

	ErrTimeoutWaitingForDeployResponse = errors.New(ErrTimeoutWaitingForDeployResponseCode, errors.Fatal,
		[]string{"Timed out waiting for deploy event"},
		[]string{"Timed out waiting for deployment"},
		[]string{"Network error or wrong environment configurations"},
		[]string{"Ensure your have a strong connection and the right environment configuration"})

	ErrTimeoutWaitingForValidateResponse = errors.New(ErrTimeoutWaitingForValidateResponseCode, errors.Fatal,
		[]string{"Timed out waiting for validate response"},
		[]string{"Timed out waiting for validate response"},
		[]string{"Network error or wrong environment configurations"},
		[]string{"Ensure your have a strong connection and the right environment configuration"})

	ErrSMIConformanceTestsFailed = errors.New(ErrSMIConformanceTestsFailedCode, errors.Fatal, []string{"SMI conformance tests failed"}, []string{"SMI conformance tests failed"}, []string{}, []string{"Join https://khulnasoft.slack.com/archives/C010H0HE2E6"})
)
View Source
var (
	MeshCmd = &cobra.Command{
		Use:   "mesh",
		Short: "Cloud Native Lifecycle Management",
		Long: `Provisioning, configuration, and on-going operational management of service meshes.
	Find more information at: https://docs.khulnasoft.com/reference/meshplayctl#command-reference`,
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

			if cmd.HasSubCommands() {
				return cmd.Help()
			}

			mctlCfg, err = config.GetMeshplayCtl(viper.GetViper())
			if err != nil {
				utils.Log.Error(err)
				return nil
			}

			if len(args) > 0 {

				r, _ := regexp.Compile(`\W`)

				if len(args) == 1 {
					meshName = strings.ToUpper(args[0])
				}
				meshName = r.ReplaceAllString(strings.ToUpper(strings.Join(args, "_")), "_")
			}

			meshName, err = validateMesh(mctlCfg, meshName)
			if err != nil {
				utils.Log.Error(err)
			}

			if err = validateAdapter(mctlCfg, meshName); err != nil {
				utils.Log.Error(err)
			}
			return nil
		},
	}
)

MeshCmd represents the Performance Management CLI command

Functions

func ErrCreatingDeployRequest

func ErrCreatingDeployRequest(err error) error

func ErrCreatingDeployResponseRequest

func ErrCreatingDeployResponseRequest(err error) error

func ErrCreatingDeployResponseStream

func ErrCreatingDeployResponseStream(err error) error

func ErrCreatingValidateRequest

func ErrCreatingValidateRequest(err error) error

func ErrCreatingValidateResponseRequest

func ErrCreatingValidateResponseRequest(err error) error

func ErrCreatingValidateResponseStream

func ErrCreatingValidateResponseStream(err error) error

func ErrGettingSessionData

func ErrGettingSessionData(err error) error

When unable to get release data

func ErrPrompt

func ErrPrompt(err error) error

func ErrSendOperation

func ErrSendOperation(err error) error

func ErrValidMeshName

func ErrValidMeshName(meshName string) error

func ErrValidatingAdapters

func ErrValidatingAdapters(err error) error

func ErrWaitValidateResponse

func ErrWaitValidateResponse(err error) error

Types

type Operation

type Operation struct {
	Adapter    string `json:"adapter"`
	CustomBody string `json:"customBody"`
	DeleteOp   string `json:"deleteOp"`
	Namespace  string `json:"namespace"`
	Query      string `json:"query"`
}

Operation is the common body type to be passed for Mesh Ops

Jump to

Keyboard shortcuts

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