webhook

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitlabRetreiver

type GitlabRetreiver interface {
	// GetPipelineURL return the url of this pipeline depending on the instance and project path
	GetPipelineURL(pathWithNamespace string, pipelineID int) string
	GetJobURL(pathWithNamespace string, jobID int) string
	// GetUserURL return the url of this GitLab user depending on domain3 instance (e.g. https://gitlab.com/username)
	GetUserURL(username string) string
	// GetUsernameById return a username by GitLab id
	GetUsernameByID(id int) string
	// ParseGitlabUsernamesFromText from a text return an array of username
	ParseGitlabUsernamesFromText(text string) []string
	// GetSubscribedChannelsForProject returns all subscriptions for given project.
	GetSubscribedChannelsForProject(ctx context.Context, namespace, project string, isPublicVisibility bool) []*subscription.Subscription
}

GitlabRetreiver return infos of current GitLab instance

type HandleWebhook

type HandleWebhook struct {
	Message    string
	From       string
	ToUsers    []string
	ToChannels []string
}

type Webhook

type Webhook interface {
	HandleIssue(ctx context.Context, event *gitlab.IssueEvent) ([]*HandleWebhook, error)
	HandleMergeRequest(ctx context.Context, event *gitlab.MergeEvent) ([]*HandleWebhook, error)
	HandleIssueComment(ctx context.Context, event *gitlab.IssueCommentEvent) ([]*HandleWebhook, error)
	HandleMergeRequestComment(ctx context.Context, event *gitlab.MergeCommentEvent) ([]*HandleWebhook, error)
	HandlePipeline(ctx context.Context, event *gitlab.PipelineEvent) ([]*HandleWebhook, error)
	HandleTag(ctx context.Context, event *gitlab.TagEvent) ([]*HandleWebhook, error)
	HandlePush(ctx context.Context, event *gitlab.PushEvent) ([]*HandleWebhook, error)
	HandleJobs(ctx context.Context, event *gitlab.JobEvent) ([]*HandleWebhook, error)
}

func NewWebhook

func NewWebhook(g GitlabRetreiver) Webhook

Jump to

Keyboard shortcuts

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