Help us shape the future of Go! Take the 2026 Go Developer Survey

hooks

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 17 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type FileHook

type FileHook struct {
	Directory string
}

func (FileHook) InvokeHook

func (h FileHook) InvokeHook(typ HookType, info handler.HookEvent, captureOutput bool) ([]byte, int, error)

func (FileHook) Setup

func (_ FileHook) Setup() error

type GrpcHook added in v1.1.0

type GrpcHook struct {
	Endpoint   string
	MaxRetries int
	Backoff    int
	Client     pb.HookServiceClient
}

func (*GrpcHook) InvokeHook added in v1.1.0

func (g *GrpcHook) InvokeHook(typ HookType, info handler.HookEvent, captureOutput bool) ([]byte, int, error)

func (*GrpcHook) Setup added in v1.1.0

func (g *GrpcHook) Setup() error

type HookError

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

func NewHookError

func NewHookError(err error, statusCode int, body []byte) HookError

func (HookError) Body

func (herr HookError) Body() []byte

func (HookError) Error

func (herr HookError) Error() string

func (HookError) StatusCode

func (herr HookError) StatusCode() int

type HookHandler

type HookHandler interface {
	Setup() error
	InvokeHook(typ HookType, info handler.HookEvent, captureOutput bool) ([]byte, int, error)
}

type HookType

type HookType string
const (
	HookPostFinish    HookType = "post-finish"
	HookPostTerminate HookType = "post-terminate"
	HookPostReceive   HookType = "post-receive"
	HookPostCreate    HookType = "post-create"
	HookPreCreate     HookType = "pre-create"
	HookPreFinish     HookType = "pre-finish"
)

type HttpHook

type HttpHook struct {
	Endpoint       string
	MaxRetries     int
	Backoff        int
	ForwardHeaders []string
}

func (HttpHook) InvokeHook

func (h HttpHook) InvokeHook(typ HookType, info handler.HookEvent, captureOutput bool) ([]byte, int, error)

func (HttpHook) Setup

func (_ HttpHook) Setup() error

type PluginHook

type PluginHook struct {
	Path string
	// contains filtered or unexported fields
}

func (PluginHook) InvokeHook

func (h PluginHook) InvokeHook(typ HookType, info handler.HookEvent, captureOutput bool) ([]byte, int, error)

func (*PluginHook) Setup

func (h *PluginHook) Setup() error

type PluginHookHandler

type PluginHookHandler interface {
	PreCreate(info handler.HookEvent) error
	PostCreate(info handler.HookEvent) error
	PostReceive(info handler.HookEvent) error
	PostFinish(info handler.HookEvent) error
	PostTerminate(info handler.HookEvent) error
	PreFinish(info handler.HookEvent) error
}

Jump to

Keyboard shortcuts

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