hooks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookPreDownload  = types.PreDownloadHook
	HookPostDownload = types.PostDownloadHook
	HookPreChunk     = types.CustomHook
	HookPostChunk    = types.CustomHook
	HookOnError      = types.ErrorHook
	HookOnRetry      = types.CustomHook
	HookOnProgress   = types.CustomHook
	HookOnComplete   = types.PostDownloadHook
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HookContext

type HookContext struct {
	Type     HookType
	Data     interface{}
	Metadata map[string]interface{}
	Cancel   context.CancelFunc
}

HookContext provides context and data for hook execution

type HookExecutor

type HookExecutor interface {
	Execute(ctx context.Context, hook *HookContext) error
	Register(hookType HookType, handler HookHandler) error
}

HookExecutor interface for executing and registering hooks

type HookHandler

type HookHandler func(ctx context.Context, hookCtx *HookContext) error

HookHandler represents a function that handles a specific hook

type HookType

type HookType = types.HookType

HookType represents different types of hooks in the system

Jump to

Keyboard shortcuts

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