configuration

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubProvider    = "github"
	GitLabProvider    = "gitlab"
	BitbucketProvider = "bitbucket"
	CustomProvider    = "custom"
)

Variables

This section is empty.

Functions

func GenerateSSHCommand added in v1.0.3

func GenerateSSHCommand(sshKeyPath string, sshStrict bool, sshKnownHostsPath string) (string, error)

func GenerateSSHKey added in v1.0.3

func GenerateSSHKey(ctx context.Context, tempDir string, inputKey string) (string, error)

func GenerateSSHKnownHosts added in v1.0.3

func GenerateSSHKnownHosts(home string, tempDir string, inputKnownHosts string) (_ string, retErr error)

Types

type Config

type Config struct {
	// Provider SCM provider that is hosting the repositories
	Provider string
	// Repositories whitespace and/or comma separated list of repository names with owner
	Repositories string
	// CloudBees API token used to fetch authentication
	CloudBeesApiToken string `mapstructure:"cloudbees-api-token"`
	// CloudBees API root URL to fetch authentication from
	CloudBeesApiURL string `mapstructure:"cloudbees-api-url"`
	// Personal access token (PAT) used to fetch the repositories
	Token string
	// SshKey SSH key used to fetch the repositories
	SshKey string `mapstructure:"ssh-key"`
	// SshKnownHosts Known hosts in addition to the user and global host key database
	SshKnownHosts string `mapstructure:"ssh-known-hosts"`
	// SshStrict Whether to perform strict host key checking
	SshStrict bool `mapstructure:"ssh-strict"`
	// GitHubServerURL the base URL for the GitHub instance that you are trying to clone from
	GitHubServerURL string `mapstructure:"github-server-url"`
	// BitbucketServerURL the base URL for the Bitbucket instance that you are trying to clone from
	BitbucketServerURL string `mapstructure:"bitbucket-server-url"`
	// GitLabServerURL the base URL for the GitLab instance that you are trying to clone from
	GitLabServerURL string `mapstructure:"gitlab-server-url"`
}

Config holds the configuration of the authentication to be applied

func (*Config) Apply

func (c *Config) Apply(ctx context.Context) error

Apply applies the configuration to the Git Global config

Jump to

Keyboard shortcuts

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