go-git.v4: gopkg.in/src-d/go-git.v4/plumbing/transport/client Index | Examples | Files

package client

import "gopkg.in/src-d/go-git.v4/plumbing/transport/client"

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

Index

Examples

Package Files

client.go

Variables

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.

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

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) and is imported by 12 packages. Updated 2019-08-01. Refresh now. Tools for package owners.