Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProviderNotSupported = func(providerType string) error { return fmt.Errorf("git provider '%s' not supported", providerType) } ErrAuthenticationFailed = func(err error) error { return fmt.Errorf("authentication failed, make sure credentials are correct: %w", err) } )
Errors
View Source
var ( ErrNilOpts = errors.New("options cannot be nil") ErrNoParse = errors.New("must call Parse before using CloneOptions") ErrRepoNotFound = errors.New("git repository not found") ErrNoRemotes = errors.New("no remotes in repository") )
Errors
Functions ¶
Types ¶
type AddFlagsOptions ¶ added in v0.2.8
type AddFlagsOptions struct { FS billy.Filesystem Prefix string CreateIfNotExist bool Optional bool }
type Client ¶ added in v0.2.10
type Client interface { CreateOrgRepo(org string, opt gt.CreateRepoOption) (*gt.Repository, *gt.Response, error) CreateRepo(opt gt.CreateRepoOption) (*gt.Repository, *gt.Response, error) GetMyUserInfo() (*gt.User, *gt.Response, error) }
type CloneOptions ¶
type CloneOptions struct { Provider string Repo string Auth Auth FS fs.FS Progress io.Writer // contains filtered or unexported fields }
func AddFlags ¶
func AddFlags(cmd *cobra.Command, opts *AddFlagsOptions) *CloneOptions
func (*CloneOptions) GetRepo ¶ added in v0.2.8
func (o *CloneOptions) GetRepo(ctx context.Context) (Repository, fs.FS, error)
func (*CloneOptions) Parse ¶ added in v0.2.0
func (o *CloneOptions) Parse()
func (*CloneOptions) Path ¶ added in v0.2.0
func (o *CloneOptions) Path() string
func (*CloneOptions) Revision ¶
func (o *CloneOptions) Revision() string
func (*CloneOptions) URL ¶
func (o *CloneOptions) URL() string
type CreateRepoOptions ¶
type GetRepoOptions ¶
type Provider ¶
type Provider interface { // CreateRepository creates the repository in the remote provider and returns a // clone url CreateRepository(ctx context.Context, opts *CreateRepoOptions) (string, error) }
Provider represents a git provider
type ProviderOptions ¶
ProviderOptions for a new git provider
type PushOptions ¶
type Repository ¶
type Repository interface { // Persist runs add, commit and push to the repository default remote Persist(ctx context.Context, opts *PushOptions) (string, error) // CurrentBranch returns the name of the current branch CurrentBranch() (string, error) }
Repository represents a git repository
Click to show internal directories.
Click to hide internal directories.