helpers

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: GPL-3.0 Imports: 28 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanCSVFile

func CleanCSVFile(filePath string) error

func CleanupSymbol

func CleanupSymbol(symbol string) string

func ExtractYearFromText

func ExtractYearFromText(text string) string

func FormatCNPJ

func FormatCNPJ(cnpjNumbers string) string

FormatCNPJ -

func FormatCurrencyDate

func FormatCurrencyDate(format string) string

func FormatDate

func FormatDate(date *time.Time, format string) string

func FormatDecimalWithDots

func FormatDecimalWithDots(n decimal.Decimal) string

func Init

func Init()

func ParseUrlQueryOrder

func ParseUrlQueryOrder(order, sort, sortDirection string) (string, bool, bool)

func RandStringBytes

func RandStringBytes(n int) string

func RewriteURL

func RewriteURL(newPath string, c echo.Context) error

func SearchForString

func SearchForString(str string, substr string) (int, int)

SearchForString -

func SliceContains

func SliceContains(s []string, str string) bool

func SliceRemove

func SliceRemove(s []string, r string) ([]string, bool)

TODO! test this method result ..

func StringIsInText

func StringIsInText(s, substr string) (bool, int, int)

StringIsInText -

func StripTags

func StripTags(str string) string

StripTags - Remove tags from html text

func StripTagsAndTruncate

func StripTagsAndTruncate(str string, length int, omission string) string

StripTagsAndTruncate - Remove all tags from string and then truncate if need with omission

func Truncate

func Truncate(textParam interface{}, length int, ellipsis string) (template.HTML, error)

Truncate truncates a given string to the specified length.

func TruncateString

func TruncateString(str string, length int, omission string) string

TruncateString - Truncate one string with with x words

func UnmaskCNPJ

func UnmaskCNPJ(CNPJ string) string

func Unzip

func Unzip(src string, dest string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

Types

type CustomValidator

type CustomValidator struct {
	Validator *validator.Validate
}

CutstomValidator :

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

Validate : Validate Data

type FakeResponseWriter

type FakeResponseWriter struct {
}

func (*FakeResponseWriter) Header

func (r *FakeResponseWriter) Header() http.Header

func (*FakeResponseWriter) Write

func (r *FakeResponseWriter) Write([]byte) (int, error)

func (*FakeResponseWriter) WriteHeader

func (r *FakeResponseWriter) WriteHeader(statusCode int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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