cs

package
v1.59.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgToEnvVarMap added in v0.3.0

func ArgToEnvVarMap(input []string) (map[string]string, error)

func BuildDate added in v0.2.0

func BuildDate() string

func Commit added in v0.2.0

func Commit() string

func Get

func Get(path string) (body []byte, err error)

func GetRoleName

func GetRoleName(role int) string

func SetAuthoriziationHeader

func SetAuthoriziationHeader(req *http.Request) error

func ValidateUrl added in v0.4.0

func ValidateUrl(urlIn string) (string, error)

Validates a URL is a http/https URL

func Version added in v0.2.0

func Version() string

func WakeUpWorkspace added in v1.52.0

func WakeUpWorkspace(client Client, wsId int, timeout time.Duration) (*api.Workspace, error)

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

func (*Browser) OpenIde added in v0.3.0

func (b *Browser) OpenIde(path string) error

type Build added in v0.2.0

type Build struct{}

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

func (*FileSystem) WriteFile added in v0.9.0

func (f *FileSystem) WriteFile(path string, filename string, data []byte, force bool) error

WriteFile creates a file at the specified path and writes data to it. If the directory does not exist, it will be created. If the file in the directory already exists, it returns an error.

type MockClient added in v1.52.0

type MockClient struct {
	mock.Mock
}

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

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 v1.52.0

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

type MockClient_ScaleWorkspace_Call struct {
	*mock.Call
}

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 (*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

type MockClient_WaitForWorkspaceRunning_Call struct {
	*mock.Call
}

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 (*MockClient_WaitForWorkspaceRunning_Call) Run added in v1.52.0

func (*MockClient_WaitForWorkspaceRunning_Call) RunAndReturn added in v1.52.0

type MockClient_WorkspaceStatus_Call added in v1.52.0

type MockClient_WorkspaceStatus_Call struct {
	*mock.Call
}

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 (*MockClient_WorkspaceStatus_Call) Run added in v1.52.0

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)

type Step

type Step struct {
	State string
}

type TeamRole added in v1.5.0

type TeamRole int
const (
	RoleMember TeamRole = 1
	RoleAdmin  TeamRole = 0
)

func (TeamRole) IsValid added in v1.5.0

func (r TeamRole) IsValid() bool

func (TeamRole) String added in v1.5.0

func (r TeamRole) String() string

Jump to

Keyboard shortcuts

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