cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLicensesCmd

func AddLicensesCmd(rootCmd *cobra.Command)

func AddListCmd

func AddListCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddLogCmd

func AddLogCmd(rootCmd *cobra.Command, opts GlobalOptions)

func AddSetEnvVarCmd

func AddSetEnvVarCmd(p *cobra.Command, opts GlobalOptions)

func AddVersionCmd

func AddVersionCmd(rootCmd *cobra.Command)

func Execute

func Execute()

func GetRootCmd

func GetRootCmd() *cobra.Command

Types

type Client

type Client interface {
	ListTeams() ([]api.Team, error)
	ListWorkspaces(teamId int) ([]api.Workspace, error)
	SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error
}

func NewClient

func NewClient(opts GlobalOptions) (Client, error)

type Env

type Env interface {
	GetApiToken() (string, error)
	GetTeamId() (int, error)
	GetWorkspaceId() (int, error)
	GetApiUrl() string
}

type ErrResponse

type ErrResponse struct {
	Status  int    `json:"status"`
	Title   string `json:"title"`
	Detail  string `json:"detail"`
	TraceId string `json:"traceId"`
}

type GlobalOptions

type GlobalOptions struct {
	ApiUrl      *string
	TeamId      *int
	WorkspaceId *int
	Env         Env
}

func (GlobalOptions) GetApiUrl

func (o GlobalOptions) GetApiUrl() string

func (GlobalOptions) GetTeamId

func (o GlobalOptions) GetTeamId() (int, error)

func (GlobalOptions) GetWorkspaceId

func (o GlobalOptions) GetWorkspaceId() (int, error)

type LicensesCmd

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

LicensesCmd represents the licenses command

func (*LicensesCmd) RunE

func (c *LicensesCmd) RunE(_ *cobra.Command, args []string) error

type ListCmd

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

type ListTeamsCmd

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

func (*ListTeamsCmd) RunE

func (l *ListTeamsCmd) RunE(_ *cobra.Command, args []string) (err error)

type ListWorkspacesCmd

type ListWorkspacesCmd struct {
	Opts GlobalOptions
	// contains filtered or unexported fields
}

func (*ListWorkspacesCmd) ListWorkspaces

func (l *ListWorkspacesCmd) ListWorkspaces(client Client) ([]api.Workspace, error)

func (*ListWorkspacesCmd) RunE

func (l *ListWorkspacesCmd) RunE(_ *cobra.Command, args []string) (err error)

type LogCmd

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

func (*LogCmd) RunE

func (l *LogCmd) RunE(_ *cobra.Command, args []string) (err error)

type LogCmdScope

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

type LogEntry

type LogEntry struct {
	Timestamp string `json:"timestamp"`
	Kind      string `json:"kind"`
	Data      string `json:"data"`
}

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

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

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) ListTeams

func (_mock *MockClient) ListTeams() ([]api.Team, error)

ListTeams provides a mock function for the type MockClient

func (*MockClient) ListWorkspaces

func (_mock *MockClient) ListWorkspaces(teamId int) ([]api.Workspace, error)

ListWorkspaces provides a mock function for the type MockClient

func (*MockClient) SetEnvVarOnWorkspace

func (_mock *MockClient) SetEnvVarOnWorkspace(workspaceId int, vars map[string]string) error

SetEnvVarOnWorkspace provides a mock function for the type MockClient

type MockClient_Expecter

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

func (*MockClient_Expecter) ListTeams

ListTeams is a helper method to define mock.On call

func (*MockClient_Expecter) ListWorkspaces

func (_e *MockClient_Expecter) ListWorkspaces(teamId interface{}) *MockClient_ListWorkspaces_Call

ListWorkspaces is a helper method to define mock.On call

  • teamId

func (*MockClient_Expecter) SetEnvVarOnWorkspace

func (_e *MockClient_Expecter) SetEnvVarOnWorkspace(workspaceId interface{}, vars interface{}) *MockClient_SetEnvVarOnWorkspace_Call

SetEnvVarOnWorkspace is a helper method to define mock.On call

  • workspaceId
  • vars

type MockClient_ListTeams_Call

type MockClient_ListTeams_Call struct {
	*mock.Call
}

MockClient_ListTeams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTeams'

func (*MockClient_ListTeams_Call) Return

func (*MockClient_ListTeams_Call) Run

func (*MockClient_ListTeams_Call) RunAndReturn

func (_c *MockClient_ListTeams_Call) RunAndReturn(run func() ([]api.Team, error)) *MockClient_ListTeams_Call

type MockClient_ListWorkspaces_Call

type MockClient_ListWorkspaces_Call struct {
	*mock.Call
}

MockClient_ListWorkspaces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWorkspaces'

func (*MockClient_ListWorkspaces_Call) Return

func (*MockClient_ListWorkspaces_Call) Run

func (*MockClient_ListWorkspaces_Call) RunAndReturn

func (_c *MockClient_ListWorkspaces_Call) RunAndReturn(run func(teamId int) ([]api.Workspace, error)) *MockClient_ListWorkspaces_Call

type MockClient_SetEnvVarOnWorkspace_Call

type MockClient_SetEnvVarOnWorkspace_Call struct {
	*mock.Call
}

MockClient_SetEnvVarOnWorkspace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEnvVarOnWorkspace'

