repoSource

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromSource

func ExtractFromSource(source RepoSource, config ExtractConfig) error

Types

type ArtifactUploader

type ArtifactUploader interface {
	UploadRepos(repos []*entities.Repository)
}

ArtifactUploader uploads and merge results with codersrank

func NewArtifactUploader

func NewArtifactUploader(outputPath string) ArtifactUploader

NewArtifactUploader constructor

type BitbucketProvider

type BitbucketProvider struct {
	Scheme        string
	BaseURL       string
	Path          string
	Username      string
	Password      string
	Visibility    string
	GitExecutable string
	// contains filtered or unexported fields
}

BitbucketProvider Bitbucket provider used for handling Bitbucket API operations

func (*BitbucketProvider) CleanUp

func (p *BitbucketProvider) CleanUp()

func (*BitbucketProvider) Clone

func (p *BitbucketProvider) Clone(repo *entities.Repository) (string, error)

func (*BitbucketProvider) GetRepos

func (p *BitbucketProvider) GetRepos() []*entities.Repository

GetRepos returns list of repositories with given token and visibility from provider

type CRUploadResult

type CRUploadResult struct {
	Token string `json:"token"`
}

CRUploadResult is the result of single repo upload

type CRUploadResultWithRepoName

type CRUploadResultWithRepoName struct {
	Token    string `json:"token"`
	Reponame string `json:"reponame"`
}

CRUploadResultWithRepoName token-reponame pair

type ExtractConfig

type ExtractConfig struct {
	OutputPath      string
	GitPath         string
	Headless        bool
	Obfuscate       bool
	UserEmails      []string
	Seeds           []string
	ShowProgressBar bool // Show progress bar only if running in interactive mode
	SkipLibraries   bool
	SkipUpload      bool // If this is true the artifacts won't be uploaded
}

type MultiUpload

type MultiUpload struct {
	Results []CRUploadResultWithRepoName `json:"results"`
}

MultiUpload is the request body

type RepoSource

type RepoSource interface {
	// GetRepos provides the list of the repositories from the given provider
	GetRepos() []*entities.Repository
	// Clone clones the given repository to the given directory
	// returns with the cloned path and an error if any.
	Clone(repository *entities.Repository) (string, error)
	// CleanUp revert to the state before extraction.
	// E.g. remove temporary files, directories.
	CleanUp()
}

RepoSource describes the interface that each provider has to implement

func NewBitbucketProvider

func NewBitbucketProvider(username, password, repoVisibility, gitPath string) RepoSource

NewBitbucketProvider constructor

func NewDirectoryPath

func NewDirectoryPath(path, name string) RepoSource

NewDirectoryPath create a new RepoSource instance. path is the directory path to the repository.

Jump to

Keyboard shortcuts

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