Documentation
¶
Index ¶
- Constants
- func RequestHTTP(method string, uri string, header map[string]string, data interface{}) ([]byte, http.Header, error)
- type Base
- type Client
- type Comment
- type CommitStatusState
- type EventType
- type Head
- type Issue
- type IssueComment
- type IssueType
- type PullRequest
- type PullRequestAction
- type PullRequestState
- type Push
- type Repository
- type User
- type Webhook
- type WebhookEntry
Constants ¶
View Source
const ( IssueTypeIssue = IssueType("issue") IssueTypePullRequest = IssueType("pull_request") )
IssueType constants
View Source
const ( EventTypePullRequest = EventType("pull_request") EventTypePush = EventType("push") EventTypeIssueComment = EventType("issue_comment") EventTypePullRequestReview = EventType("pull_request_review") EventTypePullRequestReviewComment = EventType("pull_request_review_comment") )
Event Types
View Source
const ( PullRequestStateOpen = PullRequestState("open") PullRequestStateClosed = PullRequestState("closed") )
Pull Request states
View Source
const ( PullRequestActionReOpen = PullRequestAction("reopened") PullRequestActionOpen = PullRequestAction("opened") PullRequestActionClose = PullRequestAction("closed") PullRequestActionSynchronize = PullRequestAction("synchronize") )
Pull Request actions
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface {
// Webhooks
ListWebhook() ([]WebhookEntry, error)
RegisterWebhook(url string) error
DeleteWebhook(id int) error
ParseWebhook(http.Header, []byte) (*Webhook, error)
// Commit Status
SetCommitStatus(integrationJob *cicdv1.IntegrationJob, context string, state CommitStatusState, description, targetURL string) error
// Users
GetUserInfo(user string) (*User, error)
CanUserWriteToRepo(user User) (bool, error)
// Comments
RegisterComment(issueType IssueType, issueNo int, body string) error
}
Client is a git client interface
type Issue ¶ added in v0.2.0
type Issue struct {
PullRequest *PullRequest
}
Issue is an issue related to the Comment
type IssueComment ¶ added in v0.2.0
IssueComment is a common structure for issue comment
type PullRequest ¶
type PullRequest struct {
ID int
Title string
State PullRequestState
Action PullRequestAction
Sender User
URL string
Base Base
Head Head
}
PullRequest is a common structure for pull request events
type PullRequestAction ¶
type PullRequestAction string
PullRequestAction is an action of the pull request event
type PullRequestState ¶
type PullRequestState string
PullRequestState is a state of the pull request
type Repository ¶
Repository is a repository of the git
type Webhook ¶
type Webhook struct {
EventType EventType
Repo Repository
Push *Push
PullRequest *PullRequest
IssueComment *IssueComment
}
Webhook is a common structure for git webhooks github-specific or gitlab-specific webhook bodies are converted to this structure before being consumed
type WebhookEntry ¶
WebhookEntry is a body of registered webhook list
Click to show internal directories.
Click to hide internal directories.