uploadloader

package
v1.6.17 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*UploadLoader)

Option configures UploadLoader

func WithAccept

func WithAccept(accept string) Option

WithAccept sets accepted Content-Type for uploads

func WithFormFieldName

func WithFormFieldName(fieldName string) Option

WithFormFieldName sets the form field name for multipart uploads

func WithMaxAllowedSize

func WithMaxAllowedSize(size int) Option

WithMaxAllowedSize sets maximum allowed size for uploaded images

type UploadLoader

type UploadLoader struct {
	// MaxAllowedSize maximum bytes allowed for uploaded image
	MaxAllowedSize int

	// Accept set accepted Content-Type for uploads
	Accept string

	// FormFieldName the form field name to extract file from multipart uploads
	FormFieldName string
	// contains filtered or unexported fields
}

UploadLoader handles POST request uploads and implements imagor.Loader interface

func New

func New(options ...Option) *UploadLoader

New creates UploadLoader

func (*UploadLoader) Get

func (u *UploadLoader) Get(r *http.Request, key string) (*imagor.Blob, error)

Get implements imagor.Loader interface for POST uploads

Jump to

Keyboard shortcuts

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