Versions in this module Expand all Collapse all v6 v6.1.1 Jul 2, 2023 Changes in this version + var ErrEventNotFound = errors.New("event not defined to be parsed") + var ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse") + var ErrHMACVerificationFailed = errors.New("HMAC verification failed") + var ErrInvalidHTTPMethod = errors.New("invalid HTTP Method") + var ErrMissingGiteaEventHeader = errors.New("missing X-Gitea-Event Header") + var ErrMissingGiteaSignatureHeader = errors.New("missing X-Gitea-Signature Header") + var ErrParsingPayload = errors.New("error parsing payload") + var Options = WebhookOptions + type Attachment struct + Created time.Time + DownloadCount int64 + DownloadURL string + ID int64 + Name string + Size int64 + UUID string + type ChangesFromPayload struct + From string + type ChangesPayload struct + Body *ChangesFromPayload + Ref *ChangesFromPayload + Title *ChangesFromPayload + type Comment struct + Body string + Created time.Time + HTMLURL string + ID int64 + IssueURL string + OriginalAuthor string + OriginalAuthorID int64 + PRURL string + Poster *User + Updated time.Time + type CreatePayload struct + Ref string + RefType string + Repo *Repository + Sender *User + Sha string + type DeletePayload struct + PusherType PusherType + Ref string + RefType string + Repo *Repository + Sender *User + type Event string + const CreateEvent + const DeleteEvent + const ForkEvent + const IssueAssignEvent + const IssueCommentEvent + const IssueLabelEvent + const IssueMilestoneEvent + const IssuesEvent + const PullRequestAssignEvent + const PullRequestCommentEvent + const PullRequestEvent + const PullRequestLabelEvent + const PullRequestMilestoneEvent + const PullRequestReviewEvent + const PullRequestSyncEvent + const PushEvent + const ReleaseEvent + const RepositoryEvent + type ExternalTracker struct + ExternalTrackerFormat string + ExternalTrackerStyle string + ExternalTrackerURL string + type ExternalWiki struct + ExternalWikiURL string + type ForkPayload struct + Forkee *Repository + Repo *Repository + Sender *User + type HookIssueAction string + type HookIssueCommentAction string + type HookReleaseAction string + type HookRepoAction string + type InternalTracker struct + AllowOnlyContributorsToTrackTime bool + EnableIssueDependencies bool + EnableTimeTracker bool + type Issue struct + Assignee *User + Assignees []*User + Body string + Closed *time.Time + Comments int + Created time.Time + Deadline *time.Time + HTMLURL string + ID int64 + Index int64 + IsLocked bool + Labels []*Label + Milestone *Milestone + OriginalAuthor string + OriginalAuthorID int64 + Poster *User + PullRequest *PullRequestMeta + Ref string + Repo *RepositoryMeta + State StateType + Title string + URL string + Updated time.Time + type IssueCommentPayload struct + Action HookIssueCommentAction + Changes *ChangesPayload + Comment *Comment + IsPull bool + Issue *Issue + Repository *Repository + Sender *User + type IssuePayload struct + Action HookIssueAction + Changes *ChangesPayload + Index int64 + Issue *Issue + Repository *Repository + Sender *User + type Label struct + Color string + Description string + ID int64 + Name string + URL string + type Milestone struct + Closed *time.Time + ClosedIssues int + Created time.Time + Deadline *time.Time + Description string + ID int64 + OpenIssues int + State StateType + Title string + Updated *time.Time + type Option func(*Webhook) error + type PRBranchInfo struct + Name string + Ref string + RepoID int64 + Repository *Repository + Sha string + type PayloadCommit struct + Added []string + Author *PayloadUser + Committer *PayloadUser + ID string + Message string + Modified []string + Removed []string + Timestamp time.Time + URL string + Verification *PayloadCommitVerification + type PayloadCommitVerification struct + Payload string + Reason string + Signature string + Signer *PayloadUser + Verified bool + type PayloadUser struct + Email string + Name string + UserName string + type Permission struct + Admin bool + Pull bool + Push bool + type PullRequest struct + Assignee *User + Assignees []*User + Base *PRBranchInfo + Body string + Closed *time.Time + Comments int + Created *time.Time + Deadline *time.Time + DiffURL string + HTMLURL string + HasMerged bool + Head *PRBranchInfo + ID int64 + Index int64 + IsLocked bool + Labels []*Label + MergeBase string + Mergeable bool + Merged *time.Time + MergedBy *User + MergedCommitID *string + Milestone *Milestone + PatchURL string + Poster *User + State StateType + Title string + URL string + Updated *time.Time + type PullRequestMeta struct + HasMerged bool + Merged *time.Time + type PullRequestPayload struct + Action HookIssueAction + Changes *ChangesPayload + Index int64 + PullRequest *PullRequest + Repository *Repository + Review *ReviewPayload + Sender *User + type PushPayload struct + After string + Before string + Commits []*PayloadCommit + CompareURL string + HeadCommit *PayloadCommit + Pusher *User + Ref string + Repo *Repository + Sender *User + type PusherType string + type Release struct + Attachments []*Attachment + CreatedAt time.Time + HTMLURL string + ID int64 + IsDraft bool + IsPrerelease bool + Note string + PublishedAt time.Time + Publisher *User + TagName string + TarURL string + Target string + Title string + URL string + ZipURL string + type ReleasePayload struct + Action HookReleaseAction + Release *Release + Repository *Repository + Sender *User + type Repository struct + AllowMerge bool + AllowRebase bool + AllowRebaseMerge bool + AllowSquash bool + Archived bool + AvatarURL string + CloneURL string + Created time.Time + DefaultBranch string + DefaultMergeStyle string + Description string + Empty bool + ExternalTracker *ExternalTracker + ExternalWiki *ExternalWiki + Fork bool + Forks int + FullName string + HTMLURL string + HasIssues bool + HasProjects bool + HasPullRequests bool + HasWiki bool + ID int64 + IgnoreWhitespaceConflicts bool + Internal bool + InternalTracker *InternalTracker + Mirror bool + MirrorInterval string + Name string + OpenIssues int + OpenPulls int + OriginalURL string + Owner *User + Parent *Repository + Permissions *Permission + Private bool + Releases int + SSHURL string + Size int + Stars int + Template bool + Updated time.Time + Watchers int + Website string + type RepositoryMeta struct + FullName string + ID int64 + Name string + Owner string + type RepositoryPayload struct + Action HookRepoAction + Organization *User + Repository *Repository + Sender *User + type ReviewPayload struct + Content string + Type string + type StateType string + type User struct + AvatarURL string + Created time.Time + Description string + Email string + Followers int + Following int + FullName string + ID int64 + IsActive bool + IsAdmin bool + Language string + LastLogin time.Time + Location string + ProhibitLogin bool + Restricted bool + StarredRepos int + UserName string + Visibility string + Website string + type Webhook struct + func New(options ...Option) (*Webhook, error) + func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error) + type WebhookOptions struct + func (WebhookOptions) Secret(secret string) Option