cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExecCmd added in v0.3.0

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

func AddLicensesCmd

func AddLicensesCmd(rootCmd *cobra.Command)

func AddListCmd

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

func AddLogCmd

func AddLogCmd(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 AddVersionCmd

func AddVersionCmd(rootCmd *cobra.Command)

func Execute

func Execute()

func GetRootCmd

func GetRootCmd() *cobra.Command

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)
}

func NewClient

func NewClient(opts GlobalOptions) (Client, error)

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
}

ExecCmd represents the exec command

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 GlobalOptions

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

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 LicensesCmd

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

LicensesCmd represents the licenses command

func (*LicensesCmd) RunE

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

type ListCmd

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

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) 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) 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) ListTeams

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

ListTeams 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

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) 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) 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) ListTeams

ListTeams 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

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_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_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 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 OpenCmd added in v0.3.0

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

OpenCmd represents the open command

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
}

OpenWorkspaceCmd represents the workspace command

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 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 VersionCmd

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

VersionCmd represents the version command

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