Documentation ¶
Index ¶
- Variables
- func ConfigFile()
- func DoByFixTime()
- func PathExists(path string) (bool, error)
- func ValidateWebhook(w http.ResponseWriter, r *http.Request) (string, string, []byte, bool, int)
- type CSTFormatter
- type Client
- type Consumer
- type ConsumerConfig
- type ErrorForbidden
- type InfoContent
- type Issue
- type ListPullRequestOpt
- type Rabbit
- type RabbitConfig
- type RepoInfo
- type TargetInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var LogInstance = logrus.New()
Functions ¶
func ConfigFile ¶
func ConfigFile()
func DoByFixTime ¶
func DoByFixTime()
func PathExists ¶
func ValidateWebhook ¶
ValidateWebhook ensures that the provided request conforms to the format of a Gitee webhook and the payload can be validated with the provided hmac secret. It returns the event type, the event guid, the payload of the request, whether the webhook is valid or not, and finally the resultant HTTP status code
Types ¶
type CSTFormatter ¶
type Client ¶
type Client interface { CreatePullRequest(org, repo, title, body, head, base string, canModify bool) (sdk.PullRequest, error) GetPullRequests(org, repo string, opts ListPullRequestOpt) ([]sdk.PullRequest, error) UpdatePullRequest(org, repo string, number int32, param sdk.PullRequestUpdateParam) (sdk.PullRequest, error) GetRef(org, repo, ref string) (string, error) GetPRLabels(org, repo string, number int) ([]sdk.Label, error) ListPRComments(org, repo string, number int) ([]sdk.PullRequestComments, error) ListPrIssues(org, repo string, number int32) ([]sdk.Issue, error) DeletePRComment(org, repo string, ID int) error CreatePRComment(org, repo string, number int, comment string) error UpdatePRComment(org, repo string, commentID int, comment string) error AddPRLabel(org, repo string, number int, labels []string) error RemovePRLabel(org, repo string, number int, label string) error AssignPR(owner, repo string, number int, logins []string) error UnassignPR(owner, repo string, number int, logins []string) error GetPRCommits(org, repo string, number int) ([]sdk.PullRequestCommits, error) AssignGiteeIssue(org, repo, labels string, number string, login string) error UnassignGiteeIssue(org, repo, labels string, number string, login string) error CreateGiteeIssueComment(org, repo string, number string, comment string) error IsCollaborator(owner, repo, login string) (bool, error) IsMember(org, login string) (bool, error) GetGiteePullRequest(org, repo string, number int) (sdk.PullRequest, error) GetGiteeRepo(org, repo string) (sdk.Project, error) MergePR(owner, repo string, number int, opt sdk.PullRequestMergePutParam) error GetRepos(org string) ([]sdk.Project, error) RemoveIssueLabel(org, repo, number, label string) error AddIssueLabel(org, repo, number string, label []string) error AddIssueAssignee(org, repo, number, token, assignee string) error GetUserOrg(login string) ([]sdk.Group, error) GetUserEnt(ent, login string) (sdk.EnterpriseMember, error) ListIssues(owner, repo, state, since, createAt string, page, perPage int) ([]sdk.Issue, *http.Response, error) ListLabels(owner, repo string) ([]sdk.Label, error) }
Client interface for Gitee API
type Consumer ¶
type Consumer struct { Rabbit *Rabbit // contains filtered or unexported fields }
func NewConsumer ¶
func NewConsumer(config ConsumerConfig, rabbit *Rabbit) *Consumer
NewConsumer returns a consumer instance.
type ConsumerConfig ¶
type ErrorForbidden ¶
type ErrorForbidden struct {
// contains filtered or unexported fields
}
func (ErrorForbidden) Error ¶
func (e ErrorForbidden) Error() string
type InfoContent ¶
type ListPullRequestOpt ¶
type Rabbit ¶
type Rabbit struct {
// contains filtered or unexported fields
}
func (*Rabbit) Connection ¶
func (r *Rabbit) Connection() (*amqp.Connection, error)
Connection returns exiting `*amqp.Connection` instance.
type RabbitConfig ¶
type TargetInfo ¶
type TargetInfo struct { TargetUser []string `json:"targetUser"` InfoType string `json:"infoType"` InfoContent InfoContent `json:"infoContent"` }
Click to show internal directories.
Click to hide internal directories.