Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
GitHubGitignoresService
}
Client can fetch gitignore templates.
func NewClient ¶
NewClient creates a new *Client which will use httpClient for making http requests. If httpClient is nil, http.DefaultClient will be used instead.
func (*Client) GetTemplate ¶
GetTemplate fetches the gitignore template for query. The query can be a comma-separated list of gitignore templates (e.g. "go,python") which are combined into a single gitignore template. Will return an error if the http connection fails or if the response status code is not 200. Will return ErrNotFound if any of the requested gitignore templates cannot be found.
type GitHubGitignoresService ¶ added in v0.3.0
type GitHubGitignoresService interface {
Get(ctx context.Context, name string) (*github.Gitignore, *github.Response, error)
List(ctx context.Context) ([]string, *github.Response, error)
}
GitHubGitignoresService is the interface of the GitHub Gitignores API Service.
type NotFoundError ¶ added in v0.3.0
type NotFoundError string
NotFoundError is returned if a gitignore template could not be found.
func (NotFoundError) Error ¶ added in v0.3.0
func (e NotFoundError) Error() string