utils

package
v0.0.0-...-9140053 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionURLBuilder

func ConnectionURLBuilder(n string) (string, error)

ConnectionURLBuilder func for building URL connection.

func DownloadFile

func DownloadFile(downloadURL string) ([]byte, error)

func ExtractJSONFromZip

func ExtractJSONFromZip(zipData []byte, filename string) ([]byte, error)

func ExtractValidStrings

func ExtractValidStrings(input string) []string

func GetenvBool

func GetenvBool(key string) (bool, error)

func GetenvInt

func GetenvInt(key string) (int, error)

func GetenvStr

func GetenvStr(key string) (string, error)

func LoadJSON

func LoadJSON[T any](jsonData []byte) ([]T, error)

func NewValidator

func NewValidator() *validator.Validate

NewValidator func for create a new validator for model fields.

func ObtenerHora

func ObtenerHora(format string) string

func StartServer

func StartServer(a *fiber.App)

StartServer func for starting a simple server.

func StartServerWithGracefulShutdown

func StartServerWithGracefulShutdown(a *fiber.App)

StartServerWithGracefulShutdown function for starting server with a graceful shutdown.

func ValidatorErrors

func ValidatorErrors(err error) map[string]string

ValidatorErrors func for show validation errors for each invalid fields.

Types

type CSVValidator

type CSVValidator struct {
	RequiredColumns []string
}

establecemos las columnas requeridas

func NewCSVValidator

func NewCSVValidator(columns []string) *CSVValidator

retornamos el validador css con las columnas instanciadas

func (*CSVValidator) Validate

func (v *CSVValidator) Validate(file multipart.File) error

metodo validate

Jump to

Keyboard shortcuts

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