git

package
v0.0.0-...-4560a53 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidGitCredential = errors.New("Invalid git credential")
)

Functions

func CloneWithBackup

func CloneWithBackup(gitService portainer.GitService, fileService portainer.FileService, options CloneOptions) (clean func(), err error)

func GetCredentials

func GetCredentials(auth *gittypes.GitAuthentication) (string, string, error)

func NewAzureClient

func NewAzureClient() *azureClient

func NewGitClient

func NewGitClient(preserveGitDir bool) *gitClient

func ValidateRepoAuthentication

func ValidateRepoAuthentication(auth *gittypes.GitAuthentication) error

func ValidateRepoConfig

func ValidateRepoConfig(repoConfig *gittypes.RepoConfig) error

Types

type CloneOptions

type CloneOptions struct {
	ProjectPath   string
	URL           string
	ReferenceName string
	Username      string
	Password      string
	// TLSSkipVerify skips SSL verification when cloning the Git repository
	TLSSkipVerify bool `example:"false"`
}

type Service

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

Service represents a service for managing Git.

func NewService

func NewService(ctx context.Context) *Service

NewService initializes a new service.

func (*Service) CloneRepository

func (service *Service) CloneRepository(destination, repositoryURL, referenceName, username, password string, tlsSkipVerify bool) error

CloneRepository clones a git repository using the specified URL in the specified destination folder.

func (*Service) LatestCommitID

func (service *Service) LatestCommitID(repositoryURL, referenceName, username, password string, tlsSkipVerify bool) (string, error)

LatestCommitID returns SHA1 of the latest commit of the specified reference

func (*Service) ListFiles

func (service *Service) ListFiles(repositoryURL, referenceName, username, password string, dirOnly, hardRefresh bool, includedExts []string, tlsSkipVerify bool) ([]string, error)

ListFiles will list all the files of the target repository with specific extensions. If extension is not provided, it will list all the files under the target repository

func (*Service) ListRefs

func (service *Service) ListRefs(repositoryURL, username, password string, hardRefresh bool, tlsSkipVerify bool) ([]string, error)

ListRefs will list target repository's references without cloning the repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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