Documentation ¶
Index ¶
- func Deliver(ctx context.Context, t *webhook_model.HookTask) error
- func GetDingtalkPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
- func GetDiscordPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
- func GetFeishuPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
- func GetMSTeamsPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
- func GetMatrixPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
- func GetPackagistPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
- func GetSlackPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
- func GetTelegramPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
- func GetWechatworkPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
- func Init() error
- func IsValidHookTaskType(name string) bool
- func IsValidSlackChannel(name string) bool
- func MatrixLinkFormatter(url, text string) string
- func MatrixLinkToRef(repoURL, ref string) string
- func NewNotifier() base.Notifier
- func PrepareWebhook(ctx context.Context, w *webhook_model.Webhook, ...) error
- func PrepareWebhooks(ctx context.Context, source EventSource, event webhook_module.HookEventType, ...) error
- func ReplayHookTask(ctx context.Context, w *webhook_model.Webhook, uuid string) error
- func SlackLinkFormatter(url, text string) string
- func SlackLinkToRef(repoURL, ref string) string
- func SlackShortTextFormatter(s string) string
- func SlackTextFormatter(s string) string
- func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error)
- type DingtalkPayload
- func (d *DingtalkPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (d *DingtalkPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (d *DingtalkPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (d *DingtalkPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (d *DingtalkPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (d *DingtalkPayload) JSONPayload() ([]byte, error)
- func (d *DingtalkPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (d *DingtalkPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (d *DingtalkPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (d *DingtalkPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (d *DingtalkPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (d *DingtalkPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type DiscordEmbed
- type DiscordEmbedAuthor
- type DiscordEmbedField
- type DiscordEmbedFooter
- type DiscordMeta
- type DiscordPayload
- func (d *DiscordPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (d *DiscordPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (d *DiscordPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (d *DiscordPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (d *DiscordPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (d *DiscordPayload) JSONPayload() ([]byte, error)
- func (d *DiscordPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (d *DiscordPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (d *DiscordPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (d *DiscordPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (d *DiscordPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (d *DiscordPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type EventSource
- type FeishuPayload
- func (f *FeishuPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (f *FeishuPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (f *FeishuPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (f *FeishuPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (f *FeishuPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (f *FeishuPayload) JSONPayload() ([]byte, error)
- func (f *FeishuPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (f *FeishuPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (f *FeishuPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (f *FeishuPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (f *FeishuPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (f *FeishuPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type MSTeamsAction
- type MSTeamsActionTarget
- type MSTeamsFact
- type MSTeamsPayload
- func (m *MSTeamsPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (m *MSTeamsPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (m *MSTeamsPayload) JSONPayload() ([]byte, error)
- func (m *MSTeamsPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (m *MSTeamsPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (m *MSTeamsPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type MSTeamsSection
- type MatrixMeta
- type MatrixPayload
- func (m *MatrixPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (m *MatrixPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (m *MatrixPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (m *MatrixPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (m *MatrixPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (m *MatrixPayload) JSONPayload() ([]byte, error)
- func (m *MatrixPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (m *MatrixPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (m *MatrixPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (m *MatrixPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (m *MatrixPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (m *MatrixPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type PackagistMeta
- type PackagistPayload
- func (f *PackagistPayload) Create(_ *api.CreatePayload) (api.Payloader, error)
- func (f *PackagistPayload) Delete(_ *api.DeletePayload) (api.Payloader, error)
- func (f *PackagistPayload) Fork(_ *api.ForkPayload) (api.Payloader, error)
- func (f *PackagistPayload) Issue(_ *api.IssuePayload) (api.Payloader, error)
- func (f *PackagistPayload) IssueComment(_ *api.IssueCommentPayload) (api.Payloader, error)
- func (f *PackagistPayload) JSONPayload() ([]byte, error)
- func (f *PackagistPayload) PullRequest(_ *api.PullRequestPayload) (api.Payloader, error)
- func (f *PackagistPayload) Push(_ *api.PushPayload) (api.Payloader, error)
- func (f *PackagistPayload) Release(_ *api.ReleasePayload) (api.Payloader, error)
- func (f *PackagistPayload) Repository(_ *api.RepositoryPayload) (api.Payloader, error)
- func (f *PackagistPayload) Review(_ *api.PullRequestPayload, _ webhook_module.HookEventType) (api.Payloader, error)
- func (f *PackagistPayload) Wiki(_ *api.WikiPayload) (api.Payloader, error)
- type PayloadConvertor
- type SlackAttachment
- type SlackMeta
- type SlackPayload
- func (s *SlackPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (s *SlackPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (s *SlackPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (s *SlackPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (s *SlackPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (s *SlackPayload) JSONPayload() ([]byte, error)
- func (s *SlackPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (s *SlackPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (s *SlackPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (s *SlackPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (s *SlackPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (s *SlackPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type TelegramMeta
- type TelegramPayload
- func (t *TelegramPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (t *TelegramPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (t *TelegramPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (t *TelegramPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (t *TelegramPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (t *TelegramPayload) JSONPayload() ([]byte, error)
- func (t *TelegramPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (t *TelegramPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (t *TelegramPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (t *TelegramPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (t *TelegramPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (t *TelegramPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
- type WechatworkPayload
- func (f *WechatworkPayload) Create(p *api.CreatePayload) (api.Payloader, error)
- func (f *WechatworkPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
- func (f *WechatworkPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
- func (f *WechatworkPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
- func (f *WechatworkPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
- func (f *WechatworkPayload) JSONPayload() ([]byte, error)
- func (f *WechatworkPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
- func (f *WechatworkPayload) Push(p *api.PushPayload) (api.Payloader, error)
- func (f *WechatworkPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
- func (f *WechatworkPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
- func (f *WechatworkPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
- func (f *WechatworkPayload) SetSecret(_ string)
- func (f *WechatworkPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deliver ¶
func Deliver(ctx context.Context, t *webhook_model.HookTask) error
Deliver deliver hook task
func GetDingtalkPayload ¶
func GetDingtalkPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
GetDingtalkPayload converts a ding talk webhook into a DingtalkPayload
func GetDiscordPayload ¶
func GetDiscordPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
GetDiscordPayload converts a discord webhook into a DiscordPayload
func GetFeishuPayload ¶
func GetFeishuPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
GetFeishuPayload converts a ding talk webhook into a FeishuPayload
func GetMSTeamsPayload ¶
func GetMSTeamsPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
GetMSTeamsPayload converts a MSTeams webhook into a MSTeamsPayload
func GetMatrixPayload ¶
func GetMatrixPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
GetMatrixPayload converts a Matrix webhook into a MatrixPayload
func GetPackagistPayload ¶
func GetPackagistPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
GetPackagistPayload converts a packagist webhook into a PackagistPayload
func GetSlackPayload ¶
func GetSlackPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error)
GetSlackPayload converts a slack webhook into a SlackPayload
func GetTelegramPayload ¶
func GetTelegramPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
GetTelegramPayload converts a telegram webhook into a TelegramPayload
func GetWechatworkPayload ¶
func GetWechatworkPayload(p api.Payloader, event webhook_module.HookEventType, _ string) (api.Payloader, error)
GetWechatworkPayload GetWechatworkPayload converts a ding talk webhook into a WechatworkPayload
func IsValidHookTaskType ¶
IsValidHookTaskType returns true if a webhook registered
func IsValidSlackChannel ¶
IsValidSlackChannel validates a channel name conforms to what slack expects: https://api.slack.com/methods/conversations.rename#naming Conversation names can only contain lowercase letters, numbers, hyphens, and underscores, and must be 80 characters or less. Gitea accepts if it starts with a #.
func MatrixLinkFormatter ¶
MatrixLinkFormatter creates a link compatible with Matrix
func MatrixLinkToRef ¶
MatrixLinkToRef Matrix-formatter link to a repo ref
func NewNotifier ¶
NewNotifier create a new webhookNotifier notifier
func PrepareWebhook ¶
func PrepareWebhook(ctx context.Context, w *webhook_model.Webhook, event webhook_module.HookEventType, p api.Payloader) error
PrepareWebhook creates a hook task and enqueues it for processing
func PrepareWebhooks ¶
func PrepareWebhooks(ctx context.Context, source EventSource, event webhook_module.HookEventType, p api.Payloader) error
PrepareWebhooks adds new webhooks to task queue for given payload.
func ReplayHookTask ¶
ReplayHookTask replays a webhook task
func SlackLinkFormatter ¶
SlackLinkFormatter creates a link compatible with slack
func SlackLinkToRef ¶
SlackLinkToRef slack-formatter link to a repo ref
func SlackShortTextFormatter ¶
SlackShortTextFormatter replaces &, <, > with HTML characters
func SlackTextFormatter ¶
SlackTextFormatter replaces &, <, > with HTML characters see: https://api.slack.com/docs/formatting
Types ¶
type DingtalkPayload ¶
DingtalkPayload represents
func (*DingtalkPayload) Create ¶
func (d *DingtalkPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*DingtalkPayload) Delete ¶
func (d *DingtalkPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*DingtalkPayload) Fork ¶
func (d *DingtalkPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*DingtalkPayload) Issue ¶
func (d *DingtalkPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*DingtalkPayload) IssueComment ¶
func (d *DingtalkPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*DingtalkPayload) JSONPayload ¶
func (d *DingtalkPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the DingtalkPayload to json
func (*DingtalkPayload) PullRequest ¶
func (d *DingtalkPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*DingtalkPayload) Push ¶
func (d *DingtalkPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*DingtalkPayload) Release ¶
func (d *DingtalkPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*DingtalkPayload) Repository ¶
func (d *DingtalkPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*DingtalkPayload) Review ¶
func (d *DingtalkPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*DingtalkPayload) Wiki ¶
func (d *DingtalkPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type DiscordEmbed ¶
type DiscordEmbed struct { Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` Color int `json:"color"` Author DiscordEmbedAuthor `json:"author"` Fields []DiscordEmbedField `json:"fields"` }
DiscordEmbed is for Embed Structure
type DiscordEmbedAuthor ¶
type DiscordEmbedAuthor struct { Name string `json:"name"` URL string `json:"url"` IconURL string `json:"icon_url"` }
DiscordEmbedAuthor for Embed Author Structure
type DiscordEmbedField ¶
DiscordEmbedField for Embed Field Structure
type DiscordEmbedFooter ¶
type DiscordEmbedFooter struct {
}DiscordEmbedFooter for Embed Footer Structure.
type DiscordMeta ¶
DiscordMeta contains the discord metadata
func GetDiscordHook ¶
func GetDiscordHook(w *webhook_model.Webhook) *DiscordMeta
GetDiscordHook returns discord metadata
type DiscordPayload ¶
type DiscordPayload struct { Wait bool `json:"wait"` Content string `json:"content"` Username string `json:"username"` AvatarURL string `json:"avatar_url,omitempty"` TTS bool `json:"tts"` Embeds []DiscordEmbed `json:"embeds"` }
DiscordPayload represents
func (*DiscordPayload) Create ¶
func (d *DiscordPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*DiscordPayload) Delete ¶
func (d *DiscordPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*DiscordPayload) Fork ¶
func (d *DiscordPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*DiscordPayload) Issue ¶
func (d *DiscordPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*DiscordPayload) IssueComment ¶
func (d *DiscordPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*DiscordPayload) JSONPayload ¶
func (d *DiscordPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the DiscordPayload to json
func (*DiscordPayload) PullRequest ¶
func (d *DiscordPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*DiscordPayload) Push ¶
func (d *DiscordPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*DiscordPayload) Release ¶
func (d *DiscordPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*DiscordPayload) Repository ¶
func (d *DiscordPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*DiscordPayload) Review ¶
func (d *DiscordPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*DiscordPayload) Wiki ¶
func (d *DiscordPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type EventSource ¶
type EventSource struct { Repository *repo_model.Repository Owner *user_model.User }
EventSource represents the source of a webhook action. Repository and/or Owner must be set.
type FeishuPayload ¶
type FeishuPayload struct { MsgType string `json:"msg_type"` // text / post / image / share_chat / interactive Content struct { Text string `json:"text"` } `json:"content"` }
FeishuPayload represents
func (*FeishuPayload) Create ¶
func (f *FeishuPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*FeishuPayload) Delete ¶
func (f *FeishuPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*FeishuPayload) Fork ¶
func (f *FeishuPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*FeishuPayload) Issue ¶
func (f *FeishuPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*FeishuPayload) IssueComment ¶
func (f *FeishuPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*FeishuPayload) JSONPayload ¶
func (f *FeishuPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the FeishuPayload to json
func (*FeishuPayload) PullRequest ¶
func (f *FeishuPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*FeishuPayload) Push ¶
func (f *FeishuPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*FeishuPayload) Release ¶
func (f *FeishuPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*FeishuPayload) Repository ¶
func (f *FeishuPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*FeishuPayload) Review ¶
func (f *FeishuPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*FeishuPayload) Wiki ¶
func (f *FeishuPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type MSTeamsAction ¶
type MSTeamsAction struct { Type string `json:"@type"` Name string `json:"name"` Targets []MSTeamsActionTarget `json:"targets,omitempty"` }
MSTeamsAction is an action (creates buttons, links etc)
type MSTeamsActionTarget ¶
MSTeamsActionTarget is the actual link to follow, etc
type MSTeamsFact ¶
MSTeamsFact for Fact Structure
type MSTeamsPayload ¶
type MSTeamsPayload struct { Type string `json:"@type"` Context string `json:"@context"` ThemeColor string `json:"themeColor"` Title string `json:"title"` Summary string `json:"summary"` Sections []MSTeamsSection `json:"sections"` PotentialAction []MSTeamsAction `json:"potentialAction"` }
MSTeamsPayload is the parent object
func (*MSTeamsPayload) Create ¶
func (m *MSTeamsPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*MSTeamsPayload) Delete ¶
func (m *MSTeamsPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*MSTeamsPayload) Fork ¶
func (m *MSTeamsPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*MSTeamsPayload) Issue ¶
func (m *MSTeamsPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*MSTeamsPayload) IssueComment ¶
func (m *MSTeamsPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*MSTeamsPayload) JSONPayload ¶
func (m *MSTeamsPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the MSTeamsPayload to json
func (*MSTeamsPayload) PullRequest ¶
func (m *MSTeamsPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*MSTeamsPayload) Push ¶
func (m *MSTeamsPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*MSTeamsPayload) Release ¶
func (m *MSTeamsPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*MSTeamsPayload) Repository ¶
func (m *MSTeamsPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*MSTeamsPayload) Review ¶
func (m *MSTeamsPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*MSTeamsPayload) Wiki ¶
func (m *MSTeamsPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type MSTeamsSection ¶
type MSTeamsSection struct { ActivityTitle string `json:"activityTitle"` ActivitySubtitle string `json:"activitySubtitle"` ActivityImage string `json:"activityImage"` Facts []MSTeamsFact `json:"facts"` Text string `json:"text"` }
MSTeamsSection is a MessageCard section
type MatrixMeta ¶
type MatrixMeta struct { HomeserverURL string `json:"homeserver_url"` Room string `json:"room_id"` MessageType int `json:"message_type"` }
MatrixMeta contains the Matrix metadata
func GetMatrixHook ¶
func GetMatrixHook(w *webhook_model.Webhook) *MatrixMeta
GetMatrixHook returns Matrix metadata
type MatrixPayload ¶
type MatrixPayload struct { Body string `json:"body"` MsgType string `json:"msgtype"` Format string `json:"format"` FormattedBody string `json:"formatted_body"` Commits []*api.PayloadCommit `json:"io.gitea.commits,omitempty"` }
MatrixPayload contains payload for a Matrix room
func (*MatrixPayload) Create ¶
func (m *MatrixPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*MatrixPayload) Delete ¶
func (m *MatrixPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete composes Matrix payload for delete a branch or tag.
func (*MatrixPayload) Fork ¶
func (m *MatrixPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork composes Matrix payload for forked by a repository.
func (*MatrixPayload) Issue ¶
func (m *MatrixPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*MatrixPayload) IssueComment ¶
func (m *MatrixPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*MatrixPayload) JSONPayload ¶
func (m *MatrixPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the MatrixPayload to json
func (*MatrixPayload) PullRequest ¶
func (m *MatrixPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*MatrixPayload) Push ¶
func (m *MatrixPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*MatrixPayload) Release ¶
func (m *MatrixPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*MatrixPayload) Repository ¶
func (m *MatrixPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*MatrixPayload) Review ¶
func (m *MatrixPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*MatrixPayload) Wiki ¶
func (m *MatrixPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type PackagistMeta ¶
type PackagistMeta struct { Username string `json:"username"` APIToken string `json:"api_token"` PackageURL string `json:"package_url"` }
PackagistMeta contains the metadata for the webhook
func GetPackagistHook ¶
func GetPackagistHook(w *webhook_model.Webhook) *PackagistMeta
GetPackagistHook returns packagist metadata
type PackagistPayload ¶
type PackagistPayload struct { PackagistRepository struct { URL string `json:"url"` } `json:"repository"` }
PackagistPayload represents
func (*PackagistPayload) Create ¶
func (f *PackagistPayload) Create(_ *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*PackagistPayload) Delete ¶
func (f *PackagistPayload) Delete(_ *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*PackagistPayload) Fork ¶
func (f *PackagistPayload) Fork(_ *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*PackagistPayload) Issue ¶
func (f *PackagistPayload) Issue(_ *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*PackagistPayload) IssueComment ¶
func (f *PackagistPayload) IssueComment(_ *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*PackagistPayload) JSONPayload ¶
func (f *PackagistPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the PackagistPayload to json
func (*PackagistPayload) PullRequest ¶
func (f *PackagistPayload) PullRequest(_ *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*PackagistPayload) Push ¶
func (f *PackagistPayload) Push(_ *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*PackagistPayload) Release ¶
func (f *PackagistPayload) Release(_ *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*PackagistPayload) Repository ¶
func (f *PackagistPayload) Repository(_ *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*PackagistPayload) Review ¶
func (f *PackagistPayload) Review(_ *api.PullRequestPayload, _ webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*PackagistPayload) Wiki ¶
func (f *PackagistPayload) Wiki(_ *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type PayloadConvertor ¶
type PayloadConvertor interface { api.Payloader Create(*api.CreatePayload) (api.Payloader, error) Delete(*api.DeletePayload) (api.Payloader, error) Fork(*api.ForkPayload) (api.Payloader, error) Issue(*api.IssuePayload) (api.Payloader, error) IssueComment(*api.IssueCommentPayload) (api.Payloader, error) Push(*api.PushPayload) (api.Payloader, error) PullRequest(*api.PullRequestPayload) (api.Payloader, error) Review(*api.PullRequestPayload, webhook_module.HookEventType) (api.Payloader, error) Repository(*api.RepositoryPayload) (api.Payloader, error) Release(*api.ReleasePayload) (api.Payloader, error) Wiki(*api.WikiPayload) (api.Payloader, error) }
PayloadConvertor defines the interface to convert system webhook payload to external payload
type SlackAttachment ¶
type SlackAttachment struct { Fallback string `json:"fallback"` Color string `json:"color"` Title string `json:"title"` TitleLink string `json:"title_link"` Text string `json:"text"` }
SlackAttachment contains the slack message
type SlackMeta ¶
type SlackMeta struct { Channel string `json:"channel"` Username string `json:"username"` IconURL string `json:"icon_url"` Color string `json:"color"` }
SlackMeta contains the slack metadata
func GetSlackHook ¶
func GetSlackHook(w *webhook_model.Webhook) *SlackMeta
GetSlackHook returns slack metadata
type SlackPayload ¶
type SlackPayload struct { Channel string `json:"channel"` Text string `json:"text"` Color string `json:"-"` Username string `json:"username"` IconURL string `json:"icon_url"` UnfurlLinks int `json:"unfurl_links"` LinkNames int `json:"link_names"` Attachments []SlackAttachment `json:"attachments"` }
SlackPayload contains the information about the slack channel
func (*SlackPayload) Create ¶
func (s *SlackPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*SlackPayload) Delete ¶
func (s *SlackPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete composes Slack payload for delete a branch or tag.
func (*SlackPayload) Fork ¶
func (s *SlackPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork composes Slack payload for forked by a repository.
func (*SlackPayload) Issue ¶
func (s *SlackPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*SlackPayload) IssueComment ¶
func (s *SlackPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*SlackPayload) JSONPayload ¶
func (s *SlackPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the SlackPayload to json
func (*SlackPayload) PullRequest ¶
func (s *SlackPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*SlackPayload) Push ¶
func (s *SlackPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*SlackPayload) Release ¶
func (s *SlackPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*SlackPayload) Repository ¶
func (s *SlackPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*SlackPayload) Review ¶
func (s *SlackPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*SlackPayload) Wiki ¶
func (s *SlackPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type TelegramMeta ¶
TelegramMeta contains the telegram metadata
func GetTelegramHook ¶
func GetTelegramHook(w *webhook_model.Webhook) *TelegramMeta
GetTelegramHook returns telegram metadata
type TelegramPayload ¶
type TelegramPayload struct { Message string `json:"text"` ParseMode string `json:"parse_mode"` DisableWebPreview bool `json:"disable_web_page_preview"` }
TelegramPayload represents
func (*TelegramPayload) Create ¶
func (t *TelegramPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*TelegramPayload) Delete ¶
func (t *TelegramPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*TelegramPayload) Fork ¶
func (t *TelegramPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*TelegramPayload) Issue ¶
func (t *TelegramPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*TelegramPayload) IssueComment ¶
func (t *TelegramPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*TelegramPayload) JSONPayload ¶
func (t *TelegramPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the TelegramPayload to json
func (*TelegramPayload) PullRequest ¶
func (t *TelegramPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*TelegramPayload) Push ¶
func (t *TelegramPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*TelegramPayload) Release ¶
func (t *TelegramPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*TelegramPayload) Repository ¶
func (t *TelegramPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*TelegramPayload) Review ¶
func (t *TelegramPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*TelegramPayload) Wiki ¶
func (t *TelegramPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method
type WechatworkPayload ¶
type WechatworkPayload struct { Msgtype string `json:"msgtype"` Text struct { Content string `json:"content"` MentionedList []string `json:"mentioned_list"` MentionedMobileList []string `json:"mentioned_mobile_list"` } `json:"text"` Markdown struct { Content string `json:"content"` } `json:"markdown"` }
WechatworkPayload represents
func (*WechatworkPayload) Create ¶
func (f *WechatworkPayload) Create(p *api.CreatePayload) (api.Payloader, error)
Create implements PayloadConvertor Create method
func (*WechatworkPayload) Delete ¶
func (f *WechatworkPayload) Delete(p *api.DeletePayload) (api.Payloader, error)
Delete implements PayloadConvertor Delete method
func (*WechatworkPayload) Fork ¶
func (f *WechatworkPayload) Fork(p *api.ForkPayload) (api.Payloader, error)
Fork implements PayloadConvertor Fork method
func (*WechatworkPayload) Issue ¶
func (f *WechatworkPayload) Issue(p *api.IssuePayload) (api.Payloader, error)
Issue implements PayloadConvertor Issue method
func (*WechatworkPayload) IssueComment ¶
func (f *WechatworkPayload) IssueComment(p *api.IssueCommentPayload) (api.Payloader, error)
IssueComment implements PayloadConvertor IssueComment method
func (*WechatworkPayload) JSONPayload ¶
func (f *WechatworkPayload) JSONPayload() ([]byte, error)
JSONPayload Marshals the WechatworkPayload to json
func (*WechatworkPayload) PullRequest ¶
func (f *WechatworkPayload) PullRequest(p *api.PullRequestPayload) (api.Payloader, error)
PullRequest implements PayloadConvertor PullRequest method
func (*WechatworkPayload) Push ¶
func (f *WechatworkPayload) Push(p *api.PushPayload) (api.Payloader, error)
Push implements PayloadConvertor Push method
func (*WechatworkPayload) Release ¶
func (f *WechatworkPayload) Release(p *api.ReleasePayload) (api.Payloader, error)
Release implements PayloadConvertor Release method
func (*WechatworkPayload) Repository ¶
func (f *WechatworkPayload) Repository(p *api.RepositoryPayload) (api.Payloader, error)
Repository implements PayloadConvertor Repository method
func (*WechatworkPayload) Review ¶
func (f *WechatworkPayload) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (api.Payloader, error)
Review implements PayloadConvertor Review method
func (*WechatworkPayload) SetSecret ¶
func (f *WechatworkPayload) SetSecret(_ string)
SetSecret sets the Wechatwork secret
func (*WechatworkPayload) Wiki ¶
func (f *WechatworkPayload) Wiki(p *api.WikiPayload) (api.Payloader, error)
Wiki implements PayloadConvertor Wiki method