gitea

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 (v *Provider) CreateStatus(_ context.Context, _ versioned.Interface, event *info.Event, pacOpts *info.PacOpts,
	statusOpts provider.StatusOpts,
) error

func (*Provider) CreateToken added in v0.19.0

func (v *Provider) CreateToken(_ context.Context, _ []string, _ *params.Run, _ *info.Event) (string, error)

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 (v *Provider) GetCommitInfo(_ context.Context, runevent *info.Event) error

func (*Provider) GetConfig

func (v *Provider) GetConfig() *info.ProviderConfig

func (*Provider) GetFileInsideRepo

func (v *Provider) GetFileInsideRepo(_ context.Context, runevent *info.Event, path, target string) (string, error)

func (*Provider) GetFiles

func (v *Provider) GetFiles(_ context.Context, _ *info.Event) ([]string, error)

func (*Provider) GetStringPullRequestComment

func (v *Provider) GetStringPullRequestComment(_ 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(_ context.Context, _ *params.Run, _ *info.Event, _ string) (bool, string, error)

GetTaskURI TODO: Implement ME

func (*Provider) GetTektonDir

func (v *Provider) GetTektonDir(_ context.Context, event *info.Event, path, provenance string) (string, error)

func (*Provider) IsAllowed

func (v *Provider) IsAllowed(ctx context.Context, event *info.Event) (bool, error)

func (*Provider) ParsePayload

func (v *Provider) ParsePayload(_ context.Context, _ *params.Run, request *http.Request,
	payload string,
) (*info.Event, error)

func (*Provider) SetClient

func (v *Provider) SetClient(_ context.Context, _ *params.Run, runevent *info.Event) error

func (*Provider) SetLogger

func (v *Provider) SetLogger(logger *zap.SugaredLogger)

func (*Provider) Validate

func (v *Provider) Validate(_ context.Context, _ *params.Run, _ *info.Event) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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