func (*MockClient_SetEnvVarOnWorkspace_Call) Return

func (*MockClient_SetEnvVarOnWorkspace_Call) Run

func (*MockClient_SetEnvVarOnWorkspace_Call) RunAndReturn

func (_c *MockClient_SetEnvVarOnWorkspace_Call) RunAndReturn(run func(workspaceId int, vars map[string]string) error) *MockClient_SetEnvVarOnWorkspace_Call

type MockEnv

type MockEnv struct {
	mock.Mock
}

MockEnv is an autogenerated mock type for the Env type

func NewMockEnv

func NewMockEnv(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockEnv

NewMockEnv creates a new instance of MockEnv. 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 (*MockEnv) EXPECT

func (_m *MockEnv) EXPECT() *MockEnv_Expecter

func (*MockEnv) GetApiToken

func (_mock *MockEnv) GetApiToken() (string, error)

GetApiToken provides a mock function for the type MockEnv

func (*MockEnv) GetApiUrl

func (_mock *MockEnv) GetApiUrl() string

GetApiUrl provides a mock function for the type MockEnv

func (*MockEnv) GetTeamId

func (_mock *MockEnv) GetTeamId() (int, error)

GetTeamId provides a mock function for the type MockEnv

func (*MockEnv) GetWorkspaceId

func (_mock *MockEnv) GetWorkspaceId() (int, error)

GetWorkspaceId provides a mock function for the type MockEnv

type MockEnv_Expecter

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

func (*MockEnv_Expecter) GetApiToken

func (_e *MockEnv_Expecter) GetApiToken() *MockEnv_GetApiToken_Call

GetApiToken is a helper method to define mock.On call

func (*MockEnv_Expecter) GetApiUrl

func (_e *MockEnv_Expecter) GetApiUrl() *MockEnv_GetApiUrl_Call

GetApiUrl is a helper method to define mock.On call

func (*MockEnv_Expecter) GetTeamId

func (_e *MockEnv_Expecter) GetTeamId() *MockEnv_GetTeamId_Call

GetTeamId is a helper method to define mock.On call

func (*MockEnv_Expecter) GetWorkspaceId

func (_e *MockEnv_Expecter) GetWorkspaceId() *MockEnv_GetWorkspaceId_Call

GetWorkspaceId is a helper method to define mock.On call

type MockEnv_GetApiToken_Call

type MockEnv_GetApiToken_Call struct {
	*mock.Call
}

MockEnv_GetApiToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiToken'

func (*MockEnv_GetApiToken_Call) Return

func (*MockEnv_GetApiToken_Call) Run

func (*MockEnv_GetApiToken_Call) RunAndReturn

func (_c *MockEnv_GetApiToken_Call) RunAndReturn(run func() (string, error)) *MockEnv_GetApiToken_Call

type MockEnv_GetApiUrl_Call

type MockEnv_GetApiUrl_Call struct {
	*mock.Call
}

MockEnv_GetApiUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiUrl'

func (*MockEnv_GetApiUrl_Call) Return

func (*MockEnv_GetApiUrl_Call) Run

func (_c *MockEnv_GetApiUrl_Call) Run(run func()) *MockEnv_GetApiUrl_Call

func (*MockEnv_GetApiUrl_Call) RunAndReturn

func (_c *MockEnv_GetApiUrl_Call) RunAndReturn(run func() string) *MockEnv_GetApiUrl_Call

type MockEnv_GetTeamId_Call

type MockEnv_GetTeamId_Call struct {
	*mock.Call
}

MockEnv_GetTeamId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeamId'

func (*MockEnv_GetTeamId_Call) Return

func (*MockEnv_GetTeamId_Call) Run

func (_c *MockEnv_GetTeamId_Call) Run(run func()) *MockEnv_GetTeamId_Call

func (*MockEnv_GetTeamId_Call) RunAndReturn

func (_c *MockEnv_GetTeamId_Call) RunAndReturn(run func() (int, error)) *MockEnv_GetTeamId_Call

type MockEnv_GetWorkspaceId_Call

type MockEnv_GetWorkspaceId_Call struct {
	*mock.Call
}

MockEnv_GetWorkspaceId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkspaceId'

func (*MockEnv_GetWorkspaceId_Call) Return

func (*MockEnv_GetWorkspaceId_Call) Run

func (*MockEnv_GetWorkspaceId_Call) RunAndReturn

func (_c *MockEnv_GetWorkspaceId_Call) RunAndReturn(run func() (int, error)) *MockEnv_GetWorkspaceId_Call

type SSE

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

type SetEnvVarCmd

type SetEnvVarCmd struct {
	Opts SetEnvVarOptions
	// contains filtered or unexported fields
}

func (*SetEnvVarCmd) RunE

func (l *SetEnvVarCmd) RunE(_ *cobra.Command, args []string) (err error)

func (*SetEnvVarCmd) SetEnvironmentVariables

func (l *SetEnvVarCmd) SetEnvironmentVariables(client Client) (err error)

type SetEnvVarOptions

type SetEnvVarOptions struct {
	GlobalOptions
	EnvVar *[]string
}

type VersionCmd

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

VersionCmd represents the version command

func (*VersionCmd) RunE

func (c *VersionCmd) RunE(_ *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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