webhook_handler

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleWebhook

func HandleWebhook(ctx *context.Context, wh *WebhookHandlerImpl) ([]*common.WorkflowsBatch, error)

func IsFileExists

func IsFileExists(ctx *context.Context, wh *WebhookHandlerImpl, path string, file string) bool

Types

type Trigger

type Trigger struct {
	Events    *[]string `yaml:"events"`
	Branches  *[]string `yaml:"branches"`
	OnStart   *[]string `yaml:"onStart"`
	Templates *[]string `yaml:"templates"`
	OnExit    *[]string `yaml:"onExit"`
	Config    string    `yaml:"config" default:"default"`
}

type WebhookHandler

type WebhookHandler interface {
	RegisterTriggers(ctx *context.Context) error
	PrepareBatchForMatchingTriggers(ctx *context.Context) ([]*common.WorkflowsBatch, error)
}

type WebhookHandlerImpl

type WebhookHandlerImpl struct {
	Triggers *[]Trigger
	Payload  *git_provider.WebhookPayload
	// contains filtered or unexported fields
}

func NewWebhookHandler

func NewWebhookHandler(cfg *conf.GlobalConfig, clients *clients.Clients, payload *git_provider.WebhookPayload) (*WebhookHandlerImpl, error)

func (*WebhookHandlerImpl) PrepareBatchForMatchingTriggers

func (wh *WebhookHandlerImpl) PrepareBatchForMatchingTriggers(ctx *context.Context) ([]*common.WorkflowsBatch, error)

func (*WebhookHandlerImpl) RegisterTriggers

func (wh *WebhookHandlerImpl) RegisterTriggers(ctx *context.Context) error

Jump to

Keyboard shortcuts

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