filex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package filex provides shared file and stream utilities for size-limited reads and DoS protection limits across CONGA packages.

Index

Constants

This section is empty.

Variables

View Source
var ErrFileSizeLimitExceeded = errors.New("file size limit exceeded")

ErrFileSizeLimitExceeded indicates a file or stream exceeded the maximum allowed size limit.

Functions

func ReadLimited

func ReadLimited(path string, maxBytes int64) ([]byte, error)

ReadLimited reads the file at path up to maxBytes, returning ErrFileSizeLimitExceeded if exceeded.

func ReadLimitedReader

func ReadLimitedReader(r io.Reader, maxBytes int64) ([]byte, error)

ReadLimitedReader reads from r up to maxBytes, returning ErrFileSizeLimitExceeded if exceeded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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