Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetBlob(sha string) (*github.Blob, error)
- func (c *Client) GetBranch(branch string) (*github.Branch, error)
- func (c *Client) GetRateLimits() (*github.RateLimits, error)
- func (c *Client) GetRepository() (*github.Repository, error)
- func (c *Client) GetTree(sha string) (*github.Tree, error)
- func (c *Client) GetUser() (*github.User, error)
- func (c *Client) GitHubClient() *github.Client
- func (c *Client) HTTPClient() *http.Client
- func (c *Client) SetHTTPClient(httpClient *http.Client)
- func (c *Client) Token() (*oauth2.Token, error)
- type Command
- type ExitStatus
- type State
- func (s *State) Client() (*Client, error)
- func (s *State) Command() (Command, error)
- func (s *State) Debug() bool
- func (s *State) ParseArguments() error
- func (s *State) Repo() string
- func (s *State) SetDebug(debug bool)
- func (s *State) SetRepo(repo string)
- func (s *State) SetTimeout(timeout time.Duration)
- func (s *State) Timeout() time.Duration
- type Template
Constants ¶
View Source
const (
// Suffix is the file suffix to grok.
Suffix = ".gitignore"
)
Variables ¶
View Source
var ( // ErrActionRequired is returned when no command action is provided ErrActionRequired = errors.New("need an action") // ErrInvalidRepo is returned if the repo provided on the command line does not look like <owner>/<name>. ErrInvalidRepo = errors.New("invalid repo") )
View Source
var ( // ErrTokenNotFound is returned if the client was unable to locate a GITHUB_TOKEN environment variable ErrTokenNotFound = errors.New("token not found") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetRateLimits ¶
func (c *Client) GetRateLimits() (*github.RateLimits, error)
func (*Client) GetRepository ¶
func (c *Client) GetRepository() (*github.Repository, error)
func (*Client) GitHubClient ¶
func (*Client) HTTPClient ¶
func (*Client) SetHTTPClient ¶
type Command ¶
type Command interface { GetName() string Run() ExitStatus }
type ExitStatus ¶
type ExitStatus uint8
type State ¶
The State of the application.
func (*State) ParseArguments ¶
func (*State) SetTimeout ¶
type Template ¶
Template represents a gitignore template from the repository
func NewTemplate ¶
New builds a new Template struct from a GitHub TreeEntry. Returns nil if the entry doesn't point to a Gitignore template.
Click to show internal directories.
Click to hide internal directories.