file

package module
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 19 Imported by: 0

README

Para manejo de archivos en go via http u solicitado desde otro paquete

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveType

func ArchiveType(File *[]byte) string

func CloneDirectory

func CloneDirectory(origin, destiny string)

func CreateFolderIfNotExist

func CreateFolderIfNotExist(folderPath string) error

func DeleteIfFolderSizeExceeds

func DeleteIfFolderSizeExceeds(folderPath string, maxSizeMB int64) error

Types

type File

type File struct {
	*objectdb.Connection
	// contains filtered or unexported fields
}

func New

func New(rootFolder, extensions string, max_files, max_kb_size int64) *File

root_folder ej: "./app_files", "./static_files" extensions: ej: ".jpg, .png, .jpeg" max_files ej: 1,4 6.. max_kb_size ej: 100, 400

func (File) AttachJsFunctions

func (File) AttachJsFunctions() string

func (File) Create added in v0.0.2

func (f File) Create(w http.ResponseWriter, r *http.Request)

Create upload files http handler

func (File) Delete added in v0.0.2

func (f File) Delete(w http.ResponseWriter, r *http.Request)

func (File) DeleteFilesFromHDDandDB

func (f File) DeleteFilesFromHDDandDB(data_with_id_file ...map[string]string) (string, bool)

func (File) FieldAddEventListener

func (File) FieldAddEventListener(field_name string) string

func (File) GetAllDataFromDB

func (f File) GetAllDataFromDB(data_with_id_file ...map[string]string) ([]map[string]string, string, bool)

func (File) GetPathFileByID

func (f File) GetPathFileByID(id_file string) (string, bool)

func (File) HtmlName

func (File) HtmlName() string

func (File) InputValueChanges

func (File) InputValueChanges() string

func (File) Name

func (File) Name() string

func (File) Object

func (f File) Object() model.Object

func (File) ReadAll added in v0.0.2

func (f File) ReadAll(folder_id string, w http.ResponseWriter, r *http.Request)

func (File) ReadAllFilesID

func (f File) ReadAllFilesID(folder_id string) ([]map[string]string, string, bool)

func (File) ReadFile added in v0.0.2

func (f File) ReadFile(id_file string, w http.ResponseWriter, r *http.Request)

func (File) ReadOne added in v0.0.2

func (f File) ReadOne(id_file string, w http.ResponseWriter, r *http.Request)

func (File) SelectedTargetChanges

func (File) SelectedTargetChanges() string

func (File) ServeHTTP

func (f File) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (File) Update added in v0.0.2

func (f File) Update(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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