cmd

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

* Copyright 1999-2020 Alibaba Group Holding Ltd. * * 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 1999-2020 Alibaba Group Holding Ltd. * * 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 1999-2020 Alibaba Group Holding Ltd. * * 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 (
	BladeBin        = "blade"
	OperatorCommand = "operator"
)
View Source
const (
	ForceRemoveFlag = "force-remove"
	ExpTargetFlag   = "target"
	KubeconfigFlag  = "kubeconfig"
)
View Source
const (
	PrepareJvmType   = "jvm"
	PrepareK8sType   = "k8s"
	PrepareCPlusType = "cplus"
)
View Source
const (
	Created   = "Created"
	Success   = "Success"
	Running   = "Running"
	Error     = "Error"
	Destroyed = "Destroyed"
	Revoked   = "Revoked"
)
View Source
const AsyncFlag = "async"
View Source
const EndpointFlag = "endpoint"
View Source
const InterfaceArg = "interface"
View Source
const MountPointArg = "mount-point"
View Source
const NohupFlag = "nohup"
View Source
const UidFlag = "uid"

Variables

View Source
var AllCheckExecCmds []CheckExecCmd
View Source
var AllCheckModels *spec.Models
View Source
var BladeBinPath string

Functions

func CmdInit

func CmdInit() *baseCommand

func GetDS

func GetDS() data.SourceI

GetDS returns dataSource

func GetResourceFlags added in v1.7.0

func GetResourceFlags() []spec.ExpFlagSpec

func Register

func Register(requestPath string)

func SetDS

func SetDS(source data.SourceI)

SetDS for test

Types

type CheckCommand added in v1.2.0

type CheckCommand struct {
	// contains filtered or unexported fields
}

func (*CheckCommand) AddCommand added in v1.2.0

func (bc *CheckCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*CheckCommand) CobraCmd added in v1.2.0

func (bc *CheckCommand) CobraCmd() *cobra.Command

func (CheckCommand) GetExecutor added in v1.2.0

func (ec CheckCommand) GetExecutor(target, actionTarget, action string) spec.Executor

func (*CheckCommand) Init added in v1.2.0

func (dc *CheckCommand) Init()

func (*CheckCommand) Name added in v1.2.0

func (bc *CheckCommand) Name() string

type CheckExecCmd added in v1.2.0

type CheckExecCmd struct {
	ExpName    string
	ActionName string
	Scope      string
	ExecResult []*ExecResult
}

type CheckJavaCommand added in v1.2.0

type CheckJavaCommand struct {
	// contains filtered or unexported fields
}

func (*CheckJavaCommand) CobraCmd added in v1.2.0

func (djc *CheckJavaCommand) CobraCmd() *cobra.Command

func (*CheckJavaCommand) Init added in v1.2.0

func (djc *CheckJavaCommand) Init()

func (*CheckJavaCommand) Name added in v1.2.0

func (djc *CheckJavaCommand) Name() string

type CheckOsCommand added in v1.2.0

type CheckOsCommand struct {
	// contains filtered or unexported fields
}

func (*CheckOsCommand) CobraCmd added in v1.2.0

func (doc *CheckOsCommand) CobraCmd() *cobra.Command

func (CheckOsCommand) GetExecutor added in v1.2.0

func (ec CheckOsCommand) GetExecutor(target, actionTarget, action string) spec.Executor

func (*CheckOsCommand) Init added in v1.2.0

func (doc *CheckOsCommand) Init()

func (*CheckOsCommand) Name added in v1.2.0

func (doc *CheckOsCommand) Name() string

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

func NewCli

func NewCli() *Cli

NewCli returns the cli instance used to register and execute command

func (*Cli) Run

func (cli *Cli) Run() error

Run command

type Command

type Command interface {
	// Init command
	Init()

	// CobraCmd
	CobraCmd() *cobra.Command

	// Name
	Name() string
}

Command is cli command interface

type CreateCommand

type CreateCommand struct {
	// contains filtered or unexported fields
}

CreateCommand for create experiment

func (*CreateCommand) AddCommand

func (bc *CreateCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*CreateCommand) CobraCmd

func (bc *CreateCommand) CobraCmd() *cobra.Command

func (CreateCommand) GetExecutor added in v0.4.0

func (ec CreateCommand) GetExecutor(target, actionTarget, action string) spec.Executor

func (*CreateCommand) Init

func (cc *CreateCommand) Init()

func (*CreateCommand) Name

