objects

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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")
View Source
var MimeTypeValidator objects.ValidationFunc = func(f objects.File) error {
	if mimes, ok := validMimeTypes[f.FieldName]; ok {
		return objects.MimeTypeValidator(mimes...)(f)
	}

	return nil
}

MimeTypeValidator returns a validation function for the given key

Functions

func AddFilePermissions added in v0.3.1

func AddFilePermissions(ctx context.Context) error

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