getgithub

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 12 Imported by: 0

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 added in v1.0.1

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 added in v1.0.1

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

func SaveBranch added in v1.0.1

func SaveBranch(branch RepoBranch) error

func SaveCommit added in v1.0.1

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

func SaveLast added in v1.0.1

func SaveLast(last Lastanalyse) error

func SaveRepos added in v1.0.1

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

func SaveResult added in v1.0.1

func SaveResult(result AnalysisResult) error

Types

type AnalysisResult added in v1.0.1

type AnalysisResult struct {
	NumRepositories int
	ProjectBranches []ProjectBranch
}

type Branch added in v1.0.1

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

func GithubAllBranches added in v1.0.1

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

type BranchInfoEvents added in v1.0.1

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

type CommitInfo added in v1.0.1

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

type ExclusionList added in v1.0.1

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

type ExclusionRepos added in v1.0.1

type ExclusionRepos map[string]bool

RepositoryMap represents a map of repositories to ignore

type LanguageInfo1 added in v1.0.1

type LanguageInfo1 struct {
	Language  string
	CodeLines int
}

type Lastanalyse added in v1.0.1

type Lastanalyse struct {
	LastRepos  string
	LastBranch string
}

type ParamsReposGithub added in v1.0.1

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
}

type ProjectBranch added in v1.0.1

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

func GetRepoGithubList

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

func GetReposGithub added in v1.0.1

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

type RepoBranch added in v1.0.1

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 TreeItem added in v1.0.1

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 added in v1.0.1

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