go-git: github.com/go-git/go-git/plumbing/transport/client Index | Examples | Files

package client

import "github.com/go-git/go-git/plumbing/transport/client"

Package client contains helper function to deal with the different client protocols.



Package Files



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.

func InstallProtocol Uses

func InstallProtocol(scheme string, c transport.Transport)

InstallProtocol adds or modifies an existing protocol.


// 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))

func NewClient Uses

func NewClient(endpoint *transport.Endpoint) (transport.Transport, error)

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.