Documentation
¶
Index ¶
- func AddFormatFlag(cmd *cobra.Command, format *string, jsonFlag *bool)
- type Factory
- func (f *Factory) FormatAndPrint(data interface{}, format string, jsonFlag bool) error
- func (f *Factory) FullProjectPath() (string, error)
- func (f *Factory) GetHostVersion(host string) string
- func (f *Factory) GetOutputFormat() string
- func (f *Factory) IsJSONFormat() bool
- func (f *Factory) SetOutputFormat(format string)
- func (f *Factory) SetRepoOverride(repo string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct {
IOStreams *iostreams.IOStreams
Config func() (*config.Config, error)
Client func() (*api.Client, error)
Remote func() (*git.Remote, error)
Version string
// contains filtered or unexported fields
}
Factory provides shared dependencies for commands.
func NewFactory ¶
func NewFactory() *Factory
NewFactory creates a Factory with default implementations.
func (*Factory) FormatAndPrint ¶ added in v0.2.0
FormatAndPrint formats and prints data according to format flags. It handles backward compatibility for the --json flag.
func (*Factory) FullProjectPath ¶
FullProjectPath returns the "owner/repo" path from the current git remote, or from the --repo override if set.
func (*Factory) GetHostVersion ¶ added in v0.2.0
GetHostVersion returns the cached GitLab version for a given host. Returns empty string if version is unknown or not cached (graceful degradation).
func (*Factory) GetOutputFormat ¶ added in v0.2.0
GetOutputFormat returns the current output format.
func (*Factory) IsJSONFormat ¶ added in v0.2.0
IsJSONFormat returns true if the output format is JSON.
func (*Factory) SetOutputFormat ¶ added in v0.2.0
SetOutputFormat sets the output format for the command execution. This is used to determine how errors should be formatted.
func (*Factory) SetRepoOverride ¶ added in v0.0.9
SetRepoOverride parses a HOST/OWNER/REPO string and stores it.