Documentation
¶
Index ¶
- type Client
- func (c Client) Get(ctx context.Context, req *GetReq, opt ...requests.Option) (*GetResponse, error)
- func (c Client) GetAllCommonlyUsed(ctx context.Context, req *GetAllCommonlyUsedReq, opt ...requests.Option) (*GetAllCommonlyUsedResponse, error)
- func (c Client) GetForRepo(ctx context.Context, req *GetForRepoReq, opt ...requests.Option) (*GetForRepoResponse, error)
- type GetAllCommonlyUsedReq
- type GetAllCommonlyUsedResponse
- type GetForRepoReq
- type GetForRepoResponse
- type GetReq
- type GetResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a set of options to apply to requests
func (Client) Get ¶
Get performs requests for "licenses/get"
Get a license.
GET /licenses/{license}
https://developer.github.com/v3/licenses/#get-a-license
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) GetAllCommonlyUsed ¶
func (c Client) GetAllCommonlyUsed(ctx context.Context, req *GetAllCommonlyUsedReq, opt ...requests.Option) (*GetAllCommonlyUsedResponse, error)
GetAllCommonlyUsed performs requests for "licenses/get-all-commonly-used"
Get all commonly used licenses.
GET /licenses
https://developer.github.com/v3/licenses/#get-all-commonly-used-licenses
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) GetForRepo ¶
func (c Client) GetForRepo(ctx context.Context, req *GetForRepoReq, opt ...requests.Option) (*GetForRepoResponse, error)
GetForRepo performs requests for "licenses/get-for-repo"
Get the license for a repository.
GET /repos/{owner}/{repo}/license
https://developer.github.com/v3/licenses/#get-the-license-for-a-repository
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
type GetAllCommonlyUsedReq ¶
type GetAllCommonlyUsedReq struct { Featured *bool // Results per page (max 100) PerPage *int64 // contains filtered or unexported fields }
GetAllCommonlyUsedReq is request data for Client.GetAllCommonlyUsed
https://developer.github.com/v3/licenses/#get-all-commonly-used-licenses
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*GetAllCommonlyUsedReq) HTTPRequest ¶
func (r *GetAllCommonlyUsedReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
func (*GetAllCommonlyUsedReq) Rel ¶
func (r *GetAllCommonlyUsedReq) Rel(link string, resp *GetAllCommonlyUsedResponse) bool
Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.
type GetAllCommonlyUsedResponse ¶
type GetAllCommonlyUsedResponse struct { Data []components.LicenseSimple // contains filtered or unexported fields }
GetAllCommonlyUsedResponse is a response for GetAllCommonlyUsed
https://developer.github.com/v3/licenses/#get-all-commonly-used-licenses
func GetAllCommonlyUsed ¶
func GetAllCommonlyUsed(ctx context.Context, req *GetAllCommonlyUsedReq, opt ...requests.Option) (*GetAllCommonlyUsedResponse, error)
GetAllCommonlyUsed performs requests for "licenses/get-all-commonly-used"
Get all commonly used licenses.
GET /licenses
https://developer.github.com/v3/licenses/#get-all-commonly-used-licenses
func (*GetAllCommonlyUsedResponse) HTTPResponse ¶
func (r *GetAllCommonlyUsedResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*GetAllCommonlyUsedResponse) ReadResponse ¶
func (r *GetAllCommonlyUsedResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type GetForRepoReq ¶
GetForRepoReq is request data for Client.GetForRepo
https://developer.github.com/v3/licenses/#get-the-license-for-a-repository
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*GetForRepoReq) HTTPRequest ¶
func (r *GetForRepoReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
func (*GetForRepoReq) Rel ¶
func (r *GetForRepoReq) Rel(link string, resp *GetForRepoResponse) bool
Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.
type GetForRepoResponse ¶
type GetForRepoResponse struct { Data components.LicenseContent // contains filtered or unexported fields }
GetForRepoResponse is a response for GetForRepo
https://developer.github.com/v3/licenses/#get-the-license-for-a-repository
func GetForRepo ¶
func GetForRepo(ctx context.Context, req *GetForRepoReq, opt ...requests.Option) (*GetForRepoResponse, error)
GetForRepo performs requests for "licenses/get-for-repo"
Get the license for a repository.
GET /repos/{owner}/{repo}/license
https://developer.github.com/v3/licenses/#get-the-license-for-a-repository
func (*GetForRepoResponse) HTTPResponse ¶
func (r *GetForRepoResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*GetForRepoResponse) ReadResponse ¶
func (r *GetForRepoResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type GetReq ¶
type GetReq struct { // license parameter License string // contains filtered or unexported fields }
GetReq is request data for Client.Get
https://developer.github.com/v3/licenses/#get-a-license
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*GetReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type GetResponse ¶
type GetResponse struct { Data components.License // contains filtered or unexported fields }
GetResponse is a response for Get
https://developer.github.com/v3/licenses/#get-a-license
func (*GetResponse) HTTPResponse ¶
func (r *GetResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*GetResponse) ReadResponse ¶
func (r *GetResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.