cmdsetup

package
v1.9.0-test2 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

This section is empty.

Variables

View Source
var (
	ErrOrganizationSelectionCanceled = eris.New("Organization selection canceled")
	ErrOrganizationCreationCanceled  = eris.New("Organization creation canceled")
)
View Source
var (
	ErrProjectSelectionCanceled = eris.New("Project selection canceled")
	ErrProjectCreationCanceled  = eris.New("Project creation canceled")
)
View Source
var (
	ErrLogin = eris.New("not logged in")
)

Functions

func LoginErrorCheck

func LoginErrorCheck(err error) bool

LoginErrorCheck is used to check if the error is a login error. Used to prevent reprinting the error which was already printed in a user friendly manner.

func NewController

func NewController(
	configService config.ServiceInterface,
	repoClient repo.ClientInterface,
	organizationHandler interfaces.OrganizationHandler,
	projectHandler interfaces.ProjectHandler,
	apiClient api.ClientInterface,
	inputService input.ServiceInterface,
) interfaces.CommandSetupController

func WithSetup

func WithSetup(
	ctx context.Context,
	deps Dependencies,
	req models.SetupRequest,
	handler func(models.CommandState) error,
) error

WithSetup is a wrapper function that performs the setup flow and calls the handler with the established state. This follows the same pattern as WithForgeContextSetup from forge.go.

Types

type Controller

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

func (*Controller) SetupCommandState

func (c *Controller) SetupCommandState(ctx context.Context, req models.SetupRequest) (models.CommandState, error)

SetupCommandState performs the setup flow and returns the established state.

type Dependencies

type Dependencies struct {
	ConfigService       config.ServiceInterface
	InputService        input.ServiceInterface
	APIClient           api.ClientInterface
	RepoClient          repo.ClientInterface
	OrganizationHandler interfaces.OrganizationHandler
	ProjectHandler      interfaces.ProjectHandler
	UserHandler         interfaces.UserHandler
	RootHandler         interfaces.RootHandler
	CloudHandler        interfaces.CloudHandler
	EVMHandler          interfaces.EVMHandler
	CardinalHandler     interfaces.CardinalHandler
	SetupController     interfaces.CommandSetupController
}

Dependencies holds all initialized clients and handlers.

type MockController

type MockController struct {
	mock.Mock
}

MockController is a mock implementation of CommandSetupController.

func (*MockController) SetupCommandState

func (m *MockController) SetupCommandState(
	ctx context.Context,
	req models.SetupRequest,
) (models.CommandState, error)

SetupCommandState mocks the setup command.

Jump to

Keyboard shortcuts

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