Documentation ¶
Index ¶
- func GetRepoHTTPClient(repoURL string, insecure bool, creds Creds) *http.Client
- func IsCommitSHA(sha string) bool
- func IsHTTPSURL(url string) bool
- func IsSSHURL(url string) (bool, string)
- func IsTruncatedCommitSHA(sha string) bool
- func NormalizeGitURL(repo string) string
- func SameURL(leftRepo, rightRepo string) bool
- func TestRepo(repo string, creds Creds, insecure bool, enableLfs bool) error
- type Client
- type Creds
- type HTTPSCreds
- type NopCloser
- type NopCreds
- type RevisionMetadata
- type SSHCreds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepoHTTPClient ¶ added in v1.2.0
Returns a HTTP client object suitable for go-git to use using the following pattern:
- If insecure is true, always returns a client with certificate verification turned off.
- If one or more custom certificates are stored for the repository, returns a client with those certificates in the list of root CAs used to verify the server's certificate.
- Otherwise (and on non-fatal errors), a default HTTP client is returned.
func IsCommitSHA ¶
IsCommitSHA returns whether or not a string is a 40 character SHA-1
func IsHTTPSURL ¶ added in v1.2.0
IsHTTPSURL returns true if supplied URL is HTTPS URL
func IsTruncatedCommitSHA ¶
IsTruncatedCommitSHA returns whether or not a string is a truncated SHA-1
func NormalizeGitURL ¶
NormalizeGitURL normalizes a git URL for purposes of comparison, as well as preventing redundant local clones (by normalizing various forms of a URL to a consistent location). Prefer using SameURL() over this function when possible. This algorithm may change over time and should not be considered stable from release to release
Types ¶
type Client ¶
type Client interface { Root() string Init() error Fetch() error Checkout(revision string) error LsRemote(revision string) (string, error) LsFiles(path string) ([]string, error) LsLargeFiles() ([]string, error) CommitSHA() (string, error) RevisionMetadata(revision string) (*RevisionMetadata, error) }
Client is a generic git client interface
type HTTPSCreds ¶ added in v1.1.0
type HTTPSCreds struct {
// contains filtered or unexported fields
}
HTTPS creds implementation
func NewHTTPSCreds ¶ added in v1.1.0
type RevisionMetadata ¶ added in v1.2.0
type SSHCreds ¶ added in v1.1.0
type SSHCreds struct {
// contains filtered or unexported fields
}
SSH implementation