git

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REPOSITORY_CACHE_SIZE = 4
	REPOSITORY_CACHE_TTL  = 5 * time.Minute
)

Functions

func NewAzureClient

func NewAzureClient() *azureClient

func NewGitClient

func NewGitClient(preserveGitDir bool) *gitClient

Types

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) 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) (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, hardRefresh bool, includedExts []string) ([]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) ([]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