Documentation
¶
Index ¶
- Constants
- func RequestHTTP(method string, uri string, header map[string]string, data interface{}) ([]byte, http.Header, error)
- type Base
- type Client
- type CommitStatusState
- type EventType
- type Head
- type PullRequest
- type PullRequestAction
- type PullRequestState
- type Push
- type Repository
- type Sender
- type User
- type Webhook
- type WebhookEntry
Constants ¶
View Source
const ( EventTypePullRequest = EventType("pull_request") EventTypePush = EventType("push") )
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)
}
Client is a git client interface
type PullRequest ¶
type PullRequest struct {
ID int
Title string
State PullRequestState
Action PullRequestAction
Sender Sender
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
Action string
}
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.