licenses

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client []requests.Option

Client is a set of options to apply to requests

func NewClient

func NewClient(opt ...requests.Option) Client

NewClient returns a new Client

func (Client) Get

func (c Client) Get(ctx context.Context, req *GetReq, opt ...requests.Option) (*GetResponse, error)

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

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

type GetForRepoReq struct {
	Owner string
	Repo  string
	// contains filtered or unexported fields
}

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

func (r *GetReq) 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 (*GetReq) Rel

func (r *GetReq) Rel(link string, resp *GetResponse) 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 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 Get

func Get(ctx context.Context, req *GetReq, opt ...requests.Option) (*GetResponse, error)

Get performs requests for "licenses/get"

Get a license.

GET /licenses/{license}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL