github

package
v0.0.0-...-31bbc9c Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommits

func CreateCommits(commits []Commit)

func FindRepoByName

func FindRepoByName(name string) (bool, error)

func GetCommitsByRepoName

func GetCommitsByRepoName(repo string) ([]map[string]interface{}, error)

func GetTopNCommitAuthors

func GetTopNCommitAuthors(repo string, topN int) ([]map[string]interface{}, error)

func SetEnvSetupData

func SetEnvSetupData()

Types

type Commit

type Commit struct {
	ID          int        `json:"id"`
	SHA         string     `json:"sha"`
	Repo        string     `json:"repo"` // corresponds to the repo full name
	RepoInfo    Repository `json:"repo_info"`
	AuthorName  string     `json:"author_name"`
	AuthorEmail string     `json:"author_email"`
	URL         string     `json:"url"`
	Message     string     `json:"message"`
	Date        time.Time  `json:"date"`
}

func (*Commit) FindLatestRepoCommitByDate

func (c *Commit) FindLatestRepoCommitByDate() (bool, error)

type Repository

type Repository struct {
	ID              int       `json:"id"`
	Name            string    `json:"name"` // repo full name
	Description     string    `json:"description"`
	URL             string    `json:"url"`
	Language        string    `json:"language"`
	ForksCount      float64   `json:"forks_count"`
	StarsCount      float64   `json:"stars_count"`
	OpenIssuesCount float64   `json:"open_issues_count"`
	WatchersCount   float64   `json:"watchers_count"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

func (*Repository) Create

func (r *Repository) Create() error

type SetupData

type SetupData struct {
	ID        int       `json:"id"`
	Repo      string    `json:"repo"`
	FromDate  time.Time `json:"from_date"`
	ToDate    time.Time `json:"to_date"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func GetAllSetUpData

func GetAllSetUpData() ([]SetupData, error)

func (*SetupData) CreateOrUpdate

func (s *SetupData) CreateOrUpdate() error

func (*SetupData) Validate

func (s *SetupData) Validate() error

Jump to

Keyboard shortcuts

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