Documentation ¶
Overview ¶
github is a Go library for accessing the Github API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present.
Types ¶
type Client ¶
type Client struct { // Services used for handling the Github API. Repositories *RepositoriesService // contains filtered or unexported fields }
A Client manages communication with the Github API.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.
func (*Client) GetBaseURL ¶
GetBaseURL returns a copy of the baseURL.
func (*Client) NewRequest ¶
NewRequest creates an API request using a relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type RepositoriesService ¶
type RepositoriesService struct {
// contains filtered or unexported fields
}
Github API docs: https://docs.gitlab.com/ce/api/repositories.html
func (*RepositoriesService) List ¶
func (s *RepositoriesService) List(ctx context.Context, user string) ([]*Repository, *http.Response, error)
List the repositories for a user.
GitHub API docs: https://developer.github.com/v3/repos/#list-user-repositories