filehandler

package module
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 6 Imported by: 2 modules, 2 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File added in v0.0.4

type File struct {
	Id_file     string `Legend:"File Id" Input:"InputPK"`
	Module_name string `Legend:"Modulo" Input:"TextNumCode"`
	Field_name  string `Legend:"Carpeta Campo" Input:"TextNum" PrincipalField:"ok"`
	Object_id   string `Legend:"Carpeta Id Archivos" Input:"InputPK"`
	File_area   string `Legend:"Area archivo" Input:"Text" PrincipalField:"ok" SkipCompletionAllowed:"true"`
	Extension   string `Legend:"Tipo Archivo" Input:"Text" SkipCompletionAllowed:"true"`
	Description string `Legend:"Descripción" Input:"Text" PrincipalField:"ok" SkipCompletionAllowed:"true"`
}

type FileHandler

type FileHandler struct {
	*model.Object

	model.Logger
	model.DataBaseAdapter
	model.FileDiskRW
	// contains filtered or unexported fields
}

func Add

func Add(h *model.MainHandler) (out *FileHandler, err string)

optional root_folder default: "app_files"

func (FileHandler) AddBootFiles added in v0.0.4

func (f FileHandler) AddBootFiles(u *model.User, o *model.Object, from_data []map[string]string, out *[]model.Response) (err string)

func (*FileHandler) AddNewFileSetting

func (f *FileHandler) AddNewFileSetting(o *model.Object, fs *FileSetting)

func (FileHandler) BuildFilePath

func (h FileHandler) BuildFilePath(data map[string]string) (file_path, area string)

func (FileHandler) Delete added in v0.0.4

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

func (FileHandler) DeleteFileFromHDDandDB added in v0.0.35

func (f FileHandler) DeleteFileFromHDDandDB(recover_data ...map[string]string) (err string)

func (FileHandler) FileRegisterInDB added in v0.0.4

func (f FileHandler) FileRegisterInDB(t *File) (out map[string]string, err string)

func (FileHandler) GetFileSettings

func (f FileHandler) GetFileSettings(object_name string) (s *FileSetting, err string)

func (FileHandler) Read added in v0.0.4

func (f FileHandler) Read(u *model.User, params ...map[string]string) (result []map[string]string, err string)

func (FileHandler) ReadByID added in v0.0.4

func (f FileHandler) ReadByID(id string) (result []map[string]string, err string)

func (FileHandler) Update added in v0.0.4

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

func (FileHandler) UploadFolderPath

func (h FileHandler) UploadFolderPath(f *File) string

type FileSetting

type FileSetting struct {
	AllowedExtensions   []string // exenciones permitidas ej: ".jpg, .png, .jpeg"
	MaximumFilesAllowed int64    // numero máximo de archivos permitidos ej: 4,100 etc
	MaximumKbSize       int64    // tamaño máximo individual kb ej: 100

	ImagenWidth  string // ej: 800
	ImagenHeight string // ej: 600

	//field
	FieldNameWithObjectID string //ej: id_medicalhistory
	ModuleName            string // ej: user,patients
	DescriptiveName       string //ej: endoscopia, pictures documents
	Legend                string //ej: Imágenes,Boletas etc
	DefaultEnableInput    bool   // si se necesita habilitado resetear el campo por defecto falso
	// contains filtered or unexported fields
}

func (FileSetting) GetMaximumFileSize added in v0.0.4

func (f FileSetting) GetMaximumFileSize() int64

func (*FileSetting) SetMaximumFileSize added in v0.0.4

func (f *FileSetting) SetMaximumFileSize()

type FileSettingAdapter added in v0.0.4

type FileSettingAdapter interface {
	GetFileSettings(object_name string) (*FileSetting, error)
}

Jump to

Keyboard shortcuts

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