gitvcs

package
v0.0.0-...-57fe098 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package gitvcs is a VCS driver that integrates Grit with Git.

Index

Constants

This section is empty.

Variables

View Source
var Registration = vcsdriver.Registration{
	Name:         "git",
	Description:  "adds support for Git repositories",
	ConfigLoader: configLoader{},
}

Registration contains information about the driver used to register it with Grit's driver registry.

Functions

This section is empty.

Types

type Cloner

type Cloner struct {
	// SSHEndpoint is the URL used to clone the repository using the SSH
	// protocol, if available.
	SSHEndpoint string

	// SSHKeyFile is the path to the private SSH key used to authenticate when
	// using the SSH transport.
	//
	// If it is empty, the system's SSH agent is queried to determine which key
	// to use.
	SSHKeyFile string

	// SSHKeyPassphrase is the passphrase used to decrypt the SSH private key,
	// if any. It is ignored if SSHKeyFile is empty.
	SSHKeyPassphrase string

	// HTTPEndpoint is the URL used to clone the repository using the HTTP
	// protocol.
	HTTPEndpoint string

	// HTTPUsername is the username to use when cloning via HTTP, if any.
	HTTPUsername string

	// HTTPPassword is the password to use when cloning via HTTP, if any.
	HTTPPassword string

	// PreferHTTP indicates that the HTTP protocol should be used in preference
	// to SSH. By default SSH is preferred.
	PreferHTTP bool
}

Cloner is an implementation of sourcedriver.Cloner that clones a Git repository.

func (*Cloner) Clone

func (c *Cloner) Clone(
	ctx context.Context,
	dir string,
	log logs.Log,
) error

Clone clones the repository into the given target directory.

type Config

type Config struct {
	// SSHKeyFile is the path to the private SSH key used to authenticate when
	// using the SSH transport.
	//
	// If it is empty, the system's SSH agent is queried to determine which
	// identity to use.
	SSHKeyFile string

	// SSHKeyPassphrase is the passphrase used to encrypt the SSH private key,
	// if any.
	SSHKeyPassphrase string

	// PreferHTTP indicates that Grit should prefer the HTTP transport. By
	// default SSH is preferred.
	PreferHTTP bool
}

Config is the configuration that controls how Grit uses the Git VCS.

func (Config) DescribeVCSConfig

func (c Config) DescribeVCSConfig() string

DescribeVCSConfig returns a human-readable description of the configuration.

Jump to

Keyboard shortcuts

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