helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: GPL-3.0 Imports: 30 Imported by: 5

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 DecimalToPercent

func DecimalToPercent(v decimal.Decimal) string

DecimalToPercent -

func DecimalToPrice

func DecimalToPrice(v decimal.Decimal) string

DecimalToPrice - Format a decimal number to string in market format Ex: 2000.55 to 2.000,55

func DecimalToPriceNoSign

func DecimalToPriceNoSign(v decimal.Decimal) string

DecimalToPriceNoSign -

func ExtractYearFromText

func ExtractYearFromText(text string) string

func FormatCNPJ

func FormatCNPJ(cnpjNumbers string) string

FormatCNPJ -

func FormatCurrencyDate added in v0.2.1

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 NewFromString

func NewFromString(v string) decimal.Decimal

Convert string to decimal without errors

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 RoundCurrency

func RoundCurrency(n float64) float64

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 added in v0.0.11

type FakeResponseWriter struct {
}

func (*FakeResponseWriter) Header added in v0.0.11

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

func (*FakeResponseWriter) Write added in v0.0.11

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

func (*FakeResponseWriter) WriteHeader added in v0.0.11

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