Documentation
¶
Overview ¶
Package git contains functions to interact with repos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSHA1Hash ¶
CheckSHA1Hash checks if a string is a valid git SHA hash (40 hex characters).
Types ¶
type AuthProvider ¶
type AuthProvider interface {
GetAuthMethod() (transport.AuthMethod, error)
}
AuthProvider wraps a specific auth method.
type CloneOptions ¶
type CloneOptions struct {
Repo string
RefName string
Directory string
Path string // Optional path for sparse checkout
}
CloneOptions configure for git actions.
type Cloner ¶
type Cloner interface {
CloneRepository(store storage.Storer, fs billy.Filesystem, auth AuthProvider, opts CloneOptions) (*plumbing.Reference, error)
}
Cloner can clone git repositories with (optional) authentication.
type CompositeAuthProvider ¶
type CompositeAuthProvider struct {
Providers []AuthProvider
}
CompositeAuthProvider tries multiple auth providers in order until one succeeds.
func (*CompositeAuthProvider) GetAuthMethod ¶
func (c *CompositeAuthProvider) GetAuthMethod() (transport.AuthMethod, error)
GetAuthMethod returns the first successful auth method.
type DefaultCloner ¶
type DefaultCloner struct{}
DefaultCloner is the default implementation of Cloner.
func (*DefaultCloner) CloneRepository ¶
func (dc *DefaultCloner) CloneRepository(store storage.Storer, fs billy.Filesystem, auth AuthProvider, opts CloneOptions) (*plumbing.Reference, error)
CloneRepository clones a git repository using the provided CloneOptions and AuthProvider.
type HTTPSAuthProvider ¶
HTTPSAuthProvider provides authentication for HTTPS repositories.
func (*HTTPSAuthProvider) GetAuthMethod ¶
func (a *HTTPSAuthProvider) GetAuthMethod() (transport.AuthMethod, error)
GetAuthMethod returns the HTTP BasicAuth transport method.
type SSHAgentAuthProvider ¶
type SSHAgentAuthProvider struct {
Username string
}
SSHAgentAuthProvider provides authentication using the SSH agent.
func (*SSHAgentAuthProvider) GetAuthMethod ¶
func (a *SSHAgentAuthProvider) GetAuthMethod() (transport.AuthMethod, error)
GetAuthMethod returns the SSH agent auth method.
type SSHAuthProvider ¶
SSHAuthProvider provides authentication for SSH repositories.
func (*SSHAuthProvider) GetAuthMethod ¶
func (a *SSHAuthProvider) GetAuthMethod() (transport.AuthMethod, error)
GetAuthMethod returns the SSH PublicKey transport method.