import "github.com/go-git/go-git/plumbing/transport/client"
Package client contains helper function to deal with the different client protocols.
var Protocols = map[string]transport.Transport{ "http": http.DefaultClient, "https": http.DefaultClient, "ssh": ssh.DefaultClient, "git": git.DefaultClient, "file": file.DefaultClient, }
Protocols are the protocols supported by default.
InstallProtocol adds or modifies an existing protocol.
Code:
// Create custom net/http client that. httpClient := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, } // Install it as default client for https URLs. client.InstallProtocol("https", githttp.NewClient(httpClient))
NewClient returns the appropriate client among of the set of known protocols: http://, https://, ssh:// and file://. See `InstallProtocol` to add or modify protocols.
Package client imports 6 packages (graph). Updated 2020-03-18. Refresh now. Tools for package owners.