cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type Client

type Client interface {
	ListTeams() ([]api.Team, error)
	ListWorkspaces(teamId int) ([]api.Workspace, error)
	SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error
}

func NewClient

func NewClient(opts GlobalOptions) (Client, error)

type Env added in v0.1.0

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 GlobalOptions

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

func (GlobalOptions) GetApiUrl

func (o GlobalOptions) GetApiUrl() string

func (GlobalOptions) GetTeamId added in v0.1.0

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

func (GlobalOptions) GetWorkspaceId added in v0.1.0

func (o GlobalOptions) GetWorkspaceId() (int, 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 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) 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 added in v0.1.0

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

SetEnvVarOnWorkspace provides a mock function for the type MockClient

func (*MockClient) StartPipelines added in v0.1.0

func (_mock *MockClient) StartPipelines(workspaceId int, pipelineStage string) error

StartPipelines provides a mock function for the type MockClient

type MockClient_Expecter

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

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 added in v0.1.0

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) StartPipelines added in v0.1.0

func (_e *MockClient_Expecter) StartPipelines(workspaceId interface{}, pipelineStage interface{}) *MockClient_StartPipelines_Call

StartPipelines is a helper method to define mock.On call

  • workspaceId
  • pipelineStage

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 added in v0.1.0

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 added in v0.1.0

func (*MockClient_SetEnvVarOnWorkspace_Call) Run added in v0.1.0

func (*MockClient_SetEnvVarOnWorkspace_Call) RunAndReturn added in v0.1.0

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

type MockClient_StartPipelines_Call added in v0.1.0

type MockClient_StartPipelines_Call struct {
	*mock.Call
}

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

func (*MockClient_StartPipelines_Call) Return added in v0.1.0

func (*MockClient_StartPipelines_Call) Run added in v0.1.0

func (_c *MockClient_StartPipelines_Call) Run(run func(workspaceId int, pipelineStage string)) *MockClient_StartPipelines_Call

func (*MockClient_StartPipelines_Call) RunAndReturn added in v0.1.0

func (_c *MockClient_StartPipelines_Call) RunAndReturn(run func(workspaceId int, pipelineStage string) error) *MockClient_StartPipelines_Call

type MockEnv added in v0.1.0

type MockEnv struct {
	mock.Mock
}

MockEnv is an autogenerated mock type for the Env type

func NewMockEnv added in v0.1.0

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 added in v0.1.0

func (_m *MockEnv) EXPECT() *MockEnv_Expecter

func (*MockEnv) GetApiToken added in v0.1.0

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

GetApiToken provides a mock function for the type MockEnv

func (*MockEnv) GetApiUrl added in v0.1.0

func (_mock *MockEnv) GetApiUrl() string

GetApiUrl provides a mock function for the type MockEnv

func (*MockEnv) GetTeamId added in v0.1.0

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

GetTeamId provides a mock function for the type MockEnv

func (*MockEnv) GetWorkspaceId added in v0.1.0

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

GetWorkspaceId provides a mock function for the type MockEnv

type MockEnv_Expecter added in v0.1.0

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

func (*MockEnv_Expecter) GetApiToken added in v0.1.0

func (_e *MockEnv_Expecter) GetApiToken() *MockEnv_GetApiToken_Call

GetApiToken is a helper method to define mock.On call

func (*MockEnv_Expecter) GetApiUrl added in v0.1.0

func (_e *MockEnv_Expecter) GetApiUrl() *MockEnv_GetApiUrl_Call

GetApiUrl is a helper method to define mock.On call

func (*MockEnv_Expecter) GetTeamId added in v0.1.0

func (_e *MockEnv_Expecter) GetTeamId() *MockEnv_GetTeamId_Call

GetTeamId is a helper method to define mock.On call

func (*MockEnv_Expecter) GetWorkspaceId added in v0.1.0

func (_e *MockEnv_Expecter) GetWorkspaceId() *MockEnv_GetWorkspaceId_Call

GetWorkspaceId is a helper method to define mock.On call

type MockEnv_GetApiToken_Call added in v0.1.0

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 added in v0.1.0

func (*MockEnv_GetApiToken_Call) Run added in v0.1.0

func (*MockEnv_GetApiToken_Call) RunAndReturn added in v0.1.0

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

type MockEnv_GetApiUrl_Call added in v0.1.0

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 added in v0.1.0

func (*MockEnv_GetApiUrl_Call) Run added in v0.1.0

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

func (*MockEnv_GetApiUrl_Call) RunAndReturn added in v0.1.0

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

type MockEnv_GetTeamId_Call added in v0.1.0

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 added in v0.1.0

func (*MockEnv_GetTeamId_Call) Run added in v0.1.0

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

func (*MockEnv_GetTeamId_Call) RunAndReturn added in v0.1.0

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

type MockEnv_GetWorkspaceId_Call added in v0.1.0

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 added in v0.1.0

func (*MockEnv_GetWorkspaceId_Call) Run added in v0.1.0

func (*MockEnv_GetWorkspaceId_Call) RunAndReturn added in v0.1.0

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

type SSE

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

type SetEnvVarCmd added in v0.1.0

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

func (*SetEnvVarCmd) RunE added in v0.1.0

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

func (*SetEnvVarCmd) SetEnvironmentVariables added in v0.1.0

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

type SetEnvVarOptions added in v0.1.0

type SetEnvVarOptions struct {
	GlobalOptions
	EnvVar *[]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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