subtitlepath

package
v0.1.151 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: GPL-2.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package subtitlepath owns the subtitle-scoped file deletion gate: the delete capability check from the subtitle-extension authority (internal/subtitleext) layered in front of the generic media-root containment delete (config.RemoveUnderRoot). Generic config containment stays generic; subtitle policy lives here.

Callers are exactly the filehandlers delete paths (single, bulk, orphan-handle). Reconciliation performs no disk deletes today (it deletes DB rows only), so there is no third caller to hunt for.

Index

Constants

This section is empty.

Variables

View Source
var ErrSubtitleExtensionNotAllowed = errors.New("extension does not carry the subtitle delete capability")

ErrSubtitleExtensionNotAllowed is returned when a deletion target's extension does not carry the delete capability in the subtitle-extension authority. Handlers map it to 409 subtitle_extension_not_allowed: a server-derived extension conflict is stored-state disagreement, not caller authorization, and the refusal is loud (WARN log at the handler), never a silent skip.

Functions

func RemoveUnderRoot

func RemoveUnderRoot(ctx context.Context, remover Remover, path string) error

RemoveUnderRoot deletes path through the subtitle delete gate: the extension must carry the delete capability in the subtitle-extension authority, then deletion delegates to the generic media-root containment delete unchanged.

Types

type Remover

type Remover interface {
	RemoveUnderRoot(ctx context.Context, path string) error
}

Remover is the containment-delete seam this gate delegates to; satisfied by api.ConfigProvider (config.RemoveUnderRoot's os.Root containment).

Jump to

Keyboard shortcuts

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