cmd

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const IdeServer string = "codesphere-ide"

Variables

This section is empty.

Functions

func AddCreateCmd added in v0.4.0

func AddCreateCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddCreateWorkspaceCmd added in v0.4.0

func AddCreateWorkspaceCmd(create *cobra.Command, opts GlobalOptions)

func AddDeleteCmd added in v0.6.0

func AddDeleteCmd(rootCmd *cobra.Command, opt GlobalOptions)

func AddDeleteWorkspaceCmd added in v0.6.0

func AddDeleteWorkspaceCmd(delete *cobra.Command, opts GlobalOptions)

func AddExecCmd added in v0.3.0

func AddExecCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddGenerateCmd added in v0.9.0

func AddGenerateCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddGenerateDockerCmd added in v0.11.0

func AddGenerateDockerCmd(generate *cobra.Command, opts *GenerateOpts)

func AddGenerateImagesCmd added in v0.11.0

func AddGenerateImagesCmd(generate *cobra.Command, opts *GenerateOpts)

func AddGenerateKubernetesCmd added in v0.11.0

func AddGenerateKubernetesCmd(generate *cobra.Command, opts *GenerateOpts)

func AddGitCmd added in v0.10.0

func AddGitCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddGitPullCmd added in v0.10.0

func AddGitPullCmd(git *cobra.Command, opts GlobalOptions)

func AddGoCmd added in v0.9.0

func AddGoCmd(rootCmd *cobra.Command)

func AddLicensesCmd

func AddLicensesCmd(rootCmd *cobra.Command)

func AddListCmd

func AddListCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddListPlansCmd added in v0.4.0

func AddListPlansCmd(list *cobra.Command, opts GlobalOptions)

func AddLogCmd

func AddLogCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddMonitorCmd added in v0.9.0

func AddMonitorCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddOpenCmd added in v0.3.0

func AddOpenCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddOpenWorkspaceCmd added in v0.3.0

func AddOpenWorkspaceCmd(open *cobra.Command, opts GlobalOptions)

func AddSetEnvVarCmd

func AddSetEnvVarCmd(p *cobra.Command, opts GlobalOptions)

func AddStartCmd added in v0.6.0

func AddStartCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddStartPipelineCmd added in v0.6.0

func AddStartPipelineCmd(start *cobra.Command, opts GlobalOptions)

func AddUpdateCmd added in v0.9.0

func AddUpdateCmd(rootCmd *cobra.Command)

func AddVersionCmd

func AddVersionCmd(rootCmd *cobra.Command)

func Execute

func Execute()

func GetRootCmd

func GetRootCmd() *cobra.Command

func SelfUpdate added in v0.9.0

func SelfUpdate() error

Types

type Browser added in v0.3.0

type Browser interface {
	OpenIde(path string) error
}

type Client

type Client interface {
	ListTeams() ([]api.Team, error)
	ListWorkspaces(teamId int) ([]api.Workspace, error)
	GetWorkspace(workspaceId int) (api.Workspace, error)
	SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error
	ExecCommand(workspaceId int, command string, workdir string, env map[string]string) (string, string, error)
	ListWorkspacePlans() ([]api.WorkspacePlan, error)
	DeployWorkspace(args api.DeployWorkspaceArgs) (*api.Workspace, error)
	DeleteWorkspace(wsId int) error
	StartPipelineStage(wsId int, profile string, stage string) error
	GetPipelineState(wsId int, stage string) ([]api.PipelineStatus, error)
	GitPull(wsId int, remote string, branch string) error
}

func NewClient

func NewClient(opts GlobalOptions) (Client, error)

type CreateCmd added in v0.4.0

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

type CreateWorkspaceCmd added in v0.4.0

type CreateWorkspaceCmd struct {
	Opts CreateWorkspaceOpts
	// contains filtered or unexported fields
}

func (*CreateWorkspaceCmd) CreateWorkspace added in v0.4.0

func (c *CreateWorkspaceCmd) CreateWorkspace(client Client, teamId int, wsName string) (*api.Workspace, error)

func (*CreateWorkspaceCmd) RunE added in v0.4.0

func (c *CreateWorkspaceCmd) RunE(_ *cobra.Command, args []string) error

