Documentation
¶
Index ¶
- Variables
- func GetWorkspaceSlugs(context context.Context, cmd *cobra.Command, args []string, toComplete string) (slugs []string, err error)
- type Member
- type Members
- type Membership
- type Memberships
- type Workspace
- func (workspace Workspace) GetHeader(short bool) []string
- func (workspace Workspace) GetID() uuid.UUID
- func (workspace Workspace) GetMembers(context context.Context, cmd *cobra.Command) (members []Member, err error)
- func (workspace Workspace) GetName() string
- func (workspace Workspace) GetRow(headers []string) []string
- type Workspaces
Constants ¶
This section is empty.
Variables ¶
var Command = &cobra.Command{ Use: "workspace", Short: "Manage workspaces", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Workspace requires a subcommand:") for _, command := range cmd.Commands() { fmt.Println(command.Name()) } }, }
Command represents this folder's command
var WorkspaceCache = common.NewCache[Workspace]()
Functions ¶
Types ¶
type Member ¶
type Member struct { Type string `json:"type" mapstructure:"type"` User user.User `json:"user" mapstructure:"user"` Workspace Workspace `json:"workspace" mapstructure:"workspace"` Links common.Links `json:"links" mapstructure:"links"` }
type Members ¶ added in v0.3.0
type Members []Member
func (Members) GetHeader ¶ added in v0.3.0
GetHeader gets the header for a table
implements common.Tableables
type Membership ¶
type Membership struct { Type string `json:"type" mapstructure:"type"` Permission string `json:"permission" mapstructure:"permission"` User user.User `json:"user" mapstructure:"user"` Workspace Workspace `json:"workspace" mapstructure:"workspace"` Links common.Links `json:"links" mapstructure:"links"` }
func (Membership) GetHeader ¶ added in v0.3.0
func (membership Membership) GetHeader(short bool) []string
GetHeader gets the header for a table
implements common.Tableable
func (Membership) GetRow ¶ added in v0.3.0
func (membership Membership) GetRow(headers []string) []string
GetRow gets the row for a table
implements common.Tableable
type Memberships ¶ added in v0.3.0
type Memberships []Membership
func (Memberships) GetHeader ¶ added in v0.3.0
func (memberships Memberships) GetHeader() []string
GetHeader gets the header for a table
implements common.Tableables
func (Memberships) GetRowAt ¶ added in v0.3.0
func (memberships Memberships) GetRowAt(index int, headers []string) []string
GetRowAt gets the row for a table
implements common.Tableables
func (Memberships) Size ¶ added in v0.3.0
func (memberships Memberships) Size() int
Size gets the number of elements
implements common.Tableables
type Workspace ¶
type Workspace struct { Type string `json:"type" mapstructure:"type"` ID common.UUID `json:"uuid" mapstructure:"uuid"` Name string `json:"name" mapstructure:"name"` Slug string `json:"slug" mapstructure:"slug"` Links common.Links `json:"links" mapstructure:"links"` }
func GetWorkspace ¶ added in v0.11.0
func GetWorkspace(context context.Context, cmd *cobra.Command, workspaceName string) (workspace *Workspace, err error)
GetWorkspace gets the workspace by its slug
func GetWorkspaceFromGit ¶ added in v0.11.0
func GetWorkspaceFromGit(context context.Context, cmd *cobra.Command) (workspace *Workspace, err error)
GetWorkspaceFromGit gets the workspace from the git config
func (Workspace) GetHeader ¶ added in v0.3.0
GetHeader gets the header for a table
implements common.Tableable
func (Workspace) GetID ¶ added in v0.12.0
GetID gets the ID of the workspace
implements core.Identifiable
func (Workspace) GetMembers ¶ added in v0.11.0
func (workspace Workspace) GetMembers(context context.Context, cmd *cobra.Command) (members []Member, err error)
GetMembers gets the members of the workspace
type Workspaces ¶ added in v0.3.0
type Workspaces []Workspace
func (Workspaces) GetHeader ¶ added in v0.3.0
func (workspaces Workspaces) GetHeader() []string
GetHeader gets the header for a table
implements common.Tableables
func (Workspaces) GetRowAt ¶ added in v0.3.0
func (workspaces Workspaces) GetRowAt(index int, headers []string) []string
GetRowAt gets the row for a table
implements common.Tableables
func (Workspaces) Size ¶ added in v0.3.0
func (pullrequests Workspaces) Size() int
Size gets the number of elements
implements common.Tableables