organization

package
v1.9.0-test Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxOrgNameLen = 50

Variables

View Source
var (
	ErrOrganizationSelectionCanceled = eris.New("Organization selection canceled")
	ErrCannotSwitchOrganization      = eris.New("Cannot switch organization, directory belongs to another project.")
	ErrOrganizationNotFoundWithSlug  = eris.New("Organization not found with slug: ")
)
View Source
var CmdPlugin struct {
	Organization *Cmd `cmd:"" aliases:"org"  group:"Organization Commands:" help:"Manage your organizations"`
}

Functions

func NewHandler

func NewHandler(
	projectHandler interfaces.ProjectHandler,
	inputService input.ServiceInterface,
	apiClient api.ClientInterface,
	configService config.ServiceInterface,
) interfaces.OrganizationHandler

Types

type Cmd

type Cmd struct {
	Create  *CreateCmd      `cmd:"" group:"Organization Commands:" help:"Create a new organization"`
	Switch  *SwitchCmd      `cmd:"" group:"Organization Commands:" help:"Switch to an organization"`
	Members *MembersListCmd `cmd:"" group:"Organization Commands:" help:"List members of an organization"`
}

type CreateCmd

type CreateCmd struct {
	Context      context.Context       `kong:"-"`
	Dependencies cmdsetup.Dependencies `kong:"-"`
	Name         string                `         flag:"" help:"The name of the organization"`
	Slug         string                `         flag:"" help:"The slug of the organization"`
}

func (*CreateCmd) Run

func (c *CreateCmd) Run() error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) Create

func (*Handler) MembersList

func (h *Handler) MembersList(ctx context.Context, org models.Organization, flags models.MembersListFlags) error

func (*Handler) PrintNoOrganizations

func (h *Handler) PrintNoOrganizations()

func (*Handler) PromptForSwitch

func (h *Handler) PromptForSwitch(
	ctx context.Context, orgs []models.Organization, enableCreation bool,
) (models.Organization, error)

func (*Handler) Switch

type MembersListCmd

type MembersListCmd struct {
	Context        context.Context       `kong:"-"`
	Dependencies   cmdsetup.Dependencies `kong:"-"`
	IncludeRemoved bool                  `         flag:"" help:"List removed members"`
}

func (*MembersListCmd) Run

func (c *MembersListCmd) Run() error

type MockHandler

type MockHandler struct {
	mock.Mock
}

func (*MockHandler) Create

func (*MockHandler) MembersList

func (m *MockHandler) MembersList(ctx context.Context, org models.Organization, flags models.MembersListFlags) error

func (*MockHandler) PrintNoOrganizations

func (m *MockHandler) PrintNoOrganizations()

func (*MockHandler) PromptForSwitch

func (m *MockHandler) PromptForSwitch(ctx context.Context, orgs []models.Organization, enableCreation bool,
) (models.Organization, error)

func (*MockHandler) Switch

type SwitchCmd

type SwitchCmd struct {
	Context      context.Context       `kong:"-"`
	Dependencies cmdsetup.Dependencies `kong:"-"`
	Slug         string                `         flag:"" help:"The slug of the organization to switch to"`
}

func (*SwitchCmd) Run

func (c *SwitchCmd) Run() error

Jump to

Keyboard shortcuts

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