type CreateWorkspaceOpts added in v0.4.0

type CreateWorkspaceOpts struct {
	GlobalOptions
	Repo    *string
	Vpn     *string
	Env     *[]string
	Plan    *int
	Private *bool
	Timeout *time.Duration
	Branch  *string
}

type DeleteCmd added in v0.6.0

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

type DeleteWorkspaceCmd added in v0.6.0

type DeleteWorkspaceCmd struct {
	Opts   DeleteWorkspaceOpts
	Prompt Prompt
	// contains filtered or unexported fields
}

func (*DeleteWorkspaceCmd) DeleteWorkspace added in v0.6.0

func (c *DeleteWorkspaceCmd) DeleteWorkspace(client Client, wsId int) error

func (*DeleteWorkspaceCmd) RunE added in v0.6.0

func (c *DeleteWorkspaceCmd) RunE(_ *cobra.Command, args []string) error

type DeleteWorkspaceOpts added in v0.6.0

type DeleteWorkspaceOpts struct {
	GlobalOptions
	Confirmed *bool
}

type Env

type Env interface {
	GetApiToken() (string, error)
	GetTeamId() (int, error)
	GetWorkspaceId() (int, error)
	GetApiUrl() string
}

type ErrResponse

type ErrResponse struct {
	Status  int    `json:"status"`
	Title   string `json:"title"`
	Detail  string `json:"detail"`
	TraceId string `json:"traceId"`
}

type ExecCmd added in v0.3.0

type ExecCmd struct {
	Opts ExecOptions
	// contains filtered or unexported fields
}

func (*ExecCmd) ExecCommand added in v0.3.0

func (c *ExecCmd) ExecCommand(client Client, command string) error

func (*ExecCmd) RunE added in v0.3.0

func (c *ExecCmd) RunE(_ *cobra.Command, args []string) error

type ExecOptions added in v0.3.0

type ExecOptions struct {
	GlobalOptions
	EnvVar  *[]string
	WorkDir *string
}

type GenerateCmd added in v0.9.0

type GenerateCmd struct {
	Opts *GenerateOpts
	// contains filtered or unexported fields
}

type GenerateDockerCmd added in v0.11.0

type GenerateDockerCmd struct {
	Opts *GenerateDockerOpts
	// contains filtered or unexported fields
}

func (*GenerateDockerCmd) CloneRepository added in v0.11.0

func (c *GenerateDockerCmd) CloneRepository(client Client, fs *cs.FileSystem, git git.Git, clonedir string) error

func (*GenerateDockerCmd) GenerateDocker added in v0.11.0

func (c *GenerateDockerCmd) GenerateDocker(fs *cs.FileSystem, exp exporter.Exporter, git git.Git, csClient Client) error

func (*GenerateDockerCmd) RunE added in v0.11.0

func (c *GenerateDockerCmd) RunE(cc *cobra.Command, args []string) error

type GenerateDockerOpts added in v0.11.0

type GenerateDockerOpts struct {
	*GenerateOpts
	BaseImage string
	Envs      []string
}

type GenerateImagesCmd added in v0.11.0

type GenerateImagesCmd struct {
	Opts *GenerateImagesOpts
	// contains filtered or unexported fields
}

func (*GenerateImagesCmd) GenerateImages added in v0.11.0

func (c *GenerateImagesCmd) GenerateImages(fs *cs.FileSystem, exp exporter.Exporter) error

func (*GenerateImagesCmd) RunE added in v0.11.0

func (c *GenerateImagesCmd) RunE(_ *cobra.Command, args []string) error

type GenerateImagesOpts added in v0.11.0

type GenerateImagesOpts struct {
	*GenerateOpts
	Registry    string
	ImagePrefix string
}

type GenerateKubernetesCmd added in v0.11.0

type GenerateKubernetesCmd struct {
	Opts *GenerateKubernetesOpts
	// contains filtered or unexported fields
}

func (*GenerateKubernetesCmd) GenerateKubernetes added in v0.11.0

func (c *GenerateKubernetesCmd) GenerateKubernetes(fs *cs.FileSystem, exp exporter.Exporter) error

func (*GenerateKubernetesCmd) RunE added in v0.11.0

func (c *GenerateKubernetesCmd) RunE(_ *cobra.Command, args []string) error

