Documentation ¶
Index ¶
- func AnyToBool(s interface{}) bool
- func AnyToFloat(s interface{}) float32
- func AnyToFloat64(s interface{}) float64
- func AnyToInt(s interface{}) int
- func AnyToInt64(s interface{}) int64
- func DateToTheEndOfDay(timeArg time.Time) time.Time
- func FilterNumber(text string) string
- func FormatMoney(number float64) string
- func GenerateCode(min int, max int) int
- func GenereteApiToken(id int64, uuid string, password string, expirationDate time.Time) (string, error)
- func GenereteToken(password string, expirationDate time.Time) (string, error)
- func GetFileExt(filename string) (string, error)
- func IsEmpty(text string) bool
- func IsNil[T any](v T) bool
- func IsNotEmpty(text string) bool
- func IsNotNil[T any](v T) bool
- func IsSameHash(hash string, text string) bool
- func IsSameHashHex(hash string, text string) bool
- func IsSameHashSha256(hash string, text string) bool
- func IsSameHashSha256Hex(hash string, text string) bool
- func MakeRange(min, max int) []int
- func NormalizeSemicolon(ctx *context.Context, keys ...string)
- func NumberMask(text string, maskApply string) string
- func NumberMaskReverse(text string, maskApply string) string
- func ParseUrlValues[T any](data url.Values, modelOpts ...*T) *optional.Optional[*T]
- func RemoveAllNonAlphaNumeric(s string) string
- func RemoveAllSemicolonByKey(key string, ctx *context.Context)
- func RemoveAllSemicolonByKeys(ctx *context.Context, keys ...string)
- func Reverse(s string) string
- func Round(num float64) int
- func SetFormDefault(key string, defVal string, ctx *context.Context)
- func SetFormDefaults(ctx *context.Context, vals ...interface{})
- func SliceCopyAndSortOfStrings(arr []string) []string
- func SliceIndex(limit int, predicate func(i int) bool) int
- func StrToFloat(s string) float32
- func StrToFloat64(s string) float64
- func StrToInt(s string) int
- func StrToInt64(s string) int64
- func TextToSha1(text string) string
- func TextToSha1Hex(text string) string
- func TextToSha256(text string) string
- func TextToSha256Hex(text string) string
- func ToFixed(num float64, precision int) float64
- func ToStr[T any](s T) string
- func Underscore(s string) string
- type Character
- type DocumentConverter
- type FormJsonConfig
- type FormatType
- type JsonParser
- func (this *JsonParser) FormJsonToModel(ctx *context.Context, model interface{}) error
- func (this *JsonParser) FormJsonToModelWithCOnfigs(ctx *context.Context, model interface{}, configs []*FormJsonConfig) error
- func (this *JsonParser) FormToJson(ctx *context.Context) map[string]interface{}
- func (this *JsonParser) FormToJsonWithConfigs(ctx *context.Context, configs []*FormJsonConfig) map[string]interface{}
- func (this *JsonParser) FormToJsonWithFieldsConfigs(ctx *context.Context, configs map[string]string) map[string]interface{}
- func (this *JsonParser) FormToMap(ctx *context.Context, configs ...[]*FormJsonConfig) map[string]interface{}
- func (this *JsonParser) FormToModel(ctx *context.Context, model interface{}) error
- func (this *JsonParser) FormToModelWithFieldsConfigs(ctx *context.Context, model interface{}, configs map[string]string) error
- func (this *JsonParser) GetArrayFromJson(json map[string]interface{}, key string) []interface{}
- func (this *JsonParser) GetJsonArray(json map[string]interface{}, key string) []map[string]interface{}
- func (this *JsonParser) GetJsonBool(json map[string]interface{}, key string) bool
- func (this *JsonParser) GetJsonDate(json map[string]interface{}, key string, layout string) time.Time
- func (this *JsonParser) GetJsonFloat32(json map[string]interface{}, key string) float32
- func (this *JsonParser) GetJsonFloat64(json map[string]interface{}, key string) float64
- func (this *JsonParser) GetJsonInt(json map[string]interface{}, key string) int
- func (this *JsonParser) GetJsonInt64(json map[string]interface{}, key string) int64
- func (this *JsonParser) GetJsonObject(json map[string]interface{}, key string) map[string]interface{}
- func (this *JsonParser) GetJsonSimpleArray(json map[string]interface{}, key string) []interface{}
- func (this *JsonParser) GetJsonString(json map[string]interface{}, key string) string
- func (this *JsonParser) HasJsonKey(json map[string]interface{}, key string) bool
- func (this *JsonParser) JsonBytesToMap(body []byte) (map[string]interface{}, error)
- func (this *JsonParser) JsonInterfaceToInt64(item interface{}) int64
- func (this *JsonParser) JsonToMap(ctx *context.Context) (map[string]interface{}, error)
- func (this *JsonParser) JsonToModel(ctx *context.Context, model interface{}) error
- func (this *JsonParser) MapToModel(data map[string]interface{}, model interface{}) error
- func (this *JsonParser) StructToModel(data interface{}, model interface{}) error
- func (this *JsonParser) UrlValuesToMap(data url.Values) map[string]interface{}
- func (this *JsonParser) UrlValuesToMapWithConfigs(data url.Values, configsMap map[string]string, configs []*FormJsonConfig) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToFloat ¶
func AnyToFloat(s interface{}) float32
func AnyToFloat64 ¶
func AnyToFloat64(s interface{}) float64
func AnyToInt64 ¶
func AnyToInt64(s interface{}) int64
func FilterNumber ¶
func FormatMoney ¶
func GenerateCode ¶
func GenereteApiToken ¶
func GetFileExt ¶
func IsNotEmpty ¶
func IsSameHash ¶
func IsSameHashHex ¶
func IsSameHashSha256 ¶
func IsSameHashSha256Hex ¶
func NormalizeSemicolon ¶
troca , por .(ponto), posi alterei o js maskMoney pra #.###,##
func NumberMask ¶
func NumberMaskReverse ¶
func ParseUrlValues ¶
func RemoveAllSemicolonByKey ¶
func SetFormDefaults ¶
func StrToFloat ¶
func StrToFloat64 ¶
func StrToInt64 ¶
func TextToSha1 ¶
func TextToSha1Hex ¶
func TextToSha256 ¶
func TextToSha256Hex ¶
func Underscore ¶
Types ¶
type Character ¶
type Character struct {
Transformer transform.Transformer
}
func NewCharacter ¶
func NewCharacter() *Character
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 ¶
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 (*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 (*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 (*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{}
Click to show internal directories.
Click to hide internal directories.