git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	SetupAuth(args *shared.VCSFetchRequest, config map[string]string, logger hclog.Logger) (transport.AuthMethod, error)
	ValidateConfig(config map[string]string) error
}

Authenticator defines an interface for different authentication methods.

type Client

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

GitClient represents a Git client with configuration and authentication.

func New

func New(logger hclog.Logger, globalConfig *config.Config, pluginConfig interface{}, args *shared.VCSFetchRequest) (*Client, error)

New initializes a new Git Client with the given parameters.

func (*Client) CloneRepository

func (c *Client) CloneRepository(args *shared.VCSFetchRequest, defaultBranch string) (string, error)

type HTTPAuthenticator

type HTTPAuthenticator struct{}

HTTPAuthenticator provides HTTP basic authentication.

func (*HTTPAuthenticator) SetupAuth

func (h *HTTPAuthenticator) SetupAuth(args *shared.VCSFetchRequest, config map[string]string, logger hclog.Logger) (transport.AuthMethod, error)

SetupAuth configures HTTP basic authentication.

func (*HTTPAuthenticator) ValidateConfig

func (h *HTTPAuthenticator) ValidateConfig(config map[string]string) error

ValidateConfig validates the configuration for HTTPAuthenticator.

type RefType

type RefType struct {
	Branch   plumbing.ReferenceName
	Hash     plumbing.Hash
	IsCommit bool
}

type RepositoryMetadata

type RepositoryMetadata struct {
	BranchName         *string
	CommitHash         *string
	RepositoryFullName *string
	Subfolder          string
	RepoRootFolder     string
}

struct with repository metadata

func CollectRepositoryMetadata

func CollectRepositoryMetadata(sourceFolder string) (*RepositoryMetadata, error)

CollectRepositoryMetadata function collects repository metadata that includes branch name, commit hash, repository full name, subfolder and repository root folder

type SSHAgentAuthenticator

type SSHAgentAuthenticator struct{}

SSHAgentAuthenticator provides SSH agent-based authentication.

func (*SSHAgentAuthenticator) SetupAuth

func (s *SSHAgentAuthenticator) SetupAuth(args *shared.VCSFetchRequest, config map[string]string, logger hclog.Logger) (transport.AuthMethod, error)

SetupAuth configures SSH agent authentication.

func (*SSHAgentAuthenticator) ValidateConfig

func (s *SSHAgentAuthenticator) ValidateConfig(config map[string]string) error

ValidateConfig validates the configuration for SSHAgentAuthenticator.

type SSHKeyAuthenticator

type SSHKeyAuthenticator struct{}

SSHKeyAuthenticator provides SSH key-based authentication.

func (*SSHKeyAuthenticator) SetupAuth

func (s *SSHKeyAuthenticator) SetupAuth(args *shared.VCSFetchRequest, config map[string]string, logger hclog.Logger) (transport.AuthMethod, error)

SetupAuth configures SSH key authentication.

func (*SSHKeyAuthenticator) ValidateConfig

func (s *SSHKeyAuthenticator) ValidateConfig(config map[string]string) error

ValidateConfig validates the configuration for SSHKeyAuthenticator.

Jump to

Keyboard shortcuts

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