type GenerateKubernetesOpts added in v0.11.0

type GenerateKubernetesOpts struct {
	*GenerateOpts
	Registry     string
	ImagePrefix  string
	Namespace    string
	PullSecret   string
	Hostname     string
	IngressClass string
}

type GenerateOpts added in v0.11.0

type GenerateOpts struct {
	GlobalOptions
	Input    string
	Branch   string
	Output   string
	Force    bool
	RepoRoot string
}

type GitCmd added in v0.10.0

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

type GitPullCmd added in v0.10.0

type GitPullCmd struct {
	Opts GitPullOpts
	// contains filtered or unexported fields
}

GitPullCmd represents the pull command

func (*GitPullCmd) RunE added in v0.10.0

func (c *GitPullCmd) RunE(_ *cobra.Command, args []string) error

type GitPullOpts added in v0.10.0

type GitPullOpts struct {
	GlobalOptions
	Remote *string
	Branch *string
}

type GlobalOptions

type GlobalOptions struct {
	ApiUrl      *string
	TeamId      *int
	WorkspaceId *int
	Env         Env
	Verbose     *bool
}

func (GlobalOptions) GetApiUrl

func (o GlobalOptions) GetApiUrl() string

func (GlobalOptions) GetTeamId

func (o GlobalOptions) GetTeamId() (int, error)

func (GlobalOptions) GetWorkspaceId

func (o GlobalOptions) GetWorkspaceId() (int, error)

type GoCmd added in v0.9.0

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

func (*GoCmd) RunE added in v0.9.0

func (c *GoCmd) RunE(_ *cobra.Command, args []string) error

type LicensesCmd

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

func (*LicensesCmd) RunE

func (c *LicensesCmd) RunE(_ *cobra.Command, args []string) error

type ListCmd

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

type ListPlansCmd added in v0.4.0

type ListPlansCmd struct {
	Opts GlobalOptions
	// contains filtered or unexported fields
}

func (*ListPlansCmd) RunE added in v0.4.0

func (c *ListPlansCmd) RunE(_ *cobra.Command, args []string) error

type ListTeamsCmd

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

func (*ListTeamsCmd) RunE

func (l *ListTeamsCmd) RunE(_ *cobra.Command, args []string) (err error)

type ListWorkspacesCmd

type ListWorkspacesCmd struct {
	Opts GlobalOptions
	// contains filtered or unexported fields
}

func (*ListWorkspacesCmd) ListWorkspaces

func (l *ListWorkspacesCmd) ListWorkspaces(client Client) ([]api.Workspace, error)

func (*ListWorkspacesCmd) RunE

func (l *ListWorkspacesCmd) RunE(_ *cobra.Command, args []string) (err error)

type LogCmd

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

func (*LogCmd) RunE

func (l *LogCmd) RunE(_ *cobra.Command, args []string) (err error)

type LogCmdScope

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

type LogEntry

type LogEntry struct {
	Timestamp string `json:"timestamp"`
	Kind      string `json:"kind"`
	Data      string `json:"data"`
}

type MockBrowser added in v0.3.0

type MockBrowser struct {
	mock.Mock
}

MockBrowser is an autogenerated mock type for the Browser type

func NewMockBrowser added in v0.3.0

func NewMockBrowser(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBrowser

NewMockBrowser creates a new instance of MockBrowser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockBrowser) EXPECT added in v0.3.0

func (_m *MockBrowser) EXPECT() *MockBrowser_Expecter

func (*MockBrowser) OpenIde added in v0.3.0

func (_mock *MockBrowser) OpenIde(path string) error

OpenIde provides a mock function for the type MockBrowser

type MockBrowser_Expecter added in v0.3.0

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

func (*MockBrowser_Expecter) OpenIde added in v0.3.0

func (_e *MockBrowser_Expecter) OpenIde(path interface{}) *MockBrowser_OpenIde_Call

OpenIde is a helper method to define mock.On call

  • path

type MockBrowser_OpenIde_Call added in v0.3.0

type MockBrowser_OpenIde_Call struct {
	*mock.Call
}

MockBrowser_OpenIde_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenIde'

func (*MockBrowser_OpenIde_Call) Return added in v0.3.0

func (*MockBrowser_OpenIde_Call) Run added in v0.3.0

func (_c *MockBrowser_OpenIde_Call) Run(run func(path string)) *MockBrowser_OpenIde_Call

func (*MockBrowser_OpenIde_Call) RunAndReturn added in v0.3.0

func (_c *MockBrowser_OpenIde_Call) RunAndReturn(run func(path string) error) *MockBrowser_OpenIde_Call

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClient) DeleteWorkspace added in v0.6.0

func (_mock *MockClient) DeleteWorkspace(wsId int) error

DeleteWorkspace provides a mock function for the type MockClient

func (*MockClient) DeployWorkspace added in v0.4.0

func (_mock *MockClient) DeployWorkspace(args api.DeployWorkspaceArgs) (*api.Workspace, error)

DeployWorkspace provides a mock function for the type MockClient

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) ExecCommand added in v0.3.0

func (_mock *MockClient) ExecCommand(workspaceId int, command string, workdir string, env map[string]string) (string, string, error)

ExecCommand provides a mock function for the type MockClient

func (*MockClient) GetPipelineState added in v0.6.0

func (_mock *MockClient) GetPipelineState(wsId int, stage string) ([]api.PipelineStatus, error)

GetPipelineState provides a mock function for the type MockClient

func (*MockClient) GetWorkspace added in v0.3.0

func (_mock *MockClient) GetWorkspace(workspaceId int) (api.Workspace, error)

GetWorkspace provides a mock function for the type MockClient

func (*MockClient) GitPull added in v0.10.0

func (_mock *MockClient) GitPull(wsId int, remote string, branch string) error

GitPull provides a mock function for the type MockClient

func (*MockClient) ListTeams

func (_mock *MockClient) ListTeams() ([]api.Team, error)

ListTeams provides a mock function for the type MockClient

func (*MockClient) ListWorkspacePlans added in v0.4.0

func (_mock *MockClient) ListWorkspacePlans() ([]api.WorkspacePlan, error)

ListWorkspacePlans provides a mock function for the type MockClient

func (*MockClient) ListWorkspaces

func (_mock *MockClient) ListWorkspaces(teamId int) ([]api.Workspace, error)

ListWorkspaces provides a mock function for the type MockClient

func (*MockClient) SetEnvVarOnWorkspace

func (_mock *MockClient) SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error

SetEnvVarOnWorkspace provides a mock function for the type MockClient

func (*MockClient) StartPipelineStage added in v0.6.0

func (_mock *MockClient) StartPipelineStage(wsId int, profile string, stage string) error

StartPipelineStage provides a mock function for the type MockClient

type MockClient_DeleteWorkspace_Call added in v0.6.0

type MockClient_DeleteWorkspace_Call struct {
	*mock.Call
}

MockClient_DeleteWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteWorkspace'

func (*MockClient_DeleteWorkspace_Call) Return added in v0.6.0

func (*MockClient_DeleteWorkspace_Call) Run added in v0.6.0

func (*MockClient_DeleteWorkspace_Call) RunAndReturn added in v0.6.0

type MockClient_DeployWorkspace_Call added in v0.4.0

type MockClient_DeployWorkspace_Call struct {
	*mock.Call
}

MockClient_DeployWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeployWorkspace'

func (*MockClient_DeployWorkspace_Call) Return added in v0.4.0

func (*MockClient_DeployWorkspace_Call) Run added in v0.4.0

func (*MockClient_DeployWorkspace_Call) RunAndReturn added in v0.4.0

type MockClient_ExecCommand_Call added in v0.3.0

type MockClient_ExecCommand_Call struct {
	*mock.Call
}

MockClient_ExecCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecCommand'

func (*MockClient_ExecCommand_Call) Return added in v0.3.0

func (*MockClient_ExecCommand_Call) Run added in v0.3.0

func (_c *MockClient_ExecCommand_Call) Run(run func(workspaceId int, command string, workdir string, env map[string]string)) *MockClient_ExecCommand_Call

func (*MockClient_ExecCommand_Call) RunAndReturn added in v0.3.0

func (_c *MockClient_ExecCommand_Call) RunAndReturn(run func(workspaceId int, command string, workdir string, env map[string]string) (string, string, error)) *MockClient_ExecCommand_Call

type MockClient_Expecter

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

