support

package
v0.0.0-...-7da98de Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 30 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToInt

func AnyToInt(s interface{}) int

func AnyToInt64

func AnyToInt64(s interface{}) int64

func DateToTheEndOfDay

func DateToTheEndOfDay(timeArg time.Time) time.Time

func FilterNumber

func FilterNumber(text string) string

func FormatMoney

func FormatMoney(number float64) string

func GenerateCode

func GenerateCode(min int, max int) int

func GenereteApiToken

func GenereteApiToken(id int64, uuid string, password string, expirationDate time.Time) (string, error)

func GenereteToken

func GenereteToken(password string, expirationDate time.Time) (string, error)

func IsEmpty

func IsEmpty(text string) bool

func IsSameHash

func IsSameHash(hash string, text string) bool

func IsSameHashHex

func IsSameHashHex(hash string, text string) bool

func IsSameHashSha256

func IsSameHashSha256(hash string, text string) bool

func IsSameHashSha256Hex

func IsSameHashSha256Hex(hash string, text string) bool

func MakeRange

func MakeRange(min, max int) []int

func NormalizeSemicolon

func NormalizeSemicolon(key string, ctx *context.Context)

troca , por .(ponto), posi alterei o js maskMoney pra #.###,##

func NumberMask

func NumberMask(text string, maskApply string) string

func NumberMaskReverse

func NumberMaskReverse(text string, maskApply string) string

func ParseUrlValues

func ParseUrlValues[T any](data url.Values, modelOpts ...*T) *optional.Optional[*T]

func RemoveAllSemicolon

func RemoveAllSemicolon(key string, ctx *context.Context)

func Reverse

func Reverse(s string) string

func Round

func Round(num float64) int

func SetFormDefault

func SetFormDefault(key string, defVal string, ctx *context.Context)

func SliceCopyAndSortOfStrings

func SliceCopyAndSortOfStrings(arr []string) []string

func SliceIndex

func SliceIndex(limit int, predicate func(i int) bool) int

func StrToInt

func StrToInt(s string) int

func StrToInt64

func StrToInt64(s string) int64

func TextToSha1

func TextToSha1(text string) string

func TextToSha1Hex

func TextToSha1Hex(text string) string

func TextToSha256

func TextToSha256(text string) string

func TextToSha256Hex

func TextToSha256Hex(text string) string

func ToFixed

func ToFixed(num float64, precision int) float64

func Underscore

func Underscore(s string) string

Types

type Character

type Character struct {
	Transformer transform.Transformer
}

func NewCharacter

func NewCharacter() *Character

func (*Character) Init

func (this *Character) Init()

func (*Character) Transform

func (this *Character) Transform(text string) string

type DocumentConverter

type DocumentConverter struct {
}

func (*DocumentConverter) GetExtension

func (this *DocumentConverter) GetExtension(documentName string) (string, error)

func (*DocumentConverter) SaveBase64Gzip

func (this *DocumentConverter) SaveBase64Gzip(content string, path string) error

type FormJsonConfig

type FormJsonConfig struct {
	FieldName  string
	Parser     func(val string) interface{}
	FormatType FormatType
	Layout     string
}

func NewFormJsonConfig

func NewFormJsonConfig(fieldName string, formatType FormatType) *FormJsonConfig

func (*FormJsonConfig) List

func (this *FormJsonConfig) List() []*FormJsonConfig

func (*FormJsonConfig) SetLayout

func (this *FormJsonConfig) SetLayout(layout string) *FormJsonConfig

func (*FormJsonConfig) SetParser

func (this *FormJsonConfig) SetParser(parser func(val string) interface{}) *FormJsonConfig

type FormatType

type FormatType int64
const (
	FormatTypeFloat FormatType = iota + 1
	FormatTypeInt
	FormatTypeDate
	FormatTypeBool
)

type JsonParser

type JsonParser struct {
	DefaultLocation *time.Location
}

func NewJsonParser

func NewJsonParser() *JsonParser

func (*JsonParser) FormJsonToModel

func (this *JsonParser) FormJsonToModel(ctx *context.Context, model interface{}) error

func (*JsonParser) FormJsonToModelWithCOnfigs

func (this *JsonParser) FormJsonToModelWithCOnfigs(ctx *context.Context, model interface{}, configs []*FormJsonConfig) error

func (*JsonParser) FormToJson

func (this *JsonParser) FormToJson(ctx *context.Context) map[string]interface{}

func (*JsonParser) FormToJsonWithConfigs

func (this *JsonParser) FormToJsonWithConfigs(ctx *context.Context, configs []*FormJsonConfig) map[string]interface{}

func (*JsonParser) FormToJsonWithFieldsConfigs

func (this *JsonParser) FormToJsonWithFieldsConfigs(ctx *context.Context, configs map[string]string) map[string]interface{}

func (*JsonParser) FormToMap

func (this *JsonParser) FormToMap(ctx *context.Context, configs ...[]*FormJsonConfig) map[string]interface{}

func (*JsonParser) FormToModel

func (this *JsonParser) FormToModel(ctx *context.Context, model interface{}) error

func (*JsonParser) FormToModelWithFieldsConfigs

func (this *JsonParser) FormToModelWithFieldsConfigs(ctx *context.Context, model interface{}, configs map[string]string) error

func (*JsonParser) GetArrayFromJson

func (this *JsonParser) GetArrayFromJson(json map[string]interface{}, key string) []interface{}

func (*JsonParser) GetJsonArray

func (this *JsonParser) GetJsonArray(json map[string]interface{}, key string) []map[string]interface{}

func (*JsonParser) GetJsonBool

func (this *JsonParser) GetJsonBool(json map[string]interface{}, key string) bool

func (*JsonParser) GetJsonDate

func (this *JsonParser) GetJsonDate(json map[string]interface{}, key string, layout string) time.Time

func (*JsonParser) GetJsonFloat32

func (this *JsonParser) GetJsonFloat32(json map[string]interface{}, key string) float32

func (*JsonParser) GetJsonFloat64

func (this *JsonParser) GetJsonFloat64(json map[string]interface{}, key string) float64

func (*JsonParser) GetJsonInt

func (this *JsonParser) GetJsonInt(json map[string]interface{}, key string) int

func (*JsonParser) GetJsonInt64

func (this *JsonParser) GetJsonInt64(json map[string]interface{}, key string) int64

func (*JsonParser) GetJsonObject

func (this *JsonParser) GetJsonObject(json map[string]interface{}, key string) map[string]interface{}

func (*JsonParser) GetJsonSimpleArray

func (this *JsonParser) GetJsonSimpleArray(json map[string]interface{}, key string) []interface{}

func (*JsonParser) GetJsonString

func (this *JsonParser) GetJsonString(json map[string]interface{}, key string) string

func (*JsonParser) HasJsonKey

func (this *JsonParser) HasJsonKey(json map[string]interface{}, key string) bool

func (*JsonParser) JsonBytesToMap

func (this *JsonParser) JsonBytesToMap(body []byte) (map[string]interface{}, error)

func (*JsonParser) JsonInterfaceToInt64

func (this *JsonParser) JsonInterfaceToInt64(item interface{}) int64

func (*JsonParser) JsonToMap

func (this *JsonParser) JsonToMap(ctx *context.Context) (map[string]interface{}, error)

func (*JsonParser) JsonToModel

func (this *JsonParser) JsonToModel(ctx *context.Context, model interface{}) error

func (*JsonParser) MapToModel

func (this *JsonParser) MapToModel(data map[string]interface{}, model interface{}) error

func (*JsonParser) StructToModel

func (this *JsonParser) StructToModel(data interface{}, model interface{}) error

func (*JsonParser) UrlValuesToMap

func (this *JsonParser) UrlValuesToMap(data url.Values) map[string]interface{}

func (*JsonParser) UrlValuesToMapWithConfigs

func (this *JsonParser) UrlValuesToMapWithConfigs(data url.Values, configsMap map[string]string, configs []*FormJsonConfig) map[string]interface{}

type JsonResult

type JsonResult struct {
	Error   bool        `jsonp:""`
	Message string      `jsonp:""`
	Results interface{} `jsonp:""`
	Result  interface{} `jsonp:""`

	Errors map[string]string `jsonp:""`

	TotalCount int64 `jsonp:""`

	CurrentUnixTime int64 `jsonp:""`
}

Jump to

Keyboard shortcuts

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