Documentation
¶
Index ¶
- func ArgToEnvVarMap(input []string) (map[string]string, error)
- func BuildDate() string
- func Commit() string
- func Get(path string) (body []byte, err error)
- func GetRoleName(role int) string
- func SetAuthoriziationHeader(req *http.Request) error
- func ValidateUrl(urlIn string) (string, error)
- func Version() string
- func WakeUpWorkspace(client Client, wsId int, timeout time.Duration) (*api.Workspace, error)
- type Browser
- type Build
- type Client
- type Environment
- type FileSystem
- func (f *FileSystem) CreateDirectory(dirname string) error
- func (f *FileSystem) CreateFile(filename string) (billy.File, error)
- func (f *FileSystem) DirExists(dirname string) bool
- func (f *FileSystem) FileExists(filename string) bool
- func (f *FileSystem) WriteFile(path string, filename string, data []byte, force bool) error
- type MockClient
- func (_m *MockClient) EXPECT() *MockClient_Expecter
- func (_mock *MockClient) GetWorkspace(workspaceId int) (api.Workspace, error)
- func (_mock *MockClient) ScaleWorkspace(wsId int, replicas int) error
- func (_mock *MockClient) WaitForWorkspaceRunning(workspace *api.Workspace, timeout time.Duration) error
- func (_mock *MockClient) WorkspaceStatus(workspaceId int) (*api.WorkspaceStatus, error)
- type MockClient_Expecter
- func (_e *MockClient_Expecter) GetWorkspace(workspaceId any) *MockClient_GetWorkspace_Call
- func (_e *MockClient_Expecter) ScaleWorkspace(wsId any, replicas any) *MockClient_ScaleWorkspace_Call
- func (_e *MockClient_Expecter) WaitForWorkspaceRunning(workspace any, timeout any) *MockClient_WaitForWorkspaceRunning_Call
- func (_e *MockClient_Expecter) WorkspaceStatus(workspaceId any) *MockClient_WorkspaceStatus_Call
- type MockClient_GetWorkspace_Call
- func (_c *MockClient_GetWorkspace_Call) Return(workspace api.Workspace, err error) *MockClient_GetWorkspace_Call
- func (_c *MockClient_GetWorkspace_Call) Run(run func(workspaceId int)) *MockClient_GetWorkspace_Call
- func (_c *MockClient_GetWorkspace_Call) RunAndReturn(run func(workspaceId int) (api.Workspace, error)) *MockClient_GetWorkspace_Call
- type MockClient_ScaleWorkspace_Call
- func (_c *MockClient_ScaleWorkspace_Call) Return(err error) *MockClient_ScaleWorkspace_Call
- func (_c *MockClient_ScaleWorkspace_Call) Run(run func(wsId int, replicas int)) *MockClient_ScaleWorkspace_Call
- func (_c *MockClient_ScaleWorkspace_Call) RunAndReturn(run func(wsId int, replicas int) error) *MockClient_ScaleWorkspace_Call
- type MockClient_WaitForWorkspaceRunning_Call
- func (_c *MockClient_WaitForWorkspaceRunning_Call) Return(err error) *MockClient_WaitForWorkspaceRunning_Call
- func (_c *MockClient_WaitForWorkspaceRunning_Call) Run(run func(workspace *api.Workspace, timeout time.Duration)) *MockClient_WaitForWorkspaceRunning_Call
- func (_c *MockClient_WaitForWorkspaceRunning_Call) RunAndReturn(run func(workspace *api.Workspace, timeout time.Duration) error) *MockClient_WaitForWorkspaceRunning_Call
- type MockClient_WorkspaceStatus_Call
- func (_c *MockClient_WorkspaceStatus_Call) Return(workspaceStatus *api.WorkspaceStatus, err error) *MockClient_WorkspaceStatus_Call
- func (_c *MockClient_WorkspaceStatus_Call) Run(run func(workspaceId int)) *MockClient_WorkspaceStatus_Call
- func (_c *MockClient_WorkspaceStatus_Call) RunAndReturn(run func(workspaceId int) (*api.WorkspaceStatus, error)) *MockClient_WorkspaceStatus_Call
- type ReplicaStatus
- type Step
- type TeamRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgToEnvVarMap ¶ added in v0.3.0
func GetRoleName ¶
func SetAuthoriziationHeader ¶
func ValidateUrl ¶ added in v0.4.0
Validates a URL is a http/https URL
func WakeUpWorkspace ¶ added in v1.52.0
WakeUpWorkspace returns the workspace after ensuring it is running. If it is stopped, it scales the workspace to at least one replica and waits up to timeout for it to start.
Types ¶
type Browser ¶ added in v0.3.0
type Browser struct{}
func NewBrowser ¶ added in v0.3.0
func NewBrowser() *Browser
type Client ¶ added in v1.52.0
type Client interface {
GetWorkspace(workspaceId int) (api.Workspace, error)
WorkspaceStatus(workspaceId int) (*api.WorkspaceStatus, error)
ScaleWorkspace(wsId int, replicas int) error
WaitForWorkspaceRunning(workspace *api.Workspace, timeout time.Duration) error
}
Client is the API contract needed to wake up a workspace.
type Environment ¶ added in v0.1.0
type Environment struct {
}
func NewEnv ¶ added in v0.1.0
func NewEnv() *Environment
func (*Environment) GetApiToken ¶ added in v0.1.0
func (e *Environment) GetApiToken() (string, error)
func (*Environment) GetApiUrl ¶ added in v0.1.0
func (e *Environment) GetApiUrl() string
func (*Environment) GetOrgId ¶ added in v1.1.0
func (e *Environment) GetOrgId() string
func (*Environment) GetTeamId ¶ added in v0.1.0
func (e *Environment) GetTeamId() (int, error)
func (*Environment) GetWorkspaceId ¶ added in v0.1.0
func (e *Environment) GetWorkspaceId() (int, error)
func (*Environment) ReadNumericEnv ¶ added in v0.1.0
func (e *Environment) ReadNumericEnv(env string) (int, error)
type FileSystem ¶ added in v0.9.0
type FileSystem struct {
storage.Storer
billy.Filesystem
}
func NewMemFileSystem ¶ added in v0.9.0
func NewMemFileSystem() *FileSystem
func NewOSFileSystem ¶ added in v0.9.0
func NewOSFileSystem(root string) *FileSystem
func (*FileSystem) CreateDirectory ¶ added in v0.9.0
func (f *FileSystem) CreateDirectory(dirname string) error
func (*FileSystem) CreateFile ¶ added in v0.9.0
func (f *FileSystem) CreateFile(filename string) (billy.File, error)
func (*FileSystem) DirExists ¶ added in v0.9.0
func (f *FileSystem) DirExists(dirname string) bool
func (*FileSystem) FileExists ¶ added in v0.9.0
func (f *FileSystem) FileExists(filename string) bool
type MockClient ¶ added in v1.52.0
MockClient is an autogenerated mock type for the Client type
func NewMockClient ¶ added in v1.52.0
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 ¶ added in v1.52.0
func (_m *MockClient) EXPECT() *MockClient_Expecter
func (*MockClient) GetWorkspace ¶ added in v1.52.0
func (_mock *MockClient) GetWorkspace(workspaceId int) (api.Workspace, error)
GetWorkspace provides a mock function for the type MockClient
func (*MockClient) ScaleWorkspace ¶ added in v1.52.0
func (_mock *MockClient) ScaleWorkspace(wsId int, replicas int) error
ScaleWorkspace provides a mock function for the type MockClient
func (*MockClient) WaitForWorkspaceRunning ¶ added in v1.52.0
func (_mock *MockClient) WaitForWorkspaceRunning(workspace *api.Workspace, timeout time.Duration) error
WaitForWorkspaceRunning provides a mock function for the type MockClient
func (*MockClient) WorkspaceStatus ¶ added in v1.52.0
func (_mock *MockClient) WorkspaceStatus(workspaceId int) (*api.WorkspaceStatus, error)
WorkspaceStatus provides a mock function for the type MockClient
type MockClient_Expecter ¶ added in v1.52.0
type MockClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClient_Expecter) GetWorkspace ¶ added in v1.52.0
func (_e *MockClient_Expecter) GetWorkspace(workspaceId any) *MockClient_GetWorkspace_Call
GetWorkspace is a helper method to define mock.On call
- workspaceId int
func (*MockClient_Expecter) ScaleWorkspace ¶ added in v1.52.0
func (_e *MockClient_Expecter) ScaleWorkspace(wsId any, replicas any) *MockClient_ScaleWorkspace_Call
ScaleWorkspace is a helper method to define mock.On call
- wsId int
- replicas int
func (*MockClient_Expecter) WaitForWorkspaceRunning ¶ added in v1.52.0
func (_e *MockClient_Expecter) WaitForWorkspaceRunning(workspace any, timeout any) *MockClient_WaitForWorkspaceRunning_Call
WaitForWorkspaceRunning is a helper method to define mock.On call
- workspace *api.Workspace
- timeout time.Duration
func (*MockClient_Expecter) WorkspaceStatus ¶ added in v1.52.0
func (_e *MockClient_Expecter) WorkspaceStatus(workspaceId any) *MockClient_WorkspaceStatus_Call
WorkspaceStatus is a helper method to define mock.On call
- workspaceId int
type MockClient_GetWorkspace_Call ¶ added in v1.52.0
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 v1.52.0
func (_c *MockClient_GetWorkspace_Call) Return(workspace api.Workspace, err error) *MockClient_GetWorkspace_Call
func (*MockClient_GetWorkspace_Call) Run ¶ added in v1.52.0
func (_c *MockClient_GetWorkspace_Call) Run(run func(workspaceId int)) *MockClient_GetWorkspace_Call
func (*MockClient_GetWorkspace_Call) RunAndReturn ¶ added in v1.52.0
func (_c *MockClient_GetWorkspace_Call) RunAndReturn(run func(workspaceId int) (api.Workspace, error)) *MockClient_GetWorkspace_Call
type MockClient_ScaleWorkspace_Call ¶ added in v1.52.0
MockClient_ScaleWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScaleWorkspace'
func (*MockClient_ScaleWorkspace_Call) Return ¶ added in v1.52.0
func (_c *MockClient_ScaleWorkspace_Call) Return(err error) *MockClient_ScaleWorkspace_Call
func (*MockClient_ScaleWorkspace_Call) Run ¶ added in v1.52.0
func (_c *MockClient_ScaleWorkspace_Call) Run(run func(wsId int, replicas int)) *MockClient_ScaleWorkspace_Call
func (*MockClient_ScaleWorkspace_Call) RunAndReturn ¶ added in v1.52.0
func (_c *MockClient_ScaleWorkspace_Call) RunAndReturn(run func(wsId int, replicas int) error) *MockClient_ScaleWorkspace_Call
type MockClient_WaitForWorkspaceRunning_Call ¶ added in v1.52.0
MockClient_WaitForWorkspaceRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForWorkspaceRunning'
func (*MockClient_WaitForWorkspaceRunning_Call) Return ¶ added in v1.52.0
func (_c *MockClient_WaitForWorkspaceRunning_Call) Return(err error) *MockClient_WaitForWorkspaceRunning_Call
func (*MockClient_WaitForWorkspaceRunning_Call) Run ¶ added in v1.52.0
func (_c *MockClient_WaitForWorkspaceRunning_Call) Run(run func(workspace *api.Workspace, timeout time.Duration)) *MockClient_WaitForWorkspaceRunning_Call
func (*MockClient_WaitForWorkspaceRunning_Call) RunAndReturn ¶ added in v1.52.0
func (_c *MockClient_WaitForWorkspaceRunning_Call) RunAndReturn(run func(workspace *api.Workspace, timeout time.Duration) error) *MockClient_WaitForWorkspaceRunning_Call
type MockClient_WorkspaceStatus_Call ¶ added in v1.52.0
MockClient_WorkspaceStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkspaceStatus'
func (*MockClient_WorkspaceStatus_Call) Return ¶ added in v1.52.0
func (_c *MockClient_WorkspaceStatus_Call) Return(workspaceStatus *api.WorkspaceStatus, err error) *MockClient_WorkspaceStatus_Call
func (*MockClient_WorkspaceStatus_Call) Run ¶ added in v1.52.0
func (_c *MockClient_WorkspaceStatus_Call) Run(run func(workspaceId int)) *MockClient_WorkspaceStatus_Call
func (*MockClient_WorkspaceStatus_Call) RunAndReturn ¶ added in v1.52.0
func (_c *MockClient_WorkspaceStatus_Call) RunAndReturn(run func(workspaceId int) (*api.WorkspaceStatus, error)) *MockClient_WorkspaceStatus_Call
type ReplicaStatus ¶
type ReplicaStatus struct {
State string `json:"state"`
Steps []Step `json:"steps"`
Replica string `json:"replica"`
Server string `json:"server"`
}
func GetPipelineStatus ¶
func GetPipelineStatus(ws int, stage string) (res []ReplicaStatus, err error)