Documentation
¶
Index ¶
- Variables
- func FlagValue(cmd *cobra.Command, name string) string
- func HostKeyFromURL(baseURL string) (string, error)
- func NewHTTPClient(host *config.Host, storeCode string) (*httpx.Client, error)
- func NewMagentoClient(host *config.Host, storeCode string) (*magento.Client, error)
- func NormalizeBaseURL(raw string) (string, error)
- func NotImplemented(cmd *cobra.Command) error
- func ResolveContext(f *Factory, cmd *cobra.Command, override string) (string, *config.Context, *config.Host, error)
- func ResolveHost(f *Factory, contextOverride, hostOverride string) (string, *config.Host, error)
- func WriteOutput(cmd *cobra.Command, w io.Writer, data any, fallback func() error) error
- type ExitError
- type Factory
- func (f *Factory) BrowserOpener() browser.Browser
- func (f *Factory) PagerManager() pager.Manager
- func (f *Factory) ProgressSpinner() progress.Spinner
- func (f *Factory) Prompt() prompter.Interface
- func (f *Factory) ResolveConfig() (*config.Config, error)
- func (f *Factory) Streams() (*iostreams.IOStreams, error)
- type OutputSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSilent = errors.New("silent") ErrPending = errors.New("pending") )
Functions ¶
func HostKeyFromURL ¶
func NewHTTPClient ¶
NewHTTPClient constructs a raw HTTP client for the configured host.
func NewMagentoClient ¶
NewMagentoClient constructs a Magento API client from the resolved context.
func NormalizeBaseURL ¶
func NotImplemented ¶
func ResolveContext ¶
func ResolveContext(f *Factory, cmd *cobra.Command, override string) (string, *config.Context, *config.Host, error)
ResolveContext fetches the context and host configuration given an optional override name (typically provided via --context).
func ResolveHost ¶
ResolveHost locates a host configuration using optional context or host overrides.
Types ¶
type Factory ¶
type Factory struct {
AppVersion string
ExecutableName string
IOStreams *iostreams.IOStreams
Config func() (*config.Config, error)
Browser browser.Browser
Pager pager.Manager
Prompter prompter.Interface
Spinner progress.Spinner
// contains filtered or unexported fields
}
func (*Factory) BrowserOpener ¶
func (*Factory) PagerManager ¶
func (*Factory) ProgressSpinner ¶
type OutputSettings ¶
func ResolveOutputSettings ¶
func ResolveOutputSettings(cmd *cobra.Command) (OutputSettings, error)
Click to show internal directories.
Click to hide internal directories.