shared

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 5 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 AddCmd

func AddCmd(parent *cobra.Command, cmd *cobra.Command)

AddCmd adds a command, inheriting the parent's Args validator if not explicitly set. Individual commands that need different argument rules can override this by setting their own Args validator.

func RequireOrganizationID added in v1.47.0

func RequireOrganizationID(opts RootOptions) (string, error)

RequireOrganizationID resolves the flag/environment value and requires an organization scope.

func ValidateOrganizationRole added in v1.47.0

func ValidateOrganizationRole(role string) error

func ValidateUserID added in v1.47.0

func ValidateUserID(userID int) error

ValidateUserID matches the public API's toApiPathOrQueryParamNonNegativeInt: user IDs are integers >= 0. Cobra's integer flags reject fractional input. See codesphere-monorepo/packages/public-api-service/common/src/ts/server/apiTypeConverter.ts.

Types

type Client added in v1.47.0

type Client interface {
	ChangeOrganizationMemberRole(orgId string, userId int, role string) error
	ListOrganizationMembers(orgId string) ([]api.OrganizationMember, error)
	RemoveOrganizationMember(orgId string, userId int) error
	AddOrganizationMember(orgId, email, role string) error
	ListTeams(orgId string) ([]api.Team, error)
	ListWorkspaces(teamId int) ([]api.Workspace, error)
	ListBaseimages() ([]api.Baseimage, error)
	ListOrganizations() ([]api.Organization, error)
	CreateOrganization(name string, adminEmail string) (*api.Organization, error)
	GetWorkspace(workspaceId int) (api.Workspace, error)
	WorkspaceStatus(workspaceId int) (*api.WorkspaceStatus, error)
	WaitForWorkspaceRunning(workspace *api.Workspace, timeout time.Duration) error
	ScaleWorkspace(wsId int, replicas int) error
	ScaleLandscapeServices(wsId int, services map[string]int) error
	SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error
	ExecCommand(workspaceId int, command string, workdir string, env map[string]string) (string, string, error)
	ListWorkspacePlans() ([]api.WorkspacePlan, error)
	DeployWorkspace(args api.DeployWorkspaceArgs) (*api.Workspace, error)
	DeleteWorkspace(wsId int) error
	StartPipelineStage(wsId int, profile string, stage string) error
	StopPipelineStage(wsId int, stage string) error
	GetPipelineState(wsId int, stage string) ([]api.PipelineStatus, error)
	GitPull(wsId int, remote string, branch string) error
	DeployLandscape(wsId int, profile string) error
	CreateTeam(orgId string, name string, dcId int) (*api.Team, error)
	DeleteTeam(teamId int) error
	AddTeamMember(teamId int, email string, role int) error
	RemoveTeamMember(teamId int, userId int) error
	ListTeamMembers(teamId int) ([]api.TeamMember, error)
}

Client is the common API contract consumed by all CLI commands.

type OutputFormat

type OutputFormat string
const (
	OutputFormatTable OutputFormat = "table"
	OutputFormatJSON  OutputFormat = "json"
	OutputFormatYAML  OutputFormat = "yaml"
)

type RootOptions

type RootOptions interface {
	GetTeamId() (int, error)
	GetOrgId() (string, error)
	GetWorkspaceId() (int, error)
	GetApiUrl() string
	GetApiToken() (string, error)
	GetVerbose() bool
	NewClient() (*api.Client, error)
}

Jump to

Keyboard shortcuts

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