Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrScope = "github" ErrCodeParameter = 10 ErrCodeClientOption = 11 ErrCodeMakeRequest = 20 ErrCodeNetwork = 30 ErrCodeAccessToken = 40 )
View Source
const ( HTMLHost = "https://github.com/" HTMLPathPre = "blob/master" APIHost = "https://api.github.com/" APIPathPre = "graphql" )
View Source
const QueryRepo = `` /* 256-byte string literal not displayed */
View Source
const QueryUser = `{ "query": "query { viewer { login } rateLimit { limit, remaining, resetAt }}"`
Variables ¶
This section is empty.
Functions ¶
func IsAbuseError ¶
func SetDefaultLogger ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(htmlClient HTTPClient, apiClient HTTPClient, option ClientOption) (*Client, error)
func (Client) GetHTMLReadme ¶
Get README.md wrapped in html page.
type ClientOption ¶
type ClientOption struct { HTMLHost string // GitHub HTML host HTMLPathPre string // GitHub HTML path prefix APIHost string // GitHub API host ApiPathPre string // GitHub API path prefix AccessToken string // GitHub personal access token }
func NewDefaultClientOption ¶
func NewDefaultClientOption() ClientOption
type HTTPClient ¶
type Repo ¶
type Repo struct { Data struct { Repository struct { Forks struct { TotalCount int } Stargazers struct { TotalCount int } Watchers struct { TotalCount int } DefaultBranchRef struct { Target struct { History struct { Edges []struct { Node struct { CommittedDate time.Time } } } } } Description string } } Errors []struct { Message string } }
Click to show internal directories.
Click to hide internal directories.