Documentation
¶
Overview ¶
Package git implements a Gatherer for git repository sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitGatherer ¶
type GitGatherer struct {
GitMetadata
Authenticator SSHAuthenticator
}
GitGatherer gathers resources by cloning git repositories.
func (*GitGatherer) Matcher ¶
func (g *GitGatherer) Matcher(uri string) bool
Matcher returns true if the URI looks like a git repository.
type GitMetadata ¶
type GitMetadata struct {
Path string
CommitHash string
Author string
Timestamp string
LatestCommit string
}
GitMetadata holds metadata about a gathered git repository.
func (GitMetadata) GetPinnedURL ¶
func (g GitMetadata) GetPinnedURL(u string) (string, error)
GetPinnedURL returns a git:: URL pinned to the latest commit hash.
type RealSSHAuthenticator ¶
type RealSSHAuthenticator struct{}
RealSSHAuthenticator represents an implementation of the SSHAuthenticator interface.
func (*RealSSHAuthenticator) NewSSHAgentAuth ¶
func (r *RealSSHAuthenticator) NewSSHAgentAuth(user string) (transport.AuthMethod, error)
NewSSHAgentAuth returns an AuthMethod that uses the SSH agent for authentication. It uses the specified user as the username for authentication.
type SSHAuthenticator ¶
type SSHAuthenticator interface {
// NewSSHAgentAuth returns a new SSH agent authentication method for the given user.
// It returns an instance of transport.AuthMethod and an error if any.
NewSSHAgentAuth(user string) (transport.AuthMethod, error)
}
SSHAuthenticator represents an interface for authenticating SSH connections.
Click to show internal directories.
Click to hide internal directories.