vcs

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package vcs exposes interfaces and methods implemented by a VCS.

Index

Constants

View Source
const (
	HTTPS  = "https"
	HTTP   = "http"
	SSHGit = "ssh+git"
	Git    = "git"
)

List of supported schemes.

Variables

This section is empty.

Functions

func Errorf

func Errorf(vcs string, a ...interface{}) error

Errorf returns a new error message by combining various errors with the name of the VCS as prefix.

func IsSecureScheme

func IsSecureScheme(s string) bool

IsSecureScheme returns true if the given scheme is marked as secure.

func RepoPath

func RepoPath(u *url.URL) string

RepoPath returns the path of the repository based on its URL.

func URLScheme

func URLScheme(name string) string

URLScheme returns the protocol scheme to use as prefix path for this scheme.

Types

type BasicAuth added in v0.5.0

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth contains basic auth properties.

type BasicAuthentifier added in v0.5.0

type BasicAuthentifier interface {
	BasicAuth(host string) *BasicAuth
}

BasicAuthentifier must be implemented to allow request with basic host by hostname.

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

Client must be implemented by any HTTP client.

type ClientChooser

type ClientChooser interface {
	ClientFor(path string) Client
	AllowInsecure(path string) bool
}

ClientChooser must be implemented to return a HTTPClient Client for the given rawURL.

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient allows to communicate over HTTPClient or HTTPS.

func NewHTTPClient

func NewHTTPClient(timeout time.Duration, insecurePaths string) *HTTPClient

NewHTTPClient creates a new instance of Client.

func (*HTTPClient) AllowInsecure

func (c *HTTPClient) AllowInsecure(target string) bool

AllowInsecure returns true if this rawURL allows insecure request.

func (*HTTPClient) ClientFor

func (c *HTTPClient) ClientFor(path string) Client

ClientFor returns the HTTPClient client to use for this rawURL.

type System

type System interface {
	CanFetch(path string) bool
	FetchPath(ctx context.Context, path string) (semver.Tags, error)
	FetchURL(ctx context.Context, url string) (semver.Tags, error)
}

System must be implemented by any VCS.

Directories

Path Synopsis
Package git provides methods to handle Git.
Package git provides methods to handle Git.
Package goget provides methods to deal with go get as VCS.
Package goget provides methods to deal with go get as VCS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL