objects

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package objects provides the customizations for the object upload middleware

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingParent = fmt.Errorf("parent id or type is missing")

ErrMissingParent is returned when the parent id or type is missing for file uploads

View Source
var MimeTypeValidator objects.ValidationFunc = func(f objects.File) error {
	if mimes, ok := validMimeTypes[f.FieldName]; ok {
		return objects.MimeTypeValidator(mimes...)(f)
	}

	return objects.MimeTypeValidator(sharedMimeTypes...)(f)
}

MimeTypeValidator returns a validation function for the given key

Functions

func AddFilePermissions added in v0.3.1

func AddFilePermissions(ctx context.Context) error

AddFilePermissions adds file permissions to the object store

func Upload

func Upload(ctx context.Context, u *objects.Objects, files []objects.FileUpload) ([]objects.File, error)

Upload handles the file Upload process per key in the multipart form and returns the uploaded files in addition to uploading the files to the storage, it also creates the file in the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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