githubmetrics

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchOrgCount

func FetchOrgCount(ctx context.Context, client *github.Client, owner, repo string, Token string) (int, error)

func Run

func Run(ctx context.Context, db *sql.DB, owner string, repo string, config Config, opts UpdateOptions) error

Types

type Config

type Config struct {
	Database    string `json:"database"`
	User        string `json:"user"`
	Password    string `json:"password"`
	Host        string `json:"host"`
	Port        string `json:"port"`
	GitHubToken string `json:"githubToken"`
}

type GitHubStats

type GitHubStats struct {
	StarCount        *int
	ForkCount        *int
	CreatedSince     *time.Time
	UpdatedSince     *time.Time
	ContributorCount *int
	CommitFrequency  *int
	OrgCount         *int
}

type UpdateOptions

type UpdateOptions struct {
	UpdateStarCount        bool
	UpdateForkCount        bool
	UpdateCreatedSince     bool
	UpdateUpdatedSince     bool
	UpdateContributorCount bool
	UpdateCommitFrequency  bool
	UpdateOrgCount         bool
	ForceUpdate            bool // 新增选项,决定是否强制更新
}

Jump to

Keyboard shortcuts

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