thk

package
v0.0.0-...-e769972 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalRepoScore

func CalRepoScore(gitRepo *model.GitRepo, contributors []*model.GitContributor) float64

func InitTest

func InitTest() error

func LoadDataFromUrl

func LoadDataFromUrl(url string) ([]byte, error)

func ThkRepo

func ThkRepo(repo string) (float64, []*model.GitContributor, error)

Types

type Contributor

type Contributor struct {
	Login         string  `json:"login"`
	Id            int     `json:"id"`
	Type          string  `json:"type"`
	Contributions int     `json:"contributions"`
	Score         float64 `json:"score,omitempty"`
}

type GithubThk

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

func NewGithubThk

func NewGithubThk(repo string) *GithubThk

func (*GithubThk) GetContributors

func (g *GithubThk) GetContributors() []*model.GitContributor

func (*GithubThk) GetRepoInfo

func (g *GithubThk) GetRepoInfo() *model.GitRepo

func (*GithubThk) RepoScore

func (g *GithubThk) RepoScore() float64

func (*GithubThk) Run

func (g *GithubThk) Run() error

type RepoInfo

type RepoInfo struct {
	StargazersCount int `json:"stargazers_count"`
	ForksCount      int `json:"forks_count"`
}

type ThankTask

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

func NewThankTask

func NewThankTask(lang string, minScore float64, data []byte) (*ThankTask, error)

func NewThankTaskFromId

func NewThankTaskFromId(id string) (*ThankTask, error)

func (*ThankTask) Run

func (tt *ThankTask) Run() ([]*ThkContributor, error)

func (*ThankTask) Task

func (tt *ThankTask) Task() *model.Task

type ThkContributor

type ThkContributor struct {
	Login string               `json:"login"`
	Id    int                  `json:"id"`
	Total float64              `json:"total"`
	Repos []ThkContributorRepo `json:"repos"`
}

func Thanks

func Thanks(repos []string, maxConcurrency uint) ([]*ThkContributor, error)

func ThanksReadOnly

func ThanksReadOnly(repos []string) ([]*ThkContributor, error)

type ThkContributorRepo

type ThkContributorRepo struct {
	Repo  string  `json:"repo"`
	Score float64 `json:"score"` // current repo's score
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