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
Click to show internal directories.
Click to hide internal directories.