file

package module
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 18 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)

Types

type File

type File struct {
	//table
	Id_file     string `Legend:"File Id" Input:"InputPK"`                                                   //0 id_file
	Module_name string `Legend:"Modulo" Input:"TextNumCode"`                                                //1 module_name
	Field_name  string `Legend:"Carpeta Campo" Input:"TextNum" PrincipalField:"ok"`                         //2 field_name
	Folder_id   string `Legend:"Carpeta Registro" Input:"InputPK"`                                          //3 folder_id
	Description string `Legend:"Descripción" Input:"Text" PrincipalField:"ok" SkipCompletionAllowed:"true"` //4 description
	File_path   string `Legend:"Ubicación" Input:"FilePath" SkipCompletionAllowed:"true"`                   //5 file_path

	//config
	Files string `Input:"Text" NotRequiredInDB:"true"` //nombre por defecto input html = files

	Object *model.Object
	// contains filtered or unexported fields
}

func New

func New(m *model.Module, db model.DataBaseAdapter, id model.IdHandler, conf ...string) (*File, error)

conf: field_name:voucher,user_photo,boleta... default file filetype:video, pdf, document. default imagen root_folder:static_files default "app_files" max_files:1, 4, 6.. default 6 max_kb_size:100, 400 default 50

func (File) CreateFile added in v0.0.20

func (f File) CreateFile(u *model.User, r *http.Request, params map[string]string) ([]map[string]string, error)

CreateFile upload files http handler

func (File) Delete added in v0.0.2

func (f File) Delete(u *model.User, params ...map[string]string) ([]map[string]string, error)

func (File) FieldAddEventListener

func (File) FieldAddEventListener(field_name string) string

func (File) FilePath added in v0.0.20

func (f File) FilePath(u *model.User, params map[string]string) (string, error)

func (File) HtmlName

func (File) HtmlName() string

func (File) InputValueChanges

func (File) InputValueChanges() string

func (File) MaximumFileSize added in v0.0.20

func (f File) MaximumFileSize() int64

func (File) Read added in v0.0.20

func (f File) Read(u *model.User, params ...map[string]string) ([]map[string]string, error)

func (File) SelectedTargetChanges

func (File) SelectedTargetChanges() string

func (File) Update added in v0.0.2

func (f File) Update(u *model.User, data ...map[string]string) ([]map[string]string, error)

Jump to

Keyboard shortcuts

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