Documentation
¶
Index ¶
- type APIClient
- func (c *APIClient) CreateWorkspace(teamID, planID int, name string, repoURL *string) (int, error)
- func (c *APIClient) DeleteWorkspace(workspaceID int) error
- func (c *APIClient) ExecuteCommand(workspaceID int, command string) error
- func (c *APIClient) ListTeams() ([]api.Team, error)
- func (c *APIClient) ListWorkspacePlans() ([]api.WorkspacePlan, error)
- func (c *APIClient) SetEnvVar(workspaceID int, key, value string) error
- func (c *APIClient) StartPipeline(workspaceID int, profile, stage string) error
- func (c *APIClient) SyncLandscape(workspaceID int, profile string) error
- type Client
- type MockClient
- func (_mock *MockClient) CreateWorkspace(teamID int, planID int, name string, repoURL *string) (int, error)
- func (_mock *MockClient) DeleteWorkspace(workspaceID int) error
- func (_m *MockClient) EXPECT() *MockClient_Expecter
- func (_mock *MockClient) ExecuteCommand(workspaceID int, command string) error
- func (_mock *MockClient) ListTeams() ([]api.Team, error)
- func (_mock *MockClient) ListWorkspacePlans() ([]api.WorkspacePlan, error)
- func (_mock *MockClient) SetEnvVar(workspaceID int, key string, value string) error
- func (_mock *MockClient) StartPipeline(workspaceID int, profile string, stage string) error
- func (_mock *MockClient) SyncLandscape(workspaceID int, profile string) error
- type MockClient_CreateWorkspace_Call
- func (_c *MockClient_CreateWorkspace_Call) Return(workspaceID int, err error) *MockClient_CreateWorkspace_Call
- func (_c *MockClient_CreateWorkspace_Call) Run(run func(teamID int, planID int, name string, repoURL *string)) *MockClient_CreateWorkspace_Call
- func (_c *MockClient_CreateWorkspace_Call) RunAndReturn(run func(teamID int, planID int, name string, repoURL *string) (int, error)) *MockClient_CreateWorkspace_Call
- type MockClient_DeleteWorkspace_Call
- func (_c *MockClient_DeleteWorkspace_Call) Return(err error) *MockClient_DeleteWorkspace_Call
- func (_c *MockClient_DeleteWorkspace_Call) Run(run func(workspaceID int)) *MockClient_DeleteWorkspace_Call
- func (_c *MockClient_DeleteWorkspace_Call) RunAndReturn(run func(workspaceID int) error) *MockClient_DeleteWorkspace_Call
- type MockClient_ExecuteCommand_Call
- func (_c *MockClient_ExecuteCommand_Call) Return(err error) *MockClient_ExecuteCommand_Call
- func (_c *MockClient_ExecuteCommand_Call) Run(run func(workspaceID int, command string)) *MockClient_ExecuteCommand_Call
- func (_c *MockClient_ExecuteCommand_Call) RunAndReturn(run func(workspaceID int, command string) error) *MockClient_ExecuteCommand_Call
- type MockClient_Expecter
- func (_e *MockClient_Expecter) CreateWorkspace(teamID interface{}, planID interface{}, name interface{}, repoURL interface{}) *MockClient_CreateWorkspace_Call
- func (_e *MockClient_Expecter) DeleteWorkspace(workspaceID interface{}) *MockClient_DeleteWorkspace_Call
- func (_e *MockClient_Expecter) ExecuteCommand(workspaceID interface{}, command interface{}) *MockClient_ExecuteCommand_Call
- func (_e *MockClient_Expecter) ListTeams() *MockClient_ListTeams_Call
- func (_e *MockClient_Expecter) ListWorkspacePlans() *MockClient_ListWorkspacePlans_Call
- func (_e *MockClient_Expecter) SetEnvVar(workspaceID interface{}, key interface{}, value interface{}) *MockClient_SetEnvVar_Call
- func (_e *MockClient_Expecter) StartPipeline(workspaceID interface{}, profile interface{}, stage interface{}) *MockClient_StartPipeline_Call
- func (_e *MockClient_Expecter) SyncLandscape(workspaceID interface{}, profile interface{}) *MockClient_SyncLandscape_Call
- type MockClient_ListTeams_Call
- type MockClient_ListWorkspacePlans_Call
- func (_c *MockClient_ListWorkspacePlans_Call) Return(vs []api.WorkspacePlan, err error) *MockClient_ListWorkspacePlans_Call
- func (_c *MockClient_ListWorkspacePlans_Call) Run(run func()) *MockClient_ListWorkspacePlans_Call
- func (_c *MockClient_ListWorkspacePlans_Call) RunAndReturn(run func() ([]api.WorkspacePlan, error)) *MockClient_ListWorkspacePlans_Call
- type MockClient_SetEnvVar_Call
- func (_c *MockClient_SetEnvVar_Call) Return(err error) *MockClient_SetEnvVar_Call
- func (_c *MockClient_SetEnvVar_Call) Run(run func(workspaceID int, key string, value string)) *MockClient_SetEnvVar_Call
- func (_c *MockClient_SetEnvVar_Call) RunAndReturn(run func(workspaceID int, key string, value string) error) *MockClient_SetEnvVar_Call
- type MockClient_StartPipeline_Call
- func (_c *MockClient_StartPipeline_Call) Return(err error) *MockClient_StartPipeline_Call
- func (_c *MockClient_StartPipeline_Call) Run(run func(workspaceID int, profile string, stage string)) *MockClient_StartPipeline_Call
- func (_c *MockClient_StartPipeline_Call) RunAndReturn(run func(workspaceID int, profile string, stage string) error) *MockClient_StartPipeline_Call
- type MockClient_SyncLandscape_Call
- func (_c *MockClient_SyncLandscape_Call) Return(err error) *MockClient_SyncLandscape_Call
- func (_c *MockClient_SyncLandscape_Call) Run(run func(workspaceID int, profile string)) *MockClient_SyncLandscape_Call
- func (_c *MockClient_SyncLandscape_Call) RunAndReturn(run func(workspaceID int, profile string) error) *MockClient_SyncLandscape_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient wraps the cs-go API client
func (*APIClient) CreateWorkspace ¶
CreateWorkspace creates a new workspace and waits for it to be running
func (*APIClient) DeleteWorkspace ¶
DeleteWorkspace deletes a workspace
func (*APIClient) ExecuteCommand ¶
ExecuteCommand executes a command in the workspace
func (*APIClient) ListWorkspacePlans ¶ added in v0.61.0
func (c *APIClient) ListWorkspacePlans() ([]api.WorkspacePlan, error)
ListWorkspacePlans lists the plans available
func (*APIClient) StartPipeline ¶
StartPipeline starts a pipeline stage
type Client ¶
type Client interface {
CreateWorkspace(teamID, planID int, name string, repoURL *string) (workspaceID int, err error)
SetEnvVar(workspaceID int, key, value string) error
ExecuteCommand(workspaceID int, command string) error
SyncLandscape(workspaceID int, profile string) error
StartPipeline(workspaceID int, profile, stage string) error
DeleteWorkspace(workspaceID int) error
ListWorkspacePlans() ([]api.WorkspacePlan, error)
ListTeams() ([]api.Team, error)
}
Client interface abstracts Codesphere API operations for testing
type MockClient ¶
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) CreateWorkspace ¶
func (_mock *MockClient) CreateWorkspace(teamID int, planID int, name string, repoURL *string) (int, error)
CreateWorkspace provides a mock function for the type MockClient
func (*MockClient) DeleteWorkspace ¶
func (_mock *MockClient) DeleteWorkspace(workspaceID int) error
DeleteWorkspace provides a mock function for the type MockClient
func (*MockClient) EXPECT ¶
func (_m *MockClient) EXPECT() *MockClient_Expecter
func (*MockClient) ExecuteCommand ¶
func (_mock *MockClient) ExecuteCommand(workspaceID int, command string) error
ExecuteCommand provides a mock function for the type MockClient
func (*MockClient) ListTeams ¶ added in v0.61.0
func (_mock *MockClient) ListTeams() ([]api.Team, error)
ListTeams provides a mock function for the type MockClient
func (*MockClient) ListWorkspacePlans ¶ added in v0.61.0
func (_mock *MockClient) ListWorkspacePlans() ([]api.WorkspacePlan, error)
ListWorkspacePlans provides a mock function for the type MockClient
func (*MockClient) SetEnvVar ¶
func (_mock *MockClient) SetEnvVar(workspaceID int, key string, value string) error
SetEnvVar provides a mock function for the type MockClient
func (*MockClient) StartPipeline ¶
func (_mock *MockClient) StartPipeline(workspaceID int, profile string, stage string) error
StartPipeline provides a mock function for the type MockClient
func (*MockClient) SyncLandscape ¶
func (_mock *MockClient) SyncLandscape(workspaceID int, profile string) error
SyncLandscape provides a mock function for the type MockClient
type MockClient_CreateWorkspace_Call ¶
MockClient_CreateWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWorkspace'
func (*MockClient_CreateWorkspace_Call) Return ¶
func (_c *MockClient_CreateWorkspace_Call) Return(workspaceID int, err error) *MockClient_CreateWorkspace_Call
func (*MockClient_CreateWorkspace_Call) Run ¶
func (_c *MockClient_CreateWorkspace_Call) Run(run func(teamID int, planID int, name string, repoURL *string)) *MockClient_CreateWorkspace_Call
func (*MockClient_CreateWorkspace_Call) RunAndReturn ¶
func (_c *MockClient_CreateWorkspace_Call) RunAndReturn(run func(teamID int, planID int, name string, repoURL *string) (int, error)) *MockClient_CreateWorkspace_Call
type MockClient_DeleteWorkspace_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 ¶
func (_c *MockClient_DeleteWorkspace_Call) Return(err error) *MockClient_DeleteWorkspace_Call
func (*MockClient_DeleteWorkspace_Call) Run ¶
func (_c *MockClient_DeleteWorkspace_Call) Run(run func(workspaceID int)) *MockClient_DeleteWorkspace_Call
func (*MockClient_DeleteWorkspace_Call) RunAndReturn ¶
func (_c *MockClient_DeleteWorkspace_Call) RunAndReturn(run func(workspaceID int) error) *MockClient_DeleteWorkspace_Call
type MockClient_ExecuteCommand_Call ¶
MockClient_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand'
func (*MockClient_ExecuteCommand_Call) Return ¶
func (_c *MockClient_ExecuteCommand_Call) Return(err error) *MockClient_ExecuteCommand_Call
func (*MockClient_ExecuteCommand_Call) Run ¶
func (_c *MockClient_ExecuteCommand_Call) Run(run func(workspaceID int, command string)) *MockClient_ExecuteCommand_Call
func (*MockClient_ExecuteCommand_Call) RunAndReturn ¶
func (_c *MockClient_ExecuteCommand_Call) RunAndReturn(run func(workspaceID int, command string) error) *MockClient_ExecuteCommand_Call
type MockClient_Expecter ¶
type MockClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClient_Expecter) CreateWorkspace ¶
func (_e *MockClient_Expecter) CreateWorkspace(teamID interface{}, planID interface{}, name interface{}, repoURL interface{}) *MockClient_CreateWorkspace_Call
CreateWorkspace is a helper method to define mock.On call
- teamID int
- planID int
- name string
- repoURL *string
func (*MockClient_Expecter) DeleteWorkspace ¶
func (_e *MockClient_Expecter) DeleteWorkspace(workspaceID interface{}) *MockClient_DeleteWorkspace_Call
DeleteWorkspace is a helper method to define mock.On call
- workspaceID int
func (*MockClient_Expecter) ExecuteCommand ¶
func (_e *MockClient_Expecter) ExecuteCommand(workspaceID interface{}, command interface{}) *MockClient_ExecuteCommand_Call
ExecuteCommand is a helper method to define mock.On call
- workspaceID int
- command string
func (*MockClient_Expecter) ListTeams ¶ added in v0.61.0
func (_e *MockClient_Expecter) ListTeams() *MockClient_ListTeams_Call
ListTeams is a helper method to define mock.On call
func (*MockClient_Expecter) ListWorkspacePlans ¶ added in v0.61.0
func (_e *MockClient_Expecter) ListWorkspacePlans() *MockClient_ListWorkspacePlans_Call
ListWorkspacePlans is a helper method to define mock.On call
func (*MockClient_Expecter) SetEnvVar ¶
func (_e *MockClient_Expecter) SetEnvVar(workspaceID interface{}, key interface{}, value interface{}) *MockClient_SetEnvVar_Call
SetEnvVar is a helper method to define mock.On call
- workspaceID int
- key string
- value string
func (*MockClient_Expecter) StartPipeline ¶
func (_e *MockClient_Expecter) StartPipeline(workspaceID interface{}, profile interface{}, stage interface{}) *MockClient_StartPipeline_Call
StartPipeline is a helper method to define mock.On call
- workspaceID int
- profile string
- stage string
func (*MockClient_Expecter) SyncLandscape ¶
func (_e *MockClient_Expecter) SyncLandscape(workspaceID interface{}, profile interface{}) *MockClient_SyncLandscape_Call
SyncLandscape is a helper method to define mock.On call
- workspaceID int
- profile string
type MockClient_ListTeams_Call ¶ added in v0.61.0
MockClient_ListTeams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTeams'
func (*MockClient_ListTeams_Call) Return ¶ added in v0.61.0
func (_c *MockClient_ListTeams_Call) Return(vs []api.Team, err error) *MockClient_ListTeams_Call
func (*MockClient_ListTeams_Call) Run ¶ added in v0.61.0
func (_c *MockClient_ListTeams_Call) Run(run func()) *MockClient_ListTeams_Call
func (*MockClient_ListTeams_Call) RunAndReturn ¶ added in v0.61.0
func (_c *MockClient_ListTeams_Call) RunAndReturn(run func() ([]api.Team, error)) *MockClient_ListTeams_Call
type MockClient_ListWorkspacePlans_Call ¶ added in v0.61.0
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.61.0
func (_c *MockClient_ListWorkspacePlans_Call) Return(vs []api.WorkspacePlan, err error) *MockClient_ListWorkspacePlans_Call
func (*MockClient_ListWorkspacePlans_Call) Run ¶ added in v0.61.0
func (_c *MockClient_ListWorkspacePlans_Call) Run(run func()) *MockClient_ListWorkspacePlans_Call
func (*MockClient_ListWorkspacePlans_Call) RunAndReturn ¶ added in v0.61.0
func (_c *MockClient_ListWorkspacePlans_Call) RunAndReturn(run func() ([]api.WorkspacePlan, error)) *MockClient_ListWorkspacePlans_Call
type MockClient_SetEnvVar_Call ¶
MockClient_SetEnvVar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEnvVar'
func (*MockClient_SetEnvVar_Call) Return ¶
func (_c *MockClient_SetEnvVar_Call) Return(err error) *MockClient_SetEnvVar_Call
func (*MockClient_SetEnvVar_Call) Run ¶
func (_c *MockClient_SetEnvVar_Call) Run(run func(workspaceID int, key string, value string)) *MockClient_SetEnvVar_Call
func (*MockClient_SetEnvVar_Call) RunAndReturn ¶
func (_c *MockClient_SetEnvVar_Call) RunAndReturn(run func(workspaceID int, key string, value string) error) *MockClient_SetEnvVar_Call
type MockClient_StartPipeline_Call ¶
MockClient_StartPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartPipeline'
func (*MockClient_StartPipeline_Call) Return ¶
func (_c *MockClient_StartPipeline_Call) Return(err error) *MockClient_StartPipeline_Call
func (*MockClient_StartPipeline_Call) Run ¶
func (_c *MockClient_StartPipeline_Call) Run(run func(workspaceID int, profile string, stage string)) *MockClient_StartPipeline_Call
func (*MockClient_StartPipeline_Call) RunAndReturn ¶
func (_c *MockClient_StartPipeline_Call) RunAndReturn(run func(workspaceID int, profile string, stage string) error) *MockClient_StartPipeline_Call
type MockClient_SyncLandscape_Call ¶
MockClient_SyncLandscape_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncLandscape'
func (*MockClient_SyncLandscape_Call) Return ¶
func (_c *MockClient_SyncLandscape_Call) Return(err error) *MockClient_SyncLandscape_Call
func (*MockClient_SyncLandscape_Call) Run ¶
func (_c *MockClient_SyncLandscape_Call) Run(run func(workspaceID int, profile string)) *MockClient_SyncLandscape_Call
func (*MockClient_SyncLandscape_Call) RunAndReturn ¶
func (_c *MockClient_SyncLandscape_Call) RunAndReturn(run func(workspaceID int, profile string) error) *MockClient_SyncLandscape_Call