func (*MockClient_Expecter) DeleteWorkspace added in v0.6.0

func (_e *MockClient_Expecter) DeleteWorkspace(wsId interface{}) *MockClient_DeleteWorkspace_Call

DeleteWorkspace is a helper method to define mock.On call

  • wsId

func (*MockClient_Expecter) DeployWorkspace added in v0.4.0

func (_e *MockClient_Expecter) DeployWorkspace(args interface{}) *MockClient_DeployWorkspace_Call

DeployWorkspace is a helper method to define mock.On call

  • args

func (*MockClient_Expecter) ExecCommand added in v0.3.0

func (_e *MockClient_Expecter) ExecCommand(workspaceId interface{}, command interface{}, workdir interface{}, env interface{}) *MockClient_ExecCommand_Call

ExecCommand is a helper method to define mock.On call

  • workspaceId
  • command
  • workdir
  • env

func (*MockClient_Expecter) GetPipelineState added in v0.6.0

func (_e *MockClient_Expecter) GetPipelineState(wsId interface{}, stage interface{}) *MockClient_GetPipelineState_Call

GetPipelineState is a helper method to define mock.On call

  • wsId
  • stage

func (*MockClient_Expecter) GetWorkspace added in v0.3.0

func (_e *MockClient_Expecter) GetWorkspace(workspaceId interface{}) *MockClient_GetWorkspace_Call

GetWorkspace is a helper method to define mock.On call

  • workspaceId

func (*MockClient_Expecter) GitPull added in v0.10.0

func (_e *MockClient_Expecter) GitPull(wsId interface{}, remote interface{}, branch interface{}) *MockClient_GitPull_Call

GitPull is a helper method to define mock.On call

  • wsId
  • remote
  • branch

func (*MockClient_Expecter) ListTeams

ListTeams is a helper method to define mock.On call

func (*MockClient_Expecter) ListWorkspacePlans added in v0.4.0

func (_e *MockClient_Expecter) ListWorkspacePlans() *MockClient_ListWorkspacePlans_Call

ListWorkspacePlans is a helper method to define mock.On call

func (*MockClient_Expecter) ListWorkspaces

func (_e *MockClient_Expecter) ListWorkspaces(teamId interface{}) *MockClient_ListWorkspaces_Call

ListWorkspaces is a helper method to define mock.On call

  • teamId

func (*MockClient_Expecter) SetEnvVarOnWorkspace

func (_e *MockClient_Expecter) SetEnvVarOnWorkspace(workspaceId interface{}, vars interface{}) *MockClient_SetEnvVarOnWorkspace_Call

SetEnvVarOnWorkspace is a helper method to define mock.On call

  • workspaceId
  • vars

func (*MockClient_Expecter) StartPipelineStage added in v0.6.0

func (_e *MockClient_Expecter) StartPipelineStage(wsId interface{}, profile interface{}, stage interface{}) *MockClient_StartPipelineStage_Call

StartPipelineStage is a helper method to define mock.On call

  • wsId
  • profile
  • stage

type MockClient_GetPipelineState_Call added in v0.6.0

type MockClient_GetPipelineState_Call struct {
	*mock.Call
}

MockClient_GetPipelineState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineState'

func (*MockClient_GetPipelineState_Call) Return added in v0.6.0

func (*MockClient_GetPipelineState_Call) Run added in v0.6.0

func (*MockClient_GetPipelineState_Call) RunAndReturn added in v0.6.0

type MockClient_GetWorkspace_Call added in v0.3.0

type MockClient_GetWorkspace_Call struct {
	*mock.Call
}

MockClient_GetWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkspace'

func (*MockClient_GetWorkspace_Call) Return added in v0.3.0

func (*MockClient_GetWorkspace_Call) Run added in v0.3.0

func (_c *MockClient_GetWorkspace_Call) Run(run func(workspaceId int)) *MockClient_GetWorkspace_Call

func (*MockClient_GetWorkspace_Call) RunAndReturn added in v0.3.0

func (_c *MockClient_GetWorkspace_Call) RunAndReturn(run func(workspaceId int) (api.Workspace, error)) *MockClient_GetWorkspace_Call

type MockClient_GitPull_Call added in v0.10.0

type MockClient_GitPull_Call struct {
	*mock.Call
}

