githubservice

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAllCommits

func FetchAllCommits(nameUser, nameRepository string, numPerPage int, apiKey string) (githubCommits []models.GithubCommit, err error)

FetchAllCommits returns all commits in repository @nameRepository of user @nameUser. @numPerPage is the number of commits fetched per request. For github this is limited to 100 atm.

func FetchCommitsByDate

func FetchCommitsByDate(nameUser, nameRepository, apiKey string, timeInit time.Time, timeFinal time.Time) (githubCommits []models.GithubCommit, err error)

FetchCommitsByDate returns all commits in repository @nameRepository of user @nameUser in the time range given by @timeInit and @timeFinal including both borders because the graphQL query does so.

Types

type Author

type Author struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type Data

type Data struct {
	Repository Repository `json:"repository"`
}

type GithubRepo

type GithubRepo struct {
	Data Data `json:"data"`
}

type History

type History struct {
	Nodes      []Node   `json:"nodes"`
	PageInfo   PageInfo `json:"pageInfo"`
	TotalCount int      `json:"totalCount"`
}

type Node

type Node struct {
	Hash            string `json:"oid"`
	Timestamp       string `json:"committedDate"`
	Author          Author `json:"author"`
	NumAdditions    int    `json:"additions"`
	NumDeletions    int    `json:"deletions"`
	NumChangedFiles int    `json:"changedFiles"`
	Message         string `json:"message"`
}

type Object

type Object struct {
	CommitURL string  `json:"commitUrl"`
	ID        string  `json:"id"`
	History   History `json:"history"`
}

type PageInfo

type PageInfo struct {
	EndCursor string `json:"endCursor"`
}

type Repository

type Repository struct {
	ID     string `json:"id"`
	Object Object `json:"object"`
}

Jump to

Keyboard shortcuts

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