fileserver

package module
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 19 Imported by: 3

README

FileServer

Documentation

Index

Constants

View Source
const DeleteEmptyFolderResponse = "directorio con archivos. no fue eliminado"

Variables

This section is empty.

Functions

func AddFileApi added in v0.0.21

func AddFileApi(h *model.MainHandler) (fs *fileServer, err string)

func AddStringContendFromDirAndExtension added in v0.0.27

func AddStringContendFromDirAndExtension(dir, ext string, out *string) (err string)

ej: dir/files, .svg

func AddStringContentFromFile added in v0.0.27

func AddStringContentFromFile(file_path string, out *string) (err string)

func ArchiveType

func ArchiveType(File *[]byte) string

func CloneDirectory added in v0.0.2

func CloneDirectory(origin, destiny string) (err string)

func CopyFile added in v0.0.27

func CopyFile(src string, dest string) (err string)

func CreateFolderIfNotExist added in v0.0.27

func CreateFolderIfNotExist(folder_path string) (err string)

func DeleteEmptyFolder added in v0.0.27

func DeleteEmptyFolder(folder_path string) (err string)

func DeleteFilesByExtension added in v0.0.27

func DeleteFilesByExtension(dir string, exts []string) (err string)

ej: gotools.DeleteFilesByExtension(main_folder\files, []string{".js", ".css", ".wasm"})

func DeleteIfFolderSizeExceeds added in v0.0.27

func DeleteIfFolderSizeExceeds(folder_path string, maxSizeMB int64) (err string)

func FileCheck added in v0.0.27

func FileCheck(dir string, files_names ...string) (out []fs.DirEntry, err string)

func FileGet added in v0.0.27

func FileGet(file string, buffer_out *bytes.Buffer) (err string)

func FileWrite added in v0.0.27

func FileWrite(file_name string, data *bytes.Buffer) (err string)

file_name ej: "theme/index.html"

func FindFile added in v0.0.27

func FindFile(dir, file_name string) (content, err string)

func FindFilesWithNonZeroSize added in v0.0.27

func FindFilesWithNonZeroSize(dir string, filenames []string) (err string)

func FindFirstFileWithExtension added in v0.0.27

func FindFirstFileWithExtension(dir, extension string) (content, err string)

func GetFile added in v0.0.22

func GetFile(path string) []byte

func GetNamesFromDirectoryExtensionAndPattern added in v0.0.27

func GetNamesFromDirectoryExtensionAndPattern(dir, ext, pattern string) (out []string, err string)

ej files, .go, `Input: input\.(\w+)\(\)`

func GetNamesFromFileAndPattern added in v0.0.27

func GetNamesFromFileAndPattern(file_path, pattern string) (out []string, err string)

ej files/file.txt, `Input: input\.(\w+)\(\)`

func MultiPartFileForm added in v0.0.9

func MultiPartFileForm(path_files string, x_files any, form map[string]string) (body []byte, boundary string, err string)

path_files ej: ./test_files "files" ej: "files", "endoscopia", "voucher", "foto_mascota", "foto_usuario" files_name ej: "gatito.jpg, perro.png"

func ReadFiles added in v0.0.27

func ReadFiles(dir, ext string, buffer_out *bytes.Buffer) (err string)

dir ej: modules/mymodule ext ej: .js, .html, .css

Types

This section is empty.

Jump to

Keyboard shortcuts

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