file

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 21 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/" MODULE_NAME FIELD_NAME ej: voucher, endoscopia, foto, article_photo LEGEND ej: Comprobante, Endoscopia, Fotos, Imágenes Articulo extensions: ej: ".jpg, .png, .jpeg" max_files ej: 1,4 6.. max_kb_size ej: 100, 400 https://developer.mozilla.org/es/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

func (File) AttachJsFunctions

func (File) AttachJsFunctions() string

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) FieldRemoveEventListener

func (File) FieldRemoveEventListener(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) ReadAllFilesID

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

func (File) SelectedTargetChanges

func (File) SelectedTargetChanges() string

func (File) ServeHTTP

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

Jump to

Keyboard shortcuts

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