workspace

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

View Source
var WorkspaceCache = common.NewCache[Workspace]()

Functions

func GetWorkspaceSlugs

func GetWorkspaceSlugs(context context.Context, cmd *cobra.Command, args []string, toComplete string) (slugs []string, err error)

GetWorkspaceSlugs gets the slugs of all workspaces

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"`
}

func (Member) GetHeader added in v0.3.0

func (member Member) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Member) GetRow added in v0.3.0

func (member Member) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

type Members added in v0.3.0

type Members []Member

func (Members) GetHeader added in v0.3.0

func (members Members) GetHeader() []string

GetHeader gets the header for a table

implements common.Tableables

func (Members) GetRowAt added in v0.3.0

func (members Members) GetRowAt(index int, headers []string) []string

GetRowAt gets the row for a table

implements common.Tableables

func (Members) Size added in v0.3.0

func (members Members) Size() int

Size gets the number of elements

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

func (workspace Workspace) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Workspace) GetID added in v0.12.0

func (workspace Workspace) GetID() uuid.UUID

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

func (Workspace) GetName added in v0.12.0

func (workspace Workspace) GetName() string

GetName gets the name of the workspace

implements core.Named

func (Workspace) GetRow added in v0.3.0

func (workspace Workspace) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