Documentation ¶
Overview ¶
Package client contains helper function to deal with the different client protocols.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
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.
Functions ¶
func InstallProtocol ¶
InstallProtocol adds or modifies an existing protocol.
Example ¶
package main import ( "crypto/tls" "net/http" "gopkg.in/src-d/go-git.v4/plumbing/transport/client" githttp "gopkg.in/src-d/go-git.v4/plumbing/transport/http" ) func main() { // 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)) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.