Documentation
¶
Index ¶
- type Client
- func (c *Client) GetRepository(owner, repo string) (*Repository, error)
- func (c *Client) GetTrending(language string, since string, perPage int) (*SearchResult, error)
- func (c *Client) GetTrendingByStars(language string, since string, perPage int) (*SearchResult, error)
- func (c *Client) SearchRepositories(query string, sort string, order string, perPage int) (*SearchResult, error)
- type License
- type Owner
- type Repository
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
NewTestClient creates a client pointing to a custom base URL (for testing).
func (*Client) GetRepository ¶
func (c *Client) GetRepository(owner, repo string) (*Repository, error)
GetRepository fetches detailed information about a specific repository.
func (*Client) GetTrending ¶
GetTrending fetches trending repositories by looking at recently created repos with high star counts.
func (*Client) GetTrendingByStars ¶
func (c *Client) GetTrendingByStars(language string, since string, perPage int) (*SearchResult, error)
GetTrendingByStars fetches repos that gained the most stars recently.
func (*Client) SearchRepositories ¶
func (c *Client) SearchRepositories(query string, sort string, order string, perPage int) (*SearchResult, error)
SearchRepositories searches GitHub repositories with the given query and options.
type Repository ¶
type Repository struct {
FullName string `json:"full_name"`
Name string `json:"name"`
Owner Owner `json:"owner"`
Description string `json:"description"`
HTMLURL string `json:"html_url"`
Homepage string `json:"homepage"`
Language string `json:"language"`
StargazersCount int `json:"stargazers_count"`
ForksCount int `json:"forks_count"`
OpenIssuesCount int `json:"open_issues_count"`
WatchersCount int `json:"watchers_count"`
Topics []string `json:"topics"`
License *License `json:"license"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
PushedAt time.Time `json:"pushed_at"`
Archived bool `json:"archived"`
Fork bool `json:"fork"`
}
type SearchResult ¶
type SearchResult struct {
TotalCount int `json:"total_count"`
Items []Repository `json:"items"`
}
Click to show internal directories.
Click to hide internal directories.