Documentation
¶
Index ¶
- func HashPayload(secret string, payloadBody []byte) string
- func IsValidPayload(secret, headerHash string, payload []byte) bool
- func Validate(secret, headerHash string, payload []byte) error
- type Base
- type Client
- func (c *Client) DeleteWebhook(integrationConfig *cicdv1.IntegrationConfig, id int, client client.Client) error
- func (c *Client) ListWebhook(integrationConfig *cicdv1.IntegrationConfig, client client.Client) ([]git.WebhookEntry, error)
- func (c *Client) ParseWebhook(integrationConfig *cicdv1.IntegrationConfig, header http.Header, ...) (git.Webhook, error)
- func (c *Client) RegisterWebhook(integrationConfig *cicdv1.IntegrationConfig, url string, client client.Client) error
- func (c *Client) SetCommitStatus(integrationJob *cicdv1.IntegrationJob, ...) error
- type CommitStatusBody
- type Head
- type PullRequestWebhook
- type PushWebhook
- type RegistrationWebhookBody
- type RegistrationWebhookBodyConfig
- type Repo
- type Sender
- type WebhookEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPayload ¶
func IsValidPayload ¶
Types ¶
type Client ¶
type Client struct {
}
func (*Client) DeleteWebhook ¶
func (*Client) ListWebhook ¶
func (c *Client) ListWebhook(integrationConfig *cicdv1.IntegrationConfig, client client.Client) ([]git.WebhookEntry, error)
func (*Client) ParseWebhook ¶
func (*Client) RegisterWebhook ¶
func (*Client) SetCommitStatus ¶
func (c *Client) SetCommitStatus(integrationJob *cicdv1.IntegrationJob, integrationConfig *cicdv1.IntegrationConfig, context string, state git.CommitStatusState, description, targetUrl string, client client.Client) error
type CommitStatusBody ¶
type PullRequestWebhook ¶
type PullRequestWebhook struct {
Action string `json:"action"`
Number int `json:"number"`
Sender Sender `json:"sender"`
PullRequest struct {
Title string `json:"title"`
ID int `json:"id"`
State string `json:"state"`
Head Head `json:"head"`
Base Base `json:"base"`
} `json:"pull_request"`
Repo Repo `json:"repository"`
}
Webhook is a github-specific webhook body Should contain json tag for each field, to be unmarshalled properly
type PushWebhook ¶
type PushWebhook struct {
Ref string `json:"ref"`
Repo Repo `json:"repository"`
Pusher struct {
Name string `json:"name"`
} `json:"pusher"`
Sha string `json:"after"`
}
Structure for push webhook event
type RegistrationWebhookBody ¶
type RegistrationWebhookBody struct {
Name string `json:"name"`
Active bool `json:"active"`
Events []string `json:"events"`
Config RegistrationWebhookBodyConfig `json:"config"`
}
type Repo ¶
type Repo struct {
Name string `json:"full_name"`
Htmlurl string `json:"html_url"`
Owner struct {
ID string `json:"login"`
} `json:"owner"`
Private bool `json:"private"`
}
Repo structure for webhook event
type WebhookEntry ¶
Click to show internal directories.
Click to hide internal directories.