Documentation
¶
Index ¶
- Variables
- func LoginErrorCheck(err error) bool
- func NewController(configService config.ServiceInterface, repoClient repo.ClientInterface, ...) interfaces.CommandSetupController
- func WithSetup(ctx context.Context, deps Dependencies, req models.SetupRequest, ...) error
- type Controller
- type Dependencies
- type MockController
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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.