factory

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package factory provides dependency injection for commands

Index

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 New

func New() *Factory

New creates a new Factory with defaults

func (*Factory) APIClient

func (f *Factory) APIClient() (*api.Client, error)

APIClient returns the API client (lazy loaded)

func (*Factory) AuthToken

func (f *Factory) AuthToken() (*auth.Token, error)

AuthToken returns the auth token (lazy loaded)

func (*Factory) Config

func (f *Factory) Config() (*config.Config, error)

Config returns the configuration (lazy loaded)

func (*Factory) CurrentProject

func (f *Factory) CurrentProject() (string, error)

CurrentProject returns the project from flag or config

func (*Factory) CurrentWorkspace

func (f *Factory) CurrentWorkspace() (string, error)

CurrentWorkspace returns the workspace from flag or config

func (*Factory) Formatter

func (f *Factory) Formatter() output.Formatter

Formatter returns the appropriate output formatter

func (*Factory) GitContext

func (f *Factory) GitContext() (*git.Context, error)

GitContext returns the current git context (lazy loaded)

func (*Factory) IsAuthenticated

func (f *Factory) IsAuthenticated() bool

IsAuthenticated checks if user is authenticated without returning error

func (*Factory) RequireAuth

func (f *Factory) RequireAuth() error

RequireAuth ensures user is authenticated

func (*Factory) RequireProject

func (f *Factory) RequireProject() (string, error)

RequireProject ensures a project is configured and returns its slug

func (*Factory) RequireWorkspace

func (f *Factory) RequireWorkspace() (string, error)

RequireWorkspace ensures a workspace is configured and returns its slug

func (*Factory) RequireWorkspaceAndProject

func (f *Factory) RequireWorkspaceAndProject() (string, string, error)

RequireWorkspaceAndProject ensures both workspace and project are configured

func (*Factory) Services

func (f *Factory) Services() *services.Services

Services returns the service layer (lazy loaded)

Jump to

Keyboard shortcuts

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