Documentation
¶
Overview ¶
Package safety contains hard limits and validation helpers used by the image preprocessing pipeline. These checks intentionally fail closed: an unknown or unbounded image reference is never sent to an upstream service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyImageReference = errors.New("image reference is empty") ErrImageReferenceTooLarge = errors.New("image reference exceeds size limit") ErrUnsupportedImageReference = errors.New("image reference must be an http(s) URL or image data URI") ErrResultTooLarge = errors.New("visual result exceeds size limit") )
Functions ¶
func ValidateImageReference ¶
ValidateImageReference validates the complete external image reference and applies an optional byte limit. It is the shared validator for discovery and the final host-model callback boundary.
Types ¶
type Limits ¶
Limits are hard safety limits. A zero value means that the corresponding check is disabled; callers should normally provide explicit non-zero values.
func (Limits) ValidateImageCount ¶
func (Limits) ValidateImageReference ¶
ValidateImageReference accepts only a network URL or a data URI carrying an image. file://, javascript://, credentials and other schemes are rejected.