listener

package
v0.0.0-...-321905c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Status                   []func(status event.Status) (bool, error)
	Issues                   []func(issue event.Issues) (bool, error)
	IssueComment             []func(issueComment event.IssueComment) (bool, error)
	Watch                    []func(watch event.Watch) (bool, error)
	Push                     []func(watch event.Push) (bool, error)
	Create                   []func(watch event.Create) (bool, error)
	Label                    []func(label event.Label) (bool, error)
	Delete                   []func(delete event.Delete) (bool, error)
	Milestone                []func(milestone event.Milestone) (bool, error)
	PullRequest              []func(pullRequest event.PullRequest) (bool, error)
	PullRequestReview        []func(pullRequestReview event.PullRequestReview) (bool, error)
	PullRequestReviewComment []func(pullRequestReviewComment event.PullRequestReviewComment) (bool, error)
	Raw                      []func(raw event.Raw) (bool, error)
}

Action struct

func (*Action) ConvertToJSON

func (e *Action) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Action) ExecuteCreateActions

func (e *Action) ExecuteCreateActions(create event.Create) (bool, error)

ExecuteCreateActions executes actions for create events

func (*Action) ExecuteDeleteActions

func (e *Action) ExecuteDeleteActions(delete event.Delete) (bool, error)

ExecuteDeleteActions executes actions for delete events

func (*Action) ExecuteIssueCommentActions

func (e *Action) ExecuteIssueCommentActions(issueComment event.IssueComment) (bool, error)

ExecuteIssueCommentActions executes actions for issue comment events

func (*Action) ExecuteIssuesActions

func (e *Action) ExecuteIssuesActions(issue event.Issues) (bool, error)

ExecuteIssuesActions executes actions for issues events

func (*Action) ExecuteLabelActions

func (e *Action) ExecuteLabelActions(label event.Label) (bool, error)

ExecuteLabelActions executes actions for label events

func (*Action) ExecuteMilestoneActions

func (e *Action) ExecuteMilestoneActions(milestone event.Milestone) (bool, error)

ExecuteMilestoneActions executes actions for milestone events

func (*Action) ExecutePullRequestActions

func (e *Action) ExecutePullRequestActions(pullRequest event.PullRequest) (bool, error)

ExecutePullRequestActions executes actions for pull request events

func (*Action) ExecutePullRequestReviewActions

func (e *Action) ExecutePullRequestReviewActions(pullRequestReview event.PullRequestReview) (bool, error)

ExecutePullRequestReviewActions executes actions for pull requests review events

func (*Action) ExecutePullRequestReviewCommentActions

func (e *Action) ExecutePullRequestReviewCommentActions(pullRequestReviewComment event.PullRequestReviewComment) (bool, error)

ExecutePullRequestReviewCommentActions executes actions for pull requests review comment events

func (*Action) ExecutePushActions

func (e *Action) ExecutePushActions(push event.Push) (bool, error)

ExecutePushActions executes actions for push events

func (*Action) ExecuteRawActions

func (e *Action) ExecuteRawActions(raw event.Raw) (bool, error)

ExecuteRawActions executes actions for all events

func (*Action) ExecuteStatusActions

func (e *Action) ExecuteStatusActions(status event.Status) (bool, error)

ExecuteStatusActions executes actions for status events

func (*Action) ExecuteWatchActions

func (e *Action) ExecuteWatchActions(watch event.Watch) (bool, error)

ExecuteWatchActions executes actions for watch events

func (*Action) LoadFromJSON

func (e *Action) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

func (*Action) RegisterCreateAction

func (e *Action) RegisterCreateAction(f func(create event.Create) (bool, error))

RegisterCreateAction adds action for create event

func (*Action) RegisterDeleteAction

func (e *Action) RegisterDeleteAction(f func(delete event.Delete) (bool, error))

RegisterDeleteAction adds action for delete event

func (*Action) RegisterIssueCommentAction

func (e *Action) RegisterIssueCommentAction(f func(issueComment event.IssueComment) (bool, error))

RegisterIssueCommentAction adds action for issue comment event

func (*Action) RegisterIssuesAction

func (e *Action) RegisterIssuesAction(f func(issue event.Issues) (bool, error))

RegisterIssuesAction adds action for issues event

func (*Action) RegisterLabelAction

func (e *Action) RegisterLabelAction(f func(label event.Label) (bool, error))

RegisterLabelAction adds action for label event

func (*Action) RegisterMilestoneAction

func (e *Action) RegisterMilestoneAction(f func(milestone event.Milestone) (bool, error))

RegisterMilestoneAction adds action for milestone event

