Documentation
¶
Index ¶
- Variables
- func GetCommitsInRange(outputDirectory, from, to string, concurrent bool)
- func GetISO8601Timestamps(from, to string) []string
- func GetLast100Gists() string
- func MakePatchURL(apiURL string) string
- func PrintGharchiveChunkUrls(from, to string) []string
- type Actor
- type Author
- type Commit
- type CommitInfo
- type Event
- type EventInfo
- type File
- type Files
- type Gist
- type GistData
- type Owner
- type Payload
- type PushEvent
- type Repo
- type User
Constants ¶
This section is empty.
Variables ¶
var GithubCacheDir = ".githubCommits/"
Functions ¶
func GetCommitsInRange ¶
Function to read and parse the JSON file
Inputs:
outputDirectory (string): the directory to save files to. "githubCommits/" will be made locally if not specified
From (string): from timestamp as string in the format "2006-01-02-15"
To (string): from timestamp as string in the format "2006-01-02-15"
Concurrent (bool): download all the patch files at the same time. Note: this ramps up network, disk and CPU usage. Limit this to short timeframes.
Note: if no timestamp is specified, the previous hour's JSON file will be downloaded.
Output: A JSON file downloaded to the directory as specified
func GetISO8601Timestamps ¶
func GetLast100Gists ¶ added in v0.1.1
func GetLast100Gists() string
func MakePatchURL ¶
func PrintGharchiveChunkUrls ¶
Types ¶
type CommitInfo ¶ added in v0.1.6
type Event ¶
type Event struct {
Domains []string `json:"domains"`
Actor Actor `json:"actor"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Payload Payload `json:"payload"`
Public bool `json:"public"`
Repo Repo `json:"repo"`
Type string `json:"type"`
}
func ParseGitHubCommits ¶ added in v0.1.1
Function to read and parse the JSON file
Input:
filenames ([]string): A list of filenames containing gharchive files. You can use filepath.Walk() here
Output ([]Event): A parsed slice containing all push events
type EventInfo ¶ added in v0.1.6
type EventInfo struct {
Type string `json:"type"`
Payload PushEvent `json:"payload"`
Actor struct {
Login string `json:"login"` // Username of the person who triggered the event
} `json:"actor"`
}
Event represents a GitHub event, which could be any type of event
func GetLast100Commits ¶ added in v0.1.6
type Files ¶ added in v0.1.1
type Files struct {
JandedobbeleerPyOMPJSON File `json:"jandedobbeleer_py.omp.json"`
}
type Gist ¶ added in v0.1.1
type Gist struct {
Comments int `json:"comments"`
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
Files map[string]interface{} `json:"files"` // Map for files, since it's an empty object here
GitPullURL string `json:"git_pull_url"`
GitPushURL string `json:"git_push_url"`
HtmlURL string `json:"html_url"`
ID string `json:"id"`
Public bool `json:"public"`
UpdatedAt time.Time `json:"updated_at"`
URL string `json:"url"`
User User `json:"user"`
}
type GistData ¶ added in v0.1.1
type GistData struct {
URL string `json:"url"`
ForksURL string `json:"forks_url"`
CommitsURL string `json:"commits_url"`
ID string `json:"id"`
NodeID string `json:"node_id"`
GitPullURL string `json:"git_pull_url"`
GitPushURL string `json:"git_push_url"`
HTMLURL string `json:"html_url"`
Files Files `json:"files"`
Public bool `json:"public"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Description string `json:"description"`
Comments int `json:"comments"`
User *string `json:"user"`
Owner Owner `json:"owner"`
Truncated bool `json:"truncated"`
RawURL string `json:"raw_url"`
}
func ParseGistData ¶ added in v0.1.1
type Owner ¶ added in v0.1.1
type Owner struct {
Login string `json:"login"`
ID int `json:"id"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
UserViewType string `json:"user_view_type"`
SiteAdmin bool `json:"site_admin"`
}
type PushEvent ¶ added in v0.1.6
type PushEvent struct {
Commits []CommitInfo `json:"commits"`
}
PushEvent represents a push event in GitHub