accept

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ImageWildcard Any image format including JPEG, PNG, GIF, SVG, WebP, and other supported image types.
	// Allows users to select any image file from their device.
	ImageWildcard = Accept("image/*")

	// VideoWildcard Any video format including MP4, WebM, AVI, MOV, and other supported video types.
	// Enables video file uploads across different formats.
	VideoWildcard = Accept("video/*")

	// AudioWildcard Any audio format including MP3, WAV, OGG, AAC, and other supported audio types.
	// Allows audio file uploads in various formats.
	AudioWildcard = Accept("audio/*")

	// ImageJPEG JPEG image format for photos and complex graphics with lossy compression.
	// Most widely supported image format across browsers and devices.
	ImageJPEG = Accept("image/jpeg")

	// ImagePNG PNG image format for graphics and images requiring lossless compression.
	// Supports transparency and is ideal for logos and simple graphics.
	ImagePNG = Accept("image/png")

	// ImageGIF GIF image format supporting simple animations and limited color palettes.
	// Legacy format still used for simple animations and basic graphics.
	ImageGIF = Accept("image/gif")

	// ImageWebP WebP image format providing superior compression compared to JPEG and PNG.
	// Modern format with excellent compression ratios and quality.
	ImageWebP = Accept("image/webp")

	// ImageSVG Scalable Vector Graphics format for resolution-independent vector images.
	// Perfect for icons, logos, and graphics that need to scale cleanly.
	ImageSVG = Accept("image/svg+xml")

	// MimePDF PDF document format for portable documents that preserve formatting.
	// Universal document format supported across all platforms and devices.
	MimePDF = Accept("application/pdf")

	// MimeMSWord Microsoft Word document format for older .doc files (Office 97-2003).
	// Legacy Word format still commonly used for document exchange.
	MimeMSWord = Accept("application/msword")

	// MimeWordDOCX Microsoft Word document format for modern .docx files (Office 2007+).
	// Current standard Word format with better compression and features.
	MimeWordDOCX = Accept("application/vnd.openxmlformats-officedocument.wordprocessingml.document")

	// TextPlain Plain text files without any formatting or special encoding.
	// Simple text content readable by any text editor or application.
	TextPlain = Accept("text/plain")

	// TextCSV Comma-separated values format for structured data and spreadsheets.
	// Standard format for data exchange between applications.
	TextCSV = Accept("text/csv")

	// JPG JPEG file extension for photo and image files with lossy compression.
	// Common extension for camera photos and web images.
	JPG = Accept(".jpg")

	// JPEG Alternative JPEG file extension, identical format to .jpg files.
	// Less common but equivalent to .jpg extension.
	JPEG = Accept(".jpeg")

	// PNG PNG file extension for lossless image files supporting transparency.
	// Preferred for graphics, screenshots, and images requiring transparency.
	PNG = Accept(".png")

	// GIF GIF file extension for simple animations and limited-color graphics.
	// Traditional format for web animations and simple graphics.
	GIF = Accept(".gif")

	// WebP WebP file extension for modern efficient image compression format.
	// Next-generation image format with superior compression capabilities.
	WebP = Accept(".webp")

	// SVG SVG file extension for scalable vector graphics and illustrations.
	// Vector format perfect for icons and graphics requiring infinite scaling.
	SVG = Accept(".svg")

	// PDF PDF file extension for portable document format files.
	// Universal document format maintaining formatting across platforms.
	PDF = Accept(".pdf")

	// DOC Microsoft Word document extension for legacy format files.
	// Older Word format compatible with Office 97-2003 versions.
	DOC = Accept(".doc")

	// DOCX Microsoft Word document extension for modern format files.
	// Current Word standard with better compression and feature support.
	DOCX = Accept(".docx")

	// TXT Plain text file extension for simple unformatted text content.
	// Universal text format readable by any text editor or system.
	TXT = Accept(".txt")

	// CSV Comma-separated values file extension for tabular data format.
	// Standard format for spreadsheet and database data exchange.
	CSV = Accept(".csv")

	// XML XML file extension for structured markup documents.
	// Extensible markup language for data exchange and configuration.
	XML = Accept(".xml")

	// VideoMP4 MP4 video format with broad compatibility and good compression.
	// Most widely supported video format for web and mobile applications.
	VideoMP4 = Accept("video/mp4")

	// VideoWebM WebM video format optimized for web delivery and streaming.
	// Open-source format with excellent compression for web applications.
	VideoWebM = Accept("video/webm")

	// AudioMP3 MP3 audio format with universal compatibility and good compression.
	// Most widely supported audio format across all devices and platforms.
	AudioMP3 = Accept("audio/mpeg")

	// AudioWAV WAV audio format providing uncompressed high-quality audio.
	// Lossless format ideal for professional audio and high-fidelity recordings.
	AudioWAV = Accept("audio/wav")
)

Variables for Accept values

Functions

This section is empty.

Types

type Accept

type Accept []byte

Accept File type constants for input accept attribute. Predefined MIME types, extensions, and wildcards for file upload restrictions with proper guardrails and IntelliSense.

func Custom

func Custom(value string) Accept

Custom allows setting a custom Accept value for edge cases or future specifications. Use this when the predefined constants don't cover your specific use case.

Jump to

Keyboard shortcuts

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