func (*Action) RegisterPullRequestAction

func (e *Action) RegisterPullRequestAction(f func(pullRequest event.PullRequest) (bool, error))

RegisterPullRequestAction adds action for pull request event

func (*Action) RegisterPullRequestReviewAction

func (e *Action) RegisterPullRequestReviewAction(f func(pullRequestReview event.PullRequestReview) (bool, error))

RegisterPullRequestReviewAction adds action for pull request review event

func (*Action) RegisterPullRequestReviewCommentAction

func (e *Action) RegisterPullRequestReviewCommentAction(f func(pullRequestReviewComment event.PullRequestReviewComment) (bool, error))

RegisterPullRequestReviewCommentAction adds action for pull request review comment event

func (*Action) RegisterPushAction

func (e *Action) RegisterPushAction(f func(watch event.Push) (bool, error))

RegisterPushAction adds action for push event

func (*Action) RegisterRawAction

func (e *Action) RegisterRawAction(f func(raw event.Raw) (bool, error))

RegisterRawAction adds action for all events

func (*Action) RegisterStatusAction

func (e *Action) RegisterStatusAction(f func(status event.Status) (bool, error))

RegisterStatusAction adds action for status event

func (*Action) RegisterWatchAction

func (e *Action) RegisterWatchAction(f func(watch event.Watch) (bool, error))

RegisterWatchAction adds action for watch event

type Commands

type Commands struct {
	Incoming     []event.Command
	Issues       map[string]func(command event.Command, issues event.Issues) (bool, error)
	IssueComment map[string]func(command event.Command, issueComment event.IssueComment) (bool, error)
}

Commands struct

func (*Commands) ExecuteIssueCommentActions

func (e *Commands) ExecuteIssueCommentActions(issueComment event.IssueComment) (bool, error)

ExecuteIssueCommentActions runs issue comment actions

func (*Commands) ExecuteIssuesActions

func (e *Commands) ExecuteIssuesActions(issues event.Issues) (bool, error)

ExecuteIssuesActions runs issues actions

func (*Commands) Fetch

func (e *Commands) Fetch(body string)

Fetch will fetch all commands and parameters within the issue or issue comment

func (*Commands) RegisterIssueCommentAction

func (e *Commands) RegisterIssueCommentAction(command string, callback func(command event.Command, issueComment event.IssueComment) (bool, error))

RegisterIssueCommentAction registers issue comment action for a specific command

func (*Commands) RegisterIssuesAction

func (e *Commands) RegisterIssuesAction(command string, callback func(command event.Command, issues event.Issues) (bool, error))

RegisterIssuesAction registers issue action for a specific command

type Parser

type Parser struct {
	UserAgent      string
	GithubDelivery string
	GitHubEvent    string
	HubSignature   string
	Headers        map[string]string
	Body           string
}

Parser struct

func (*Parser) ConvertToJSON

func (e *Parser) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Parser) GetBody

func (e *Parser) GetBody() string

GetBody gets body

func (*Parser) GetGitHubEvent

func (e *Parser) GetGitHubEvent() string

GetGitHubEvent gets github event

func (*Parser) GetGithubDelivery

func (e *Parser) GetGithubDelivery() string

GetGithubDelivery gets github delivery

func (*Parser) GetHeader

func (e *Parser) GetHeader(key string) string

GetHeader gets header

func (*Parser) GetHubSignature

func (e *Parser) GetHubSignature() string

GetHubSignature gets hub signature

func (*Parser) GetUserAgent

func (e *Parser) GetUserAgent() string

GetUserAgent gets user agent

func (*Parser) LoadFromJSON

func (e *Parser) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

func (*Parser) SetBody

func (e *Parser) SetBody(body string)

SetBody sets body

func (*Parser) SetGitHubEvent

func (e *Parser) SetGitHubEvent(githubEvent string)

SetGitHubEvent sets github event

func (*Parser) SetGithubDelivery

func (e *Parser) SetGithubDelivery(githubDelivery string)

SetGithubDelivery sets github delivery

func (*Parser) SetHeader

func (e *Parser) SetHeader(key string, value string)

SetHeader sets header

func (*Parser) SetHubSignature

func (e *Parser) SetHubSignature(hubSignature string)

SetHubSignature sets hub signature

func (*Parser) SetUserAgent

func (e *Parser) SetUserAgent(userAgent string)

SetUserAgent sets user agent

func (*Parser) SignBody

func (e *Parser) SignBody(secret, body []byte) []byte

SignBody signs body

func (*Parser) VerifySignature

func (e *Parser) VerifySignature(secret string) bool

VerifySignature verify signature

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL