cmdutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserOpener

type BrowserOpener func(string) error

BrowserOpener opens a URL in the user's browser.

type ClientBuilder

type ClientBuilder func(client.Options) (*gitverse.Client, auth.Credentials, error)

ClientBuilder builds an SDK client from command configuration.

type Factory

type Factory struct {
	NewClient         ClientBuilder
	BrowserOpener     BrowserOpener
	GitRunner         GitRunner
	HTTPDo            HTTPDoer
	CurrentRepository flags.GitRepositoryResolver
}

Factory carries command runtime dependencies.

func NewFactory

func NewFactory() *Factory

NewFactory returns a factory backed by real command dependencies.

func (*Factory) Do

func (f *Factory) Do(req *http.Request) (*http.Response, error)

Do executes an HTTP request.

func (*Factory) ErrWriter

func (f *Factory) ErrWriter(cmd *cli.Command) io.Writer

ErrWriter returns the command error writer.

func (*Factory) OpenURL

func (f *Factory) OpenURL(url string) error

OpenURL opens a URL in the user's browser.

func (*Factory) ResolveExplicitRepo

func (f *Factory) ResolveExplicitRepo(cmd *cli.Command) (flags.RepoSelection, error)

ResolveExplicitRepo resolves an explicit repository argument.

func (*Factory) ResolveRepo

func (f *Factory) ResolveRepo(cmd *cli.Command) (flags.RepoSelection, error)

ResolveRepo resolves a repository for repo-scoped commands.

func (*Factory) ResolveRepoContext

func (f *Factory) ResolveRepoContext(cmd *cli.Command) (flags.RepoSelection, error)

ResolveRepoContext resolves a repository without consuming positional args.

func (*Factory) RunGit

func (f *Factory) RunGit(cmd *cli.Command, args ...string) error

RunGit runs git with the command's standard streams.

func (*Factory) SDK

func (f *Factory) SDK(cmd *cli.Command) (*gitverse.Client, error)

SDK returns an SDK client for a command.

func (*Factory) SDKWithCredentials

func (f *Factory) SDKWithCredentials(cmd *cli.Command) (*gitverse.Client, auth.Credentials, error)

SDKWithCredentials returns an SDK client and the credentials used to build it.

func (*Factory) Writer

func (f *Factory) Writer(cmd *cli.Command) io.Writer

Writer returns the command output writer.

type GitRunner

type GitRunner func(*cli.Command, ...string) error

GitRunner runs git with the command's standard streams.

type HTTPDoer

type HTTPDoer func(*http.Request) (*http.Response, error)

HTTPDoer executes an HTTP request.

Source Files

  • factory.go

Jump to

Keyboard shortcuts

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