Documentation ¶
Index ¶
- Constants
- type Provider
- func (v *Provider) CreateStatus(_ context.Context, _ versioned.Interface, event *info.Event, ...) error
- func (v *Provider) Detect(req *http.Request, payload string, logger *zap.SugaredLogger) (bool, bool, *zap.SugaredLogger, string, error)
- func (v *Provider) GetCommitInfo(ctx context.Context, runevent *info.Event) error
- func (v *Provider) GetConfig() *info.ProviderConfig
- func (v *Provider) GetFileInsideRepo(_ context.Context, runevent *info.Event, path, target string) (string, error)
- func (v *Provider) GetFiles(ctx context.Context, runevent *info.Event) ([]string, error)
- func (v *Provider) GetStringPullRequestComment(ctx context.Context, runevent *info.Event, reg string) ([]*gitea.Comment, error)
- func (v *Provider) GetTaskURI(ctx context.Context, params *params.Run, event *info.Event, uri string) (bool, string, error)
- func (v *Provider) GetTektonDir(_ context.Context, event *info.Event, path string) (string, error)
- func (v *Provider) IsAllowed(ctx context.Context, event *info.Event) (bool, error)
- func (v *Provider) ParsePayload(_ context.Context, _ *params.Run, request *http.Request, payload string) (*info.Event, error)
- func (v *Provider) SetClient(_ context.Context, run *params.Run, runevent *info.Event) error
- func (v *Provider) SetLogger(logger *zap.SugaredLogger)
- func (v *Provider) Validate(_ context.Context, _ *params.Run, event *info.Event) error
Constants ¶
View Source
const ( EventTypeCreate whEventType = "create" EventTypeDelete whEventType = "delete" EventTypeFork whEventType = "fork" EventTypePush whEventType = "push" EventTypeIssues whEventType = "issues" EventTypeIssueComment whEventType = "issue_comment" EventTypeRepository whEventType = "repository" EventTypeRelease whEventType = "release" EventTypePullRequest whEventType = "pull_request" EventTypePullRequestApproved whEventType = "pull_request_approved" EventTypePullRequestRejected whEventType = "pull_request_rejected" EventTypePullRequestComment whEventType = "pull_request_comment" EventTypePullRequestSync whEventType = "pull_request_sync" )
List of supported events
Find them in Gitea's source at /models/webhook.go as HookEventType. To correlate with when each of these trigger, see the Trigger On -> Custom Events options when editing a repo's webhook in a Gitea project. Those descriptions are helpful.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct { Client *gitea.Client Logger *zap.SugaredLogger Token *string // only exposed for e2e tests Password string // contains filtered or unexported fields }
func (*Provider) CreateStatus ¶
func (*Provider) Detect ¶
func (v *Provider) Detect(req *http.Request, payload string, logger *zap.SugaredLogger) (bool, bool, *zap.SugaredLogger, string, error)
Detect processes event and detect if it is a gitea event, whether to process or reject it returns (if is a Gitea event, whether to process or reject, logger with event metadata,, error if any occurred)
func (*Provider) GetCommitInfo ¶
func (*Provider) GetConfig ¶
func (v *Provider) GetConfig() *info.ProviderConfig
func (*Provider) GetFileInsideRepo ¶
func (*Provider) GetStringPullRequestComment ¶
func (v *Provider) GetStringPullRequestComment(ctx context.Context, runevent *info.Event, reg string) ([]*gitea.Comment, error)
GetStringPullRequestComment return the comment if we find a regexp in one of the comments text of a pull request
func (*Provider) GetTaskURI ¶ added in v0.13.0
func (v *Provider) GetTaskURI(ctx context.Context, params *params.Run, event *info.Event, uri string) (bool, string, error)
GetTaskURI TODO: Implement ME
func (*Provider) GetTektonDir ¶
func (*Provider) ParsePayload ¶
func (*Provider) SetLogger ¶
func (v *Provider) SetLogger(logger *zap.SugaredLogger)
Click to show internal directories.
Click to hide internal directories.