getgithub

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ApiHeader1 = "application/vnd.github.v3+json"
View Source
const ErrorMesssage1 = "❌ Error saving repositories in file Results/config/analysis_repos_github.json: %v\n"
View Source
const MessageApiRate = "❗️ Rate limit exceeded. Waiting for rate limit reset..."
View Source
const PrefixMsg = "Get Repo(s)..."

Variables

This section is empty.

Functions

func FastAnalys

func FastAnalys(platformConfig map[string]interface{}, exlusionfile string) error

func FastAnalys(url, baseapi, apiver, accessToken, organization, exlusionfile, repos, branchmain string, period int) error {

func GetGithubLanguages

func GetGithubLanguages(parms ParamsReposGithub, ctx context.Context, client *github.Client, factor int) (int, int, int, int, error)

func SaveBranch

func SaveBranch(branch RepoBranch) error

func SaveCommit

func SaveCommit(repos []*github.RepositoryCommit) error

func SaveLast

func SaveLast(last Lastanalyse) error

func SaveRepos

func SaveRepos(repos []*github.Repository) error

func SaveResult

func SaveResult(result AnalysisResult) error

Types

type AnalysisResult

type AnalysisResult struct {
	NumRepositories int
	ProjectBranches []ProjectBranch
}

type Branch

type Branch struct {
	Name      string     `json:"name"`
	Commit    CommitInfo `json:"commit"`
	Protected bool       `json:"protected"`
}

func GithubAllBranches

func GithubAllBranches(url, AccessToken, apiver string) ([]Branch, error)

type BranchInfoEvents

type BranchInfoEvents struct {
	Name      string
	Pushes    int
	Commits   int
	Additions int
	Deletions int
}

type CommitInfo

type CommitInfo struct {
	Sha string `json:"sha"`
	URL string `json:"url"`
}

type ExclusionList

type ExclusionList struct {
	Repos map[string]bool `json:"repos"`
}

type ExclusionRepos

type ExclusionRepos map[string]bool

RepositoryMap represents a map of repositories to ignore

type LanguageInfo1

type LanguageInfo1 struct {
	Language  string
	CodeLines int
}

type Lastanalyse

type Lastanalyse struct {
	LastRepos  string
	LastBranch string
}

type ParamsReposGithub

type ParamsReposGithub struct {
	Repos         []*github.Repository
	URL           string
	BaseAPI       string
	Apiver        string
	AccessToken   string
	Organization  string
	NBRepos       int
	ExclusionList ExclusionRepos
	Spin          *spinner.Spinner
	Branch        string
	Period        int
	Stats         bool
	DefaultB      bool
}

type PlatformConfig

type PlatformConfig struct {
	Organization string
	URL          string
}

type ProjectBranch

type ProjectBranch struct {
	Org         string
	RepoSlug    string
	MainBranch  string
	LargestSize int64
}

func GetRepoGithubList

func GetRepoGithubList(platformConfig map[string]interface{}, exclusionfile string, fast bool) ([]ProjectBranch, error)

func GetReposGithub

func GetReposGithub(parms ParamsReposGithub, ctx context.Context, client *github.Client) ([]ProjectBranch, int, int, int, int, int)

type RepoBranch

type RepoBranch struct {
	ID       int64            `json:"id"`
	Name     string           `json:"name"`
	Branches []*github.Branch `json:"branches"`
}

type Repository

type Repository struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	Path          string `json:"full_name"`
	SizeR         int64  `json:"size"`
	Language      string `json:"language"`
	DefaultBranch string `json:"default_branch"`
	Archived      bool   `json:"archived"`
	LOC           map[string]int
}

type SummaryStats

type SummaryStats struct {
	LargestRepo       string
	LargestRepoBranch string
	NbRepos           int
	EmptyRepo         int
	TotalExclude      int
	TotalArchiv       int
	TotalBranches     int
}

type TreeItem

type TreeItem struct {
	Path string `json:"path"`
	Mode string `json:"mode"`
	Type string `json:"type"`
	Sha  string `json:"sha"`
	Size int    `json:"size,omitempty"`
}

type TreeResponse

type TreeResponse struct {
	Sha       string     `json:"sha"`
	Url       string     `json:"url"`
	Tree      []TreeItem `json:"tree"`
	Truncated bool       `json:"truncated"`
}

Jump to

Keyboard shortcuts

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