factory

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory provides centralized dependency management for commands

func New

func New() *Factory

New creates a new factory instance

func (*Factory) AccountID

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

AccountID returns the account ID to use, either from override or default

func (*Factory) ApiClient

func (f *Factory) ApiClient() (*api.ModularClient, error)

ApiClient returns the API client, creating it once if needed

func (*Factory) ApplyOverrides added in v0.6.0

func (f *Factory) ApplyOverrides(accountID, projectID string) *Factory

ApplyOverrides applies account and project overrides if they are not empty. This is a helper function to reduce duplication across commands.

func (*Factory) AuthClient

func (f *Factory) AuthClient() (*auth.Client, error)

AuthClient returns the auth client, creating it once if needed

func (*Factory) Config

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

Config returns the loaded configuration, loading it once if needed

func (*Factory) Context

func (f *Factory) Context() context.Context

Context returns a context for API operations This can be extended in the future to include timeouts, tracing, etc.

func (*Factory) ProjectID

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

ProjectID returns the project ID to use, either from override or default

func (*Factory) WithAccount

func (f *Factory) WithAccount(accountID string) *Factory

WithAccount sets a specific account ID to use

func (*Factory) WithProject

func (f *Factory) WithProject(projectID string) *Factory

WithProject sets a specific project ID to use

Jump to

Keyboard shortcuts

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