MockClient_GitPull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GitPull'

func (*MockClient_GitPull_Call) Return added in v0.10.0

func (*MockClient_GitPull_Call) Run added in v0.10.0

func (_c *MockClient_GitPull_Call) Run(run func(wsId int, remote string, branch string)) *MockClient_GitPull_Call

func (*MockClient_GitPull_Call) RunAndReturn added in v0.10.0

func (_c *MockClient_GitPull_Call) RunAndReturn(run func(wsId int, remote string, branch string) error) *MockClient_GitPull_Call

type MockClient_ListTeams_Call

type MockClient_ListTeams_Call struct {
	*mock.Call
}

MockClient_ListTeams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTeams'

func (*MockClient_ListTeams_Call) Return

func (*MockClient_ListTeams_Call) Run

func (*MockClient_ListTeams_Call) RunAndReturn

func (_c *MockClient_ListTeams_Call) RunAndReturn(run func() ([]api.Team, error)) *MockClient_ListTeams_Call

type MockClient_ListWorkspacePlans_Call added in v0.4.0

type MockClient_ListWorkspacePlans_Call struct {
	*mock.Call
}

MockClient_ListWorkspacePlans_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWorkspacePlans'

func (*MockClient_ListWorkspacePlans_Call) Return added in v0.4.0

func (*MockClient_ListWorkspacePlans_Call) Run added in v0.4.0

func (*MockClient_ListWorkspacePlans_Call) RunAndReturn added in v0.4.0

type MockClient_ListWorkspaces_Call

type MockClient_ListWorkspaces_Call struct {
	*mock.Call
}

MockClient_ListWorkspaces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWorkspaces'

func (*MockClient_ListWorkspaces_Call) Return

func (*MockClient_ListWorkspaces_Call) Run

func (*MockClient_ListWorkspaces_Call) RunAndReturn

func (_c *MockClient_ListWorkspaces_Call) RunAndReturn(run func(teamId int) ([]api.Workspace, error)) *MockClient_ListWorkspaces_Call

type MockClient_SetEnvVarOnWorkspace_Call

type MockClient_SetEnvVarOnWorkspace_Call struct {
	*mock.Call
}

MockClient_SetEnvVarOnWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEnvVarOnWorkspace'

func (*MockClient_SetEnvVarOnWorkspace_Call) Return

func (*MockClient_SetEnvVarOnWorkspace_Call) Run

func (*MockClient_SetEnvVarOnWorkspace_Call) RunAndReturn

func (_c *MockClient_SetEnvVarOnWorkspace_Call) RunAndReturn(run func(workspaceId int, vars map[string]string) error) *MockClient_SetEnvVarOnWorkspace_Call

type MockClient_StartPipelineStage_Call added in v0.6.0

type MockClient_StartPipelineStage_Call struct {
	*mock.Call
}

MockClient_StartPipelineStage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartPipelineStage'

func (*MockClient_StartPipelineStage_Call) Return added in v0.6.0

func (*MockClient_StartPipelineStage_Call) Run added in v0.6.0

func (*MockClient_StartPipelineStage_Call) RunAndReturn added in v0.6.0

func (_c *MockClient_StartPipelineStage_Call) RunAndReturn(run func(wsId int, profile string, stage string) error) *MockClient_StartPipelineStage_Call

type MockEnv

type MockEnv struct {
	mock.Mock
}

MockEnv is an autogenerated mock type for the Env type

func NewMockEnv

func NewMockEnv(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockEnv

NewMockEnv creates a new instance of MockEnv. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockEnv) EXPECT

func (_m *MockEnv) EXPECT() *MockEnv_Expecter

func (*MockEnv) GetApiToken

func (_mock *MockEnv) GetApiToken() (string, error)

GetApiToken provides a mock function for the type MockEnv

func (*MockEnv) GetApiUrl

func (_mock *MockEnv) GetApiUrl() string

GetApiUrl provides a mock function for the type MockEnv

func (*MockEnv) GetTeamId

func (_mock *MockEnv) GetTeamId() (int, error)

GetTeamId provides a mock function for the type MockEnv

func (*MockEnv) GetWorkspaceId

func (_mock *MockEnv) GetWorkspaceId() (int, error)

GetWorkspaceId provides a mock function for the type MockEnv

