Documentation ¶
Index ¶
- func CreateHook(client *github.Client, owner, name, url string) (*github.Hook, error)
- func DeleteHook(client *github.Client, owner, name, url string) error
- func GetFile(client *github.Client, owner, name, path, ref string) ([]byte, error)
- func GetHook(client *github.Client, owner, name, rawurl string) (*github.Hook, error)
- func GetUserRepos(client *github.Client) ([]github.Repository, error)
- type Branch
- type Client
- type Error
- type Github
- func (g *Github) DelHook(user *model.User, repo *model.Repo, link string) error
- func (g *Github) GetComments(u *model.User, r *model.Repo, num int) ([]*model.Comment, error)
- func (g *Github) GetContents(u *model.User, r *model.Repo, path string) ([]byte, error)
- func (g *Github) GetHook(r *http.Request) (*model.Hook, error)
- func (g *Github) GetMembers(user *model.User, team string) ([]*model.Member, error)
- func (g *Github) GetPerm(user *model.User, owner, name string) (*model.Perm, error)
- func (g *Github) GetRepo(user *model.User, owner, name string) (*model.Repo, error)
- func (g *Github) GetRepos(u *model.User) ([]*model.Repo, error)
- func (g *Github) GetTeams(user *model.User) ([]*model.Team, error)
- func (g *Github) GetUser(res http.ResponseWriter, req *http.Request) (*model.User, error)
- func (g *Github) GetUserToken(token string) (string, error)
- func (g *Github) SetHook(user *model.User, repo *model.Repo, link string) error
- func (g *Github) SetStatus(u *model.User, r *model.Repo, num, granted, required int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHook ¶
CreateHook is a heper function that creates a post-commit hook for the specified repository.
func GetFile ¶
GetFile is a heper function that retrieves a file from GitHub and returns its contents in byte array format.
func GetHook ¶
GetHook is a heper function that retrieves a hook by hostname. To do this, it will retrieve a list of all hooks and iterate through the list.
func GetUserRepos ¶
func GetUserRepos(client *github.Client) ([]github.Repository, error)
GetUserRepos is a helper function that returns a list of all user repositories. Paginated results are aggregated into a single list.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientToken ¶
NewClientToken returns a client at the specified url that authenticates all outbound requests with the given token.
func (*Client) BranchProtect ¶
Click to show internal directories.
Click to hide internal directories.