func (bc *CreateCommand) Name() string

type DestroyCommand

type DestroyCommand struct {
	// contains filtered or unexported fields
}

func (*DestroyCommand) AddCommand

func (bc *DestroyCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*DestroyCommand) CobraCmd

func (bc *DestroyCommand) CobraCmd() *cobra.Command

func (DestroyCommand) GetExecutor added in v0.4.0

func (ec DestroyCommand) GetExecutor(target, actionTarget, action string) spec.Executor

func (*DestroyCommand) Init

func (dc *DestroyCommand) Init()

func (*DestroyCommand) Name

func (bc *DestroyCommand) Name() string

type ExecResult added in v1.2.0

type ExecResult struct {
	// contains filtered or unexported fields
}

type ExpActionFlags

type ExpActionFlags struct {
	// ActionFlags cache action flags, contains name key and description value
	ActionFlags map[string]func() string

	// MatcherFlags cache matcher flags, contains name key and description value
	MatcherFlags map[string]func() string
}

ExpActionFlags is used to receive experiment action flags

type ExpFlags

type ExpFlags struct {
	// Target is experiment target, for example dubbo
	Target string

	// Scope
	Scope string

	// Actions cache action name and flags
	Actions map[string]*ExpActionFlags

	// CommandFlags
	CommandFlags map[string]func() string
}

expFlags is used to receive experiment flags

type PrepareCPlusCommand

type PrepareCPlusCommand struct {
	// contains filtered or unexported fields
}

func (*PrepareCPlusCommand) AddCommand

func (bc *PrepareCPlusCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*PrepareCPlusCommand) CobraCmd

func (bc *PrepareCPlusCommand) CobraCmd() *cobra.Command

func (*PrepareCPlusCommand) Init

func (pc *PrepareCPlusCommand) Init()

func (*PrepareCPlusCommand) Name

func (bc *PrepareCPlusCommand) Name() string

type PrepareCommand

type PrepareCommand struct {
	// contains filtered or unexported fields
}

PrepareCommand defines attach command

func (*PrepareCommand) AddCommand

func (bc *PrepareCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*PrepareCommand) CobraCmd

func (bc *PrepareCommand) CobraCmd() *cobra.Command

func (*PrepareCommand) Init

func (pc *PrepareCommand) Init()

Init attach command operators includes create instance and bind flags

func (*PrepareCommand) Name

func (bc *PrepareCommand) Name() string

type PrepareJvmCommand

type PrepareJvmCommand struct {
	// contains filtered or unexported fields
}

func (*PrepareJvmCommand) AddCommand

func (bc *PrepareJvmCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*PrepareJvmCommand) CobraCmd

func (bc *PrepareJvmCommand) CobraCmd() *cobra.Command

func (*PrepareJvmCommand) Init

func (pc *PrepareJvmCommand) Init()

func (*PrepareJvmCommand) ManualPreparation added in v0.8.0

func (pc *PrepareJvmCommand) ManualPreparation(ctx context.Context, record *data.PreparationRecord, err error) (*data.PreparationRecord, error)

func (*PrepareJvmCommand) Name

func (bc *PrepareJvmCommand) Name() string

type QueryCommand

type QueryCommand struct {
	// contains filtered or unexported fields
}

QueryCommand defines query command

func (*QueryCommand) AddCommand

func (bc *QueryCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*QueryCommand) CobraCmd

func (bc *QueryCommand) CobraCmd() *cobra.Command

func (*QueryCommand) Init

func (qc *QueryCommand) Init()

Init attach command operators includes create instance and bind flags

func (*QueryCommand) Name

func (bc *QueryCommand) Name() string

type QueryDiskCommand

type QueryDiskCommand struct {
	// contains filtered or unexported fields
}

func (*QueryDiskCommand) AddCommand

func (bc *QueryDiskCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*QueryDiskCommand) CobraCmd

func (bc *QueryDiskCommand) CobraCmd() *cobra.Command

func (*QueryDiskCommand) Init

func (qdc *QueryDiskCommand) Init()

func (*QueryDiskCommand) Name

func (bc *QueryDiskCommand) Name() string

type QueryJvmCommand

type QueryJvmCommand struct {
	// contains filtered or unexported fields
}

func (*QueryJvmCommand) AddCommand

func (bc *QueryJvmCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*QueryJvmCommand) CobraCmd

func (bc *QueryJvmCommand) CobraCmd() *cobra.Command

func (*QueryJvmCommand) Init

