aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/client/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/client/example_test.go')
-rw-r--r--plumbing/transport/client/example_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/plumbing/transport/client/example_test.go b/plumbing/transport/client/example_test.go
new file mode 100644
index 0000000..3e7a4f0
--- /dev/null
+++ b/plumbing/transport/client/example_test.go
@@ -0,0 +1,21 @@
+package client_test
+
+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 ExampleInstallProtocol() {
+ // 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))
+}