hooks

package
v0.0.0-...-1fe2c51 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 12 Imported by: 0

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 tusd.FileInfo, captureOutput bool) ([]byte, int, error)

func (FileHook) Setup

func (_ FileHook) 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 tusd.FileInfo, 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"
)

type HttpHook

type HttpHook struct {
	Endpoint   string
	MaxRetries int
	Backoff    int
}

func (HttpHook) InvokeHook

func (h HttpHook) InvokeHook(typ HookType, info tusd.FileInfo, 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 tusd.FileInfo, captureOutput bool) ([]byte, int, error)

func (*PluginHook) Setup

func (h *PluginHook) Setup() error

type PluginHookHandler

type PluginHookHandler interface {
	PreCreate(info tusd.FileInfo) error
	PostCreate(info tusd.FileInfo) error
	PostReceive(info tusd.FileInfo) error
	PostFinish(info tusd.FileInfo) error
	PostTerminate(info tusd.FileInfo) error
}

Jump to

Keyboard shortcuts

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