func (qjc *QueryJvmCommand) Init()

func (*QueryJvmCommand) Name

func (bc *QueryJvmCommand) Name() string

type QueryK8sCommand added in v0.4.0

type QueryK8sCommand struct {
	// contains filtered or unexported fields
}

func (*QueryK8sCommand) AddCommand added in v0.4.0

func (bc *QueryK8sCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*QueryK8sCommand) CobraCmd added in v0.4.0

func (bc *QueryK8sCommand) CobraCmd() *cobra.Command

func (*QueryK8sCommand) Init added in v0.4.0

func (q *QueryK8sCommand) Init()

func (*QueryK8sCommand) Name added in v0.4.0

func (bc *QueryK8sCommand) Name() string

type QueryNetworkCommand

type QueryNetworkCommand struct {
	// contains filtered or unexported fields
}

func (*QueryNetworkCommand) AddCommand

func (bc *QueryNetworkCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*QueryNetworkCommand) CobraCmd

func (bc *QueryNetworkCommand) CobraCmd() *cobra.Command

func (*QueryNetworkCommand) Init

func (qnc *QueryNetworkCommand) Init()

func (*QueryNetworkCommand) Name

func (bc *QueryNetworkCommand) Name() string

type RevokeCommand

type RevokeCommand struct {
	// contains filtered or unexported fields
}

func (*RevokeCommand) AddCommand

func (bc *RevokeCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*RevokeCommand) CobraCmd

func (bc *RevokeCommand) CobraCmd() *cobra.Command

func (*RevokeCommand) Init

func (rc *RevokeCommand) Init()

func (*RevokeCommand) Name

func (bc *RevokeCommand) Name() string

type ServerCommand

type ServerCommand struct {
	// contains filtered or unexported fields
}

func (*ServerCommand) AddCommand

func (bc *ServerCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*ServerCommand) CobraCmd

func (bc *ServerCommand) CobraCmd() *cobra.Command

func (*ServerCommand) Init

func (sc *ServerCommand) Init()

func (*ServerCommand) Name

func (bc *ServerCommand) Name() string

type StartServerCommand

type StartServerCommand struct {
	// contains filtered or unexported fields
}

func (*StartServerCommand) AddCommand

func (bc *StartServerCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*StartServerCommand) CobraCmd

func (bc *StartServerCommand) CobraCmd() *cobra.Command

func (*StartServerCommand) Init

func (ssc *StartServerCommand) Init()

func (*StartServerCommand) Name

func (bc *StartServerCommand) Name() string

type StatusCommand

type StatusCommand struct {
	// contains filtered or unexported fields
}

func (*StatusCommand) AddCommand

func (bc *StatusCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*StatusCommand) CobraCmd

func (bc *StatusCommand) CobraCmd() *cobra.Command

func (*StatusCommand) Init

func (sc *StatusCommand) Init()

func (*StatusCommand) Name

func (bc *StatusCommand) Name() string

type StatusServerCommand added in v0.5.0

type StatusServerCommand struct {
	// contains filtered or unexported fields
}

func (*StatusServerCommand) AddCommand added in v0.5.0

func (bc *StatusServerCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*StatusServerCommand) CobraCmd added in v0.5.0

func (bc *StatusServerCommand) CobraCmd() *cobra.Command

func (*StatusServerCommand) Init added in v0.5.0

func (ssc *StatusServerCommand) Init()

func (*StatusServerCommand) Name added in v0.5.0

func (bc *StatusServerCommand) Name() string

type StopServerCommand

type StopServerCommand struct {
	// contains filtered or unexported fields
}

func (*StopServerCommand) AddCommand

func (bc *StopServerCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*StopServerCommand) CobraCmd

func (bc *StopServerCommand) CobraCmd() *cobra.Command

func (*StopServerCommand) Init

func (ssc *StopServerCommand) Init()

func (*StopServerCommand) Name

func (bc *StopServerCommand) Name() string

type VersionCommand

type VersionCommand struct {
	// contains filtered or unexported fields
}

func (*VersionCommand) AddCommand

func (bc *VersionCommand) AddCommand(child Command)

AddCommand is add child command to the parent command

func (*VersionCommand) CobraCmd

func (bc *VersionCommand) CobraCmd() *cobra.Command

func (*VersionCommand) Init

func (vc *VersionCommand) Init()

func (*VersionCommand) Name

func (bc *VersionCommand) Name() string

Jump to

Keyboard shortcuts

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