Documentation ¶
Index ¶
- func AddIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, ...) error
- func DelHook(c context.Context, u *model.User, r *model.Repo, hook string) error
- func GetComments(c context.Context, u *model.User, r *model.Repo, num int) ([]*model.Comment, error)
- func GetContents(c context.Context, u *model.User, r *model.Repo, path string) ([]byte, error)
- func GetHook(c context.Context, r *http.Request) (*model.Hook, error)
- func GetIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int) ([]string, error)
- func GetMembers(c context.Context, u *model.User, team string) ([]*model.Member, error)
- func GetPerm(c context.Context, u *model.User, owner, name string) (*model.Perm, error)
- func GetRepo(c context.Context, u *model.User, owner, name string) (*model.Repo, error)
- func GetRepos(c context.Context, u *model.User) ([]*model.Repo, error)
- func GetReviews(c context.Context, u *model.User, r *model.Repo, num int) ([]*model.Review, error)
- func GetTeams(c context.Context, u *model.User) ([]*model.Team, error)
- func GetUser(c context.Context, w http.ResponseWriter, r *http.Request) (*model.User, error)
- func GetUserToken(c context.Context, token string) (string, error)
- func RemoveIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, ...) error
- func SetHook(c context.Context, u *model.User, r *model.Repo, hook string) error
- func SetStatus(c context.Context, u *model.User, r *model.Repo, num, granted, required int) error
- func ToContext(c Setter, client Remote)
- type Account
- type Comment
- type Issue
- type Remote
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIssueLabels ¶
func AddIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, labels []string) error
AddIssueLabels writes labels for the requirements of reviews.
func GetComments ¶
func GetComments(c context.Context, u *model.User, r *model.Repo, num int) ([]*model.Comment, error)
GetComments gets pull request comments from the remote system.
func GetContents ¶
GetContents gets the file contents from the remote system.
func GetIssueLabels ¶
func GetIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int) ([]string, error)
GetIssueLabels get all the labels of an issue
func GetMembers ¶
GetMembers gets a team members list from the remote system.
func GetReviews ¶
GetReviews gets pull request reviews from the remote system.
func GetUserToken ¶
GetUserToken authenticates a user with the remote system using the remote systems OAuth token.
func RemoveIssueLabels ¶
func RemoveIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, labels []string) error
RemoveIssueLabels remove the labels of some issue.
Types ¶
type Account ¶
type Account struct { Login string `json:"login"` Avatar string `json:"avatar"` Kind string `json:"type"` }
Account represents a user or team account.
type Issue ¶
type Issue struct { Number int `json:"issue"` Title string `json:"title"` Author string `json:"author"` }
Issue represents an issue or pull request.
type Remote ¶
type Remote interface { // GetUser authenticates a user with the remote system. GetUser(context.Context, http.ResponseWriter, *http.Request) (*model.User, error) // GetUserToken authenticates a user with the remote system using // the remote systems OAuth token. GetUserToken(context.Context, string) (string, error) // GetTeams gets a team list from the remote system. GetTeams(context.Context, *model.User) ([]*model.Team, error) // GetMembers gets a team member list from the remote system. GetMembers(context.Context, *model.User, string) ([]*model.Member, error) // GetRepo gets a repository from the remote system. GetRepo(context.Context, *model.User, string, string) (*model.Repo, error) // GetPerm gets a repository permission from the remote system. GetPerm(context.Context, *model.User, string, string) (*model.Perm, error) // GetRepo gets a repository list from the remote system. GetRepos(context.Context, *model.User) ([]*model.Repo, error) // SetHook adds a webhook to the remote repository. SetHook(context.Context, *model.User, *model.Repo, string) error // DelHook deletes a webhook from the remote repository. DelHook(context.Context, *model.User, *model.Repo, string) error // GetComments gets pull request comments from the remote system. GetComments(context.Context, *model.User, *model.Repo, int) ([]*model.Comment, error) // GetComments gets pull request comments from the remote system. GetReviews(context.Context, *model.User, *model.Repo, int) ([]*model.Review, error) // GetContents gets the file contents from the remote system. GetContents(context.Context, *model.User, *model.Repo, string) ([]byte, error) // SetStatus adds or updates the pull request status in the remote system. SetStatus(context.Context, *model.User, *model.Repo, int, int, int) error // GetHook gets the hook from the http Request. GetHook(c context.Context, r *http.Request) (*model.Hook, error) // RemoveIssueLabels remove the labels of an issue RemoveIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, labels []string) error // AddIssueLabels add the labels to an issue AddIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int, lables []string) error // GetIssueLabels get all the labels of an issue GetIssueLabels(c context.Context, user *model.User, repo *model.Repo, number int) ([]string, error) }
Remote represents a general interface for remote communications.
func FromContext ¶
FromContext returns the Remote client associated with this context.