type MockEnv_Expecter

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

func (*MockEnv_Expecter) GetApiToken

func (_e *MockEnv_Expecter) GetApiToken() *MockEnv_GetApiToken_Call

GetApiToken is a helper method to define mock.On call

func (*MockEnv_Expecter) GetApiUrl

func (_e *MockEnv_Expecter) GetApiUrl() *MockEnv_GetApiUrl_Call

GetApiUrl is a helper method to define mock.On call

func (*MockEnv_Expecter) GetTeamId

func (_e *MockEnv_Expecter) GetTeamId() *MockEnv_GetTeamId_Call

GetTeamId is a helper method to define mock.On call

func (*MockEnv_Expecter) GetWorkspaceId

func (_e *MockEnv_Expecter) GetWorkspaceId() *MockEnv_GetWorkspaceId_Call

GetWorkspaceId is a helper method to define mock.On call

type MockEnv_GetApiToken_Call

type MockEnv_GetApiToken_Call struct {
	*mock.Call
}

MockEnv_GetApiToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiToken'

func (*MockEnv_GetApiToken_Call) Return

func (*MockEnv_GetApiToken_Call) Run

func (*MockEnv_GetApiToken_Call) RunAndReturn

func (_c *MockEnv_GetApiToken_Call) RunAndReturn(run func() (string, error)) *MockEnv_GetApiToken_Call

type MockEnv_GetApiUrl_Call

type MockEnv_GetApiUrl_Call struct {
	*mock.Call
}

MockEnv_GetApiUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiUrl'

func (*MockEnv_GetApiUrl_Call) Return

func (*MockEnv_GetApiUrl_Call) Run

func (_c *MockEnv_GetApiUrl_Call) Run(run func()) *MockEnv_GetApiUrl_Call

func (*MockEnv_GetApiUrl_Call) RunAndReturn

func (_c *MockEnv_GetApiUrl_Call) RunAndReturn(run func() string) *MockEnv_GetApiUrl_Call

type MockEnv_GetTeamId_Call

type MockEnv_GetTeamId_Call struct {
	*mock.Call
}

MockEnv_GetTeamId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeamId'

func (*MockEnv_GetTeamId_Call) Return

func (*MockEnv_GetTeamId_Call) Run

func (_c *MockEnv_GetTeamId_Call) Run(run func()) *MockEnv_GetTeamId_Call

func (*MockEnv_GetTeamId_Call) RunAndReturn

func (_c *MockEnv_GetTeamId_Call) RunAndReturn(run func() (int, error)) *MockEnv_GetTeamId_Call

type MockEnv_GetWorkspaceId_Call

type MockEnv_GetWorkspaceId_Call struct {
	*mock.Call
}

MockEnv_GetWorkspaceId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkspaceId'

func (*MockEnv_GetWorkspaceId_Call) Return

func (*MockEnv_GetWorkspaceId_Call) Run

func (*MockEnv_GetWorkspaceId_Call) RunAndReturn

func (_c *MockEnv_GetWorkspaceId_Call) RunAndReturn(run func() (int, error)) *MockEnv_GetWorkspaceId_Call

type MockPrompt added in v0.6.0

type MockPrompt struct {
	mock.Mock
}

MockPrompt is an autogenerated mock type for the Prompt type

func NewMockPrompt added in v0.6.0

func NewMockPrompt(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPrompt

NewMockPrompt creates a new instance of MockPrompt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPrompt) EXPECT added in v0.6.0

func (_m *MockPrompt) EXPECT() *MockPrompt_Expecter

func (*MockPrompt) InputPrompt added in v0.6.0

func (_mock *MockPrompt) InputPrompt(prompt string) string

InputPrompt provides a mock function for the type MockPrompt

type MockPrompt_Expecter added in v0.6.0

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

func (*MockPrompt_Expecter) InputPrompt added in v0.6.0

func (_e *MockPrompt_Expecter) InputPrompt(prompt interface{}) *MockPrompt_InputPrompt_Call

InputPrompt is a helper method to define mock.On call

  • prompt

type MockPrompt_InputPrompt_Call added in v0.6.0

type MockPrompt_InputPrompt_Call struct {
	*mock.Call
}

MockPrompt_InputPrompt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InputPrompt'

