Help us shape the future of Go! Take the 2026 Go Developer Survey

contributors

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

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

	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
)
View Source
const (
	DefaultCacheValidity = 3 // days
)

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 BasicGitServerParams

type BasicGitServerParams struct {
	// SCM type.
	ScmType vcsutils.VcsProvider `yaml:"scm-type"`
	// SCM API URL. For example: 'https://api.github.com'.
	ScmApiUrl string `yaml:"scm-api-url"`
	// SCM API token.
	Token string `yaml:"token"`
	// The format of the owner key depends on the Git provider:
	// - On GitHub and GitLab, the owner is typically an individual or an organization.
	// - On Bitbucket, the owner can also be a project. In the case of a private instance,
	//   the individual or organization name should be prefixed with '~'.
	Owner string `yaml:"owner"`
	// List of specific repositories names to analyze, If not provided all repositories in the project will be analyzed.
	Repositories []string `yaml:"repositories,omitempty"`
	// contains filtered or unexported fields
}

BasicGitServerParams basic parameters needed for calling git providers APIs.

func (*BasicGitServerParams) UnmarshalYAML added in v1.26.2

func (p *BasicGitServerParams) UnmarshalYAML(node *yaml.Node) error

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
	// Progress bar.
	Progress ioUtils.ProgressMgr
}

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) 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.

func (*CountContributorsCommand) SetProgress

func (cc *CountContributorsCommand) SetProgress(progress ioUtils.ProgressMgr)

type CountContributorsParams

type CountContributorsParams struct {
	BasicGitServerParams
	// Path to a file contains multiple git providers to analyze.
	InputFile string
	// Number of months to analyze.
	MonthsNum int
	// Detailed summery flag.
	DetailedSummery bool
	// Number of parallel threads to use when scanning repositories.
	Threads int
	// Number of days a cached repository result remains valid. 0 = skip cache.
	CacheValidity int
	// Progress bar.
	Progress ioUtils.ProgressMgr
}

type GitServersList

type GitServersList struct {
	ServersList []BasicGitServerParams `yaml:"git-servers-list"`
}

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

type VcsCountContributors

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

VcsCountContributors combine all the count contributors functionality for one specific VCS.

func (*VcsCountContributors) GetCommitsWithQueryOptions

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

Jump to

Keyboard shortcuts

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