model

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGitContributor

func CreateGitContributor(gitContributor *GitContributor) error

func CreateGitContributors

func CreateGitContributors(gitContributors []*GitContributor) error

func CreateGitRepo

func CreateGitRepo(gitRepo *GitRepo) error

func CreateNodeRepo

func CreateNodeRepo(nodeRepo *NodeRepo) error

func SaveTask

func SaveTask(task *Task) error

Types

type GitContributor

type GitContributor struct {
	Id            uint64  `json:"id" db:"id" gorm:"primary_key;autoIncrement"`
	RepoId        uint64  `json:"repo_id" db:"repo_id" gorm:"index"`
	Login         string  `json:"login" db:"login"`
	GitId         int     `json:"git_id" db:"git_id"`
	Contributions int     `json:"contributions" db:"contributions"`
	Score         float64 `json:"score" db:"score"` // contributons / total_contributions
}

func GetAllGitContributors

func GetAllGitContributors(repoIdList []uint64) ([]*GitContributor, error)

func GetGitContributorsByRepoId

func GetGitContributorsByRepoId(repoId uint64) ([]*GitContributor, error)

func (*GitContributor) TableName

func (g *GitContributor) TableName() string

type GitRepo

type GitRepo struct {
	Id               uint64    `json:"id" db:"id" gorm:"primary_key;autoIncrement"`
	Repo             string    `json:"repo" db:"repo" gorm:"uniqueIndex"`
	StarCount        int       `json:"star_count" db:"star_count"`
	ForkCount        int       `json:"fork_count" db:"fork_count"`
	ContributorCount int       `json:"contributor_count" db:"contributor_count"`
	UpdatedAt        time.Time `json:"update_at" db:"update_at"`
}

func GetAllRepos

func GetAllRepos(repos []string) ([]*GitRepo, error)

func GetGitRepoByRepoName

func GetGitRepoByRepoName(repo string) (*GitRepo, error)

func (*GitRepo) TableName

func (g *GitRepo) TableName() string

type NodeRepo

type NodeRepo struct {
	Id   uint64 `json:"id" db:"id" gorm:"primary_key;autoIncrement"`
	Pkg  string `json:"pkg" db:"pkg" gorm:"uniqueIndex"`
	Repo string `json:"repo" db:"repo"`
}

func GetNodeRepoByPkg

func GetNodeRepoByPkg(pkg string) (*NodeRepo, error)

func (*NodeRepo) TableName

func (n *NodeRepo) TableName() string

type Task

type Task struct {
	Id        string    `json:"id" db:"id" gorm:"primary_key;type:char(22)"`
	Lang      string    `json:"lang" db:"lang"`
	MinScore  float64   `json:"min_score" db:"min_score"`
	Repos     string    `json:"repos" db:"repos"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

func CreateTask

func CreateTask(lang string, minScore float64) (*Task, error)

func GetTaskById

func GetTaskById(id string) (*Task, error)

func (*Task) TableName

func (t *Task) TableName() string

Jump to

Keyboard shortcuts

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