func (*MockPrompt_InputPrompt_Call) Return added in v0.6.0

func (*MockPrompt_InputPrompt_Call) Run added in v0.6.0

func (*MockPrompt_InputPrompt_Call) RunAndReturn added in v0.6.0

func (_c *MockPrompt_InputPrompt_Call) RunAndReturn(run func(prompt string) string) *MockPrompt_InputPrompt_Call

type MonitorCmd added in v0.9.0

type MonitorCmd struct {
	Cmd  *cobra.Command
	Opts MonitorOpts
	Time api.Time
	Http csio.HttpServer
	Exec csio.Exec
}

func (*MonitorCmd) NewProxy added in v0.9.0

func (c *MonitorCmd) NewProxy() (*Proxy, error)

NewProxy creates and returns a new Proxy instance.

func (*MonitorCmd) RunCommandWithHealthcheck added in v0.9.0

func (c *MonitorCmd) RunCommandWithHealthcheck(ctx context.Context, cmdArgs []string) error

RunCommandWithMetrics continuously runs the given command, streams its output, and reports Prometheus metrics. It implements a restart delay of 5 seconds if a non-zero exit code occurs within 1 second of the command starting. The metrics will be served on the specified listenAddr.

func (*MonitorCmd) RunE added in v0.9.0

func (c *MonitorCmd) RunE(_ *cobra.Command, args []string) error

type MonitorOpts added in v0.9.0

type MonitorOpts struct {
	GlobalOptions
	ListenAddress      *string
	MaxRestarts        *int
	Forward            *string
	CaCertFile         *string
	InsecureSkipVerify *bool
}

type OpenCmd added in v0.3.0

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

func (*OpenCmd) RunE added in v0.3.0

func (c *OpenCmd) RunE(_ *cobra.Command, args []string) error

type OpenWorkspaceCmd added in v0.3.0

type OpenWorkspaceCmd struct {
	Opts GlobalOptions
	// contains filtered or unexported fields
}

func (*OpenWorkspaceCmd) OpenWorkspace added in v0.3.0

func (cmd *OpenWorkspaceCmd) OpenWorkspace(browser Browser, client Client, wsId int) error

func (*OpenWorkspaceCmd) RunE added in v0.3.0

func (c *OpenWorkspaceCmd) RunE(_ *cobra.Command, args []string) error

type Prompt added in v0.6.0

type Prompt interface {
	InputPrompt(prompt string) string
}

type Proxy added in v0.9.0

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

Proxy represents our HTTP proxy server with a fixed target URL.

func (*Proxy) ServeHTTP added in v0.9.0

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for our Proxy. This method will be called for every incoming HTTP request.

type SSE

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

type SetEnvVarCmd

type SetEnvVarCmd struct {
	Opts SetEnvVarOptions
	// contains filtered or unexported fields
}

func (*SetEnvVarCmd) RunE

func (l *SetEnvVarCmd) RunE(_ *cobra.Command, args []string) (err error)

func (*SetEnvVarCmd) SetEnvironmentVariables

func (l *SetEnvVarCmd) SetEnvironmentVariables(client Client) (err error)

type SetEnvVarOptions

type SetEnvVarOptions struct {
	GlobalOptions
	EnvVar *[]string
}

type StartCmd added in v0.6.0

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

type StartPipelineCmd added in v0.6.0

type StartPipelineCmd struct {
	Opts StartPipelineOpts
	Time api.Time
	// contains filtered or unexported fields
}

func (*StartPipelineCmd) RunE added in v0.6.0

func (c *StartPipelineCmd) RunE(_ *cobra.Command, args []string) error

func (*StartPipelineCmd) StartPipelineStages added in v0.6.0

func (c *StartPipelineCmd) StartPipelineStages(client Client, wsId int, stages []string) error

type StartPipelineOpts added in v0.6.0

type StartPipelineOpts struct {
	GlobalOptions
	Profile *string
	Timeout *time.Duration
}

type UpdateCmd added in v0.9.0

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

func (*UpdateCmd) RunE added in v0.9.0

func (c *UpdateCmd) RunE(_ *cobra.Command, args []string) error

type VersionCmd

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

func (*VersionCmd) RunE

func (c *VersionCmd) RunE(_ *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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