hooks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PluginHandler

func PluginHandler(name string) common.Handler

Types

type Handler

type Handler func(ctx context.Context, event interface{})

type HookServer

type HookServer struct {
	// contains filtered or unexported fields
}

func NewHookServer

func NewHookServer(client *gitlab.Client) *HookServer

func (*HookServer) AddRouter

func (h *HookServer) AddRouter(name string, router Router, handler common.Handler)

func (*HookServer) Handler

func (h *HookServer) Handler(ctx context.Context) http.Handler

func (*HookServer) MatchAndRoute

func (h *HookServer) MatchAndRoute(ctx context.Context, writer http.ResponseWriter, request *http.Request)

type NotFoundHandler

type NotFoundHandler struct{}

func (NotFoundHandler) Do

func (n NotFoundHandler) Do(ctx context.Context, client *gitlab.Client, event common.Event) error

type Router

type Router interface {
	Match(eventType gitlab.EventType, event interface{}) bool
}

func NewEventTypeRouter

func NewEventTypeRouter(eventTypes ...gitlab.EventType) Router

Jump to

Keyboard shortcuts

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