Documentation
¶
Overview ¶
Package factory provides dependency injection for commands
Index ¶
- type Factory
- func (f *Factory) APIClient() (*api.Client, error)
- func (f *Factory) AuthToken() (*auth.Token, error)
- func (f *Factory) Config() (*config.Config, error)
- func (f *Factory) CurrentProject() (string, error)
- func (f *Factory) CurrentWorkspace() (string, error)
- func (f *Factory) Formatter() output.Formatter
- func (f *Factory) GitContext() (*git.Context, error)
- func (f *Factory) IsAuthenticated() bool
- func (f *Factory) RequireAuth() error
- func (f *Factory) RequireProject() (string, error)
- func (f *Factory) RequireWorkspace() (string, error)
- func (f *Factory) RequireWorkspaceAndProject() (string, string, error)
- func (f *Factory) Services() *services.Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// Output format (table, json, quiet)
OutputFormat output.Format
// contains filtered or unexported fields
}
Factory holds all dependencies for commands
func (*Factory) CurrentProject ¶
CurrentProject returns the project from flag or config
func (*Factory) CurrentWorkspace ¶
CurrentWorkspace returns the workspace from flag or config
func (*Factory) GitContext ¶
GitContext returns the current git context (lazy loaded)
func (*Factory) IsAuthenticated ¶
IsAuthenticated checks if user is authenticated without returning error
func (*Factory) RequireAuth ¶
RequireAuth ensures user is authenticated
func (*Factory) RequireProject ¶
RequireProject ensures a project is configured and returns its slug
func (*Factory) RequireWorkspace ¶
RequireWorkspace ensures a workspace is configured and returns its slug
func (*Factory) RequireWorkspaceAndProject ¶
RequireWorkspaceAndProject ensures both workspace and project are configured
Click to show internal directories.
Click to hide internal directories.