Documentation
¶
Index ¶
Constants ¶
View Source
const ( // IssueCommentEvent is the type returned when the user comments on an issue. IssueCommentEvent = "IssueCommentEvent" // PushEvent is the type when a user pushes code. PushEvent = "PushEvent" // WatchEvent is the type of event when a user watches a repo. WatchEvent = "WatchEvent" )
Variables ¶
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
SHA string `json:"sha"`
Payload struct {
Message string `json:"message"`
Author struct {
Name string `json:"name"`
Email string `json:"email"`
Date string `json:"date"`
} `json:"author"`
Committer struct {
Name string `json:"name"`
Email string `json:"email"`
Date string `json:"date"`
} `json:"committer"`
} `json:"commit"`
Author User `json:"author"`
Committer User `json:"committer"`
Parents []struct {
SHA string `json:"sha"`
} `json:"parents"`
CreatedAt string `json:"created_at"`
}
Commit is a code change within a repository.
type Event ¶
type Event struct {
ID string `json:"id"`
Type string `json:"type"`
Repo struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
}
Payload struct {
Action string `json:"action"`
Commits []struct {
URL string `json:"url"`
Author struct {
Email string `json:"email"`
Name string `json:"name"`
} `json:"author"`
Message string `json:"message"`
} `json:"commits"`
Issue struct {
Title string `json:"title"`
URL string `json:"url"`
Body string `json:"body"`
} `json:"issue"`
} `json:"payload"`
CreatedAt string `json:"created_at"`
}
Event is an entry for recent user activity.
func Events ¶
Events returns the most recent events for a user.
type Profile ¶
type Profile struct {
User User `json:"user"`
Repositories Repositories `json:"repositories"`
Emails []string `json:"emails"`
}
Profile is a snapshot of a user.
type Repositories ¶
type Repositories []Repository
Repositories is a slice of repositories.
func (*Repositories) Fetch ¶
func (rs *Repositories) Fetch(login string) error
Fetch will load repositories from github.com.
type Repository ¶
type Repository struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Homepage string `json:"homepage"`
Language string `json:"language"`
StargazersCount int `json:"stargazers_count"`
WatchersCount int `json:"watchers_count"`
Forks int `json:"forks"`
Fork bool `json:"fork"`
Owner User `json:"owner"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Repository is a collection of code.
func (Repository) Commits ¶
func (r Repository) Commits() ([]Commit, error)
Commits will fetch a number of commits from the repository. Will fetch the latest 100 commits.
func (Repository) Created ¶
func (r Repository) Created() (time.Time, error)
Created returns a time.Time for created_at.
func (Repository) Updated ¶
func (r Repository) Updated() (time.Time, error)
Updated returns a time.Time for updated_at.
type User ¶
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Login string `json:"login"`
Bio string `json:"bio"`
Location string `json:"location"`
AvatarURL string `json:"avatar_url"`
GravatarURL string `json:"gravatar_url"`
Type string `json:"type"`
Company string `json:"company"`
Blog string `json:"blog"`
Hireable bool `json:"hireable"`
TwitterUsername string `json:"twitter_username"`
PublicRepos int `json:"public_repos"`
PublicGists int `json:"public_gists"`
Followers int `json:"followers"`
Following int `json:"following"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
User is a Github user.
func (*User) Created ¶
Created returns a time.Time for created_at.
func (*User) Repositories ¶
func (u *User) Repositories() (rs Repositories, err error)
Repositories will fetch all repositories for a user.
Source Files
¶
- auth.go
- commit.go
- events.go
- profile.go
- repository.go
- user.go
Click to show internal directories.
Click to hide internal directories.