git

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Github                        = scmTypeName("github")
	Gitlab                        = scmTypeName("gitlab")
	BitbucketServer               = scmTypeName("bitbucket")
	DefaultContContributorsMonths = 1

	GithubTokenEnvVar     = "JFROG_CLI_GITHUB_TOKEN"    // #nosec G101
	GitlabTokenEnvVar     = "JFROG_CLI_GITLAB_TOKEN"    // #nosec G101
	BitbucketTokenEnvVar  = "JFROG_CLI_BITBUCKET_TOKEN" // #nosec G101
	GenericGitTokenEnvVar = "JF_GIT_TOKEN"              // #nosec G101
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicContributor

type BasicContributor struct {
	Email string `json:"email"`
	Repo  string `json:"repo,omitempty"`
}

type Contributor

type Contributor struct {
	Email          string         `json:"email"`
	Name           string         `json:"name"`
	RepoLastCommit RepoLastCommit `json:"last_commit"`
}

type ContributorDetailedSummary

type ContributorDetailedSummary struct {
	RepoPath   string     `json:"repo_path"`
	LastCommit LastCommit `json:"last_commit"`
}

type CountContributorsCommand

type CountContributorsCommand struct {
	CountContributorsParams
	// contains filtered or unexported fields
}

func NewCountContributorsCommand

func NewCountContributorsCommand(params *CountContributorsParams) (*CountContributorsCommand, error)

func (*CountContributorsCommand) CommandName

func (cc *CountContributorsCommand) CommandName() string

The command name for the usage report.

func (*CountContributorsCommand) GetCommitsWithQueryOptions

func (cc *CountContributorsCommand) GetCommitsWithQueryOptions(repo string, options vcsclient.GitCommitsQueryOptions) ([]vcsclient.CommitInfo, error)

func (*CountContributorsCommand) Run

func (cc *CountContributorsCommand) Run() error

func (*CountContributorsCommand) ServerDetails

func (cc *CountContributorsCommand) ServerDetails() (*config.ServerDetails, error)

Returns the Server details. The usage report is sent to this server.

type CountContributorsParams

type CountContributorsParams struct {
	// SCM type.
	ScmType vcsutils.VcsProvider
	// SCM API URL. For example: 'https://api.github.com'.
	ScmApiUrl string
	// SCM API token.
	Token string
	// Depends on the git provider - on GitHub and GitLab the owner is usually an individual or an organization, on bitbucket it is a project.
	Owner string
	// Specific repository name to analyze, If not provided all repositories in the project will be analyzed.
	Repository string
	// Number of months to analyze.
	MonthsNum int
	// Detailed summery flag.
	DetailedSummery bool
	// Progress bar.
	Progress ioUtils.ProgressMgr
}

func (*CountContributorsParams) SetProgress

func (ccp *CountContributorsParams) SetProgress(progress ioUtils.ProgressMgr)

type LastCommit

type LastCommit struct {
	Date string `json:"date"`
	Hash string `json:"hash"`
}

type RepoLastCommit

type RepoLastCommit struct {
	Repo string `json:"repo,omitempty"`
	LastCommit
}

type Report

type Report struct {
	TotalUniqueContributors  int                                     `json:"total_unique_contributors"`
	TotalCommits             int                                     `json:"total_commits"`
	ScannedRepos             []string                                `json:"scanned_repos"`
	SkippedRepos             []string                                `json:"skipped_repos,omitempty"`
	ReportDate               string                                  `json:"report_date"`
	NumberOfMonths           string                                  `json:"number_of_months"`
	UniqueContributorsList   []Contributor                           `json:"unique_contributors_list"`
	DetailedContributorsList map[string][]ContributorDetailedSummary `json:"detailed_contributors_list,omitempty"`
	DetailedReposList        map[string][]RepositoryDetailedSummary  `json:"detailed_repos_list,omitempty"`
}

type RepositoryDetailedSummary

type RepositoryDetailedSummary struct {
	Email      string     `json:"email"`
	LastCommit LastCommit `json:"last_commit"`
}

type ScmType

type ScmType struct {
	ScmTypeMap map[string]vcsutils.VcsProvider
}

ScmType represents the valid values that can be provided to the 'scmTypeName' flag.

func NewScmType

func NewScmType() *ScmType

func (*ScmType) GetOptionalScmTypeTokenEnvVars

func (vs *ScmType) GetOptionalScmTypeTokenEnvVars() string

func (*ScmType) GetValidScmTypeString

func (vs *ScmType) GetValidScmTypeString() string

Jump to

Keyboard shortcuts

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