Documentation ¶
Index ¶
- Variables
- func AllMapKeys[T1 comparable, T2 any](m map[T1]T2) []T1
- func AllMapValues[T1 comparable, T2 any](m map[T1]T2) []T2
- func AppendMap[T any](m1 map[string]T, m2 map[string]T)
- func AppendMapNew(m1 map[string]interface{}, m2 map[string]interface{}) map[string]interface{}
- func Base64Decode(data string) ([]byte, error)
- func Base64Encode(data []byte) string
- func BeginningOfDay(t time.Time) time.Time
- func BoolToStr(val bool) string
- func BuildString(sb *strings.Builder, parts ...string)
- func ConcatSlices[T any](start []T, slices ...[]T) []T
- func ConcatStrings(parts ...string) string
- func CopyMap(m map[string]interface{}) map[string]interface{}
- func CopyMapOneLevel[T1 comparable, T2 any](m map[T1]T2) map[T1]T2
- func DateConverter(str string) reflect.Value
- func DateReflectStr(val reflect.Value) string
- func DumpJson(obj interface{}) string
- func DumpPrettyJson(obj interface{}) string
- func EachStructTag(handler StructTagHandler, tag string, obj interface{}) error
- func EndOfDay(t time.Time) time.Time
- func FileExists(path string) bool
- func FloatAlmostEqual[T Float](a, b T) bool
- func FloatToDecimalStr(f float64, comma ...bool) string
- func FloatToStr[T Float](val T) string
- func FloatToStr2[T Float](val T) string
- func FloatToStr2Comma[T Float](val T) string
- func FloatToStr2Hyphen[T Float](val T) string
- func FloatToStr2Variant[T Float](val T, comma ...bool) string
- func FloatToStr4[T Float](val T) string
- func FloatToStr4Comma[T Float](val T) string
- func FloatToStr4Hyphen[T Float](val T) string
- func FloatToStr4Variant[T Float](val T, comma ...bool) string
- func FloatToStrComma[T Float](val T) string
- func FormatCard(pan string) string
- func GenerateID() string
- func GenerateRand64() string
- func GenerateRandInt(length ...int) string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsNil[T interface{}](a T) bool
- func IsTime(obj reflect.Value) bool
- func List(vals ...interface{}) []interface{}
- func ListInterfaces[T any](in ...T) []interface{}
- func MakePath(filename string) error
- func MapToStruct(in interface{}, out interface{}, tag ...string) error
- func MaskCard(pan string, maskPrefix ...bool) string
- func MaskPhone(phone string) string
- func Min(a, b int) int
- func MoneyToDecimal[T constraints.Integer](cents T) float64
- func MoneyToDecimalStr(cents int64, comma ...bool) string
- func MoneyToInteger(dollars float64) int64
- func MoneyToIntegerUp(dollars float64) int64
- func NumToStr[T constraints.Integer](val T) string
- func ObjectTypeName(obj interface{}) string
- func OptionalArg[T any](defaultArg T, optional ...T) T
- func OptionalString(defaultVal string, optional ...string) string
- func ParseRuTime(str string) (time.Time, error)
- func ParseRuTimeShort(str string) (time.Time, error)
- func ParseTime(str string) (time.Time, error)
- func ReadTemplate(path string, name string, vals interface{}, language ...string) (string, error)
- func ReadTemplateFile(fileName string, vals interface{}) (string, error)
- func RoundMoney(value float64) float64
- func RoundMoneyDown(value float64) float64
- func RoundMoneyUp(value float64) float64
- func StrToBool(s string) (bool, error)
- func StrToFloat(s string) (float64, error)
- func StrToInt(s string) (int, error)
- func StrToInt32(s string) (int32, error)
- func StrToInt64(s string) (int64, error)
- func StrToUint32(s string) (uint32, error)
- func StrToUint64(s string) (uint64, error)
- func Substr(input string, start int, length int) string
- func TimeConverter(str string) reflect.Value
- func TimeInTimezone(tz string, inTime ...time.Time) (time.Time, error)
- func TimeRFC3339(t time.Time) string
- func TimeReflectStr(val reflect.Value) string
- func TimeToStr(t time.Time) string
- func TimeToStrRu(t time.Time) string
- func WalkDirExt(handler WalkDirExtHandler, root string, ext string) error
- type Base64StringCoding
- type Date
- func (d *Date) AsNumber() string
- func (d *Date) Day() int
- func (d *Date) IsNil() bool
- func (d *Date) MMonth() Month
- func (d *Date) MarshalJSON() ([]byte, error)
- func (d *Date) Month() int
- func (d *Date) Set(year int, month int, day int)
- func (d *Date) SetTime(t time.Time)
- func (d *Date) String() string
- func (d *Date) StringRu() string
- func (d *Date) StringRuShort() string
- func (d *Date) Time() time.Time
- func (d *Date) UnmarshalJSON(b []byte) error
- func (d *Date) Year() int
- type FileWriteReopen
- type Float
- type HexStringCoding
- type Month
- func (m *Month) AsNumber() string
- func (m *Month) AsShortNumber() string
- func (m *Month) AsShortNumberReverse() string
- func (m *Month) MarshalJSON() ([]byte, error)
- func (m *Month) Month() int
- func (m *Month) Next() Month
- func (m *Month) Prev() Month
- func (m *Month) Set(year int, month int)
- func (m *Month) SetTime(t time.Time)
- func (m *Month) String() string
- func (m *Month) Time() time.Time
- func (m *Month) UnmarshalJSON(b []byte) error
- func (m *Month) Year() int
- type MonthData
- type MonthDataBase
- type StringCoding
- type StructTagHandler
- type WalkDirExtHandler
- type WithStringCoder
- type WithStringCoderBase
Constants ¶
This section is empty.
Variables ¶
View Source
var DateNil = Date(0)
View Source
var TimeNil = time.Time{}
Functions ¶
func AllMapKeys ¶
func AllMapKeys[T1 comparable, T2 any](m map[T1]T2) []T1
func AllMapValues ¶
func AllMapValues[T1 comparable, T2 any](m map[T1]T2) []T2
func AppendMapNew ¶
func Base64Decode ¶
func Base64Encode ¶
func BuildString ¶
func ConcatSlices ¶
func ConcatSlices[T any](start []T, slices ...[]T) []T
func ConcatStrings ¶
func CopyMapOneLevel ¶
func CopyMapOneLevel[T1 comparable, T2 any](m map[T1]T2) map[T1]T2
func DateConverter ¶
func DateReflectStr ¶
func DumpPrettyJson ¶
func DumpPrettyJson(obj interface{}) string
func EachStructTag ¶
func EachStructTag(handler StructTagHandler, tag string, obj interface{}) error
func FileExists ¶
func FloatAlmostEqual ¶
func FloatToDecimalStr ¶
func FloatToStr ¶
func FloatToStr2 ¶
func FloatToStr2Comma ¶
func FloatToStr2Hyphen ¶
func FloatToStr2Variant ¶
func FloatToStr4 ¶
func FloatToStr4Comma ¶
func FloatToStr4Hyphen ¶
func FloatToStr4Variant ¶
func FloatToStrComma ¶
func FormatCard ¶
func GenerateID ¶
func GenerateID() string
func GenerateRand64 ¶
func GenerateRand64() string
func GenerateRandInt ¶
func ListInterfaces ¶
func ListInterfaces[T any](in ...T) []interface{}
func MapToStruct ¶
func MoneyToDecimal ¶
func MoneyToDecimal[T constraints.Integer](cents T) float64
func MoneyToDecimalStr ¶
func MoneyToInteger ¶
func MoneyToIntegerUp ¶
func NumToStr ¶
func NumToStr[T constraints.Integer](val T) string
func ObjectTypeName ¶
func ObjectTypeName(obj interface{}) string
func OptionalArg ¶
func OptionalArg[T any](defaultArg T, optional ...T) T
Select either default or optional value if the optional value is given in argumments.
func OptionalString ¶
func ReadTemplate ¶
func ReadTemplateFile ¶
func RoundMoney ¶
func RoundMoneyDown ¶
func RoundMoneyUp ¶
func StrToFloat ¶
func StrToInt32 ¶
func StrToInt64 ¶
func StrToUint32 ¶
func StrToUint64 ¶
func TimeConverter ¶
func TimeRFC3339 ¶
func TimeReflectStr ¶
func TimeToStrRu ¶
func WalkDirExt ¶
func WalkDirExt(handler WalkDirExtHandler, root string, ext string) error
Types ¶
type Base64StringCoding ¶
type Base64StringCoding struct { }
func (*Base64StringCoding) Decode ¶
func (b *Base64StringCoding) Decode(data string) ([]byte, error)
func (*Base64StringCoding) Encode ¶
func (b *Base64StringCoding) Encode(data []byte) string
type Date ¶
type Date int
func DateFromId ¶
func DateOfTime ¶
func DateWithOffset ¶
func (*Date) MarshalJSON ¶
func (*Date) StringRuShort ¶
func (*Date) UnmarshalJSON ¶
type FileWriteReopen ¶
type HexStringCoding ¶
type HexStringCoding struct {
UpperCase bool
}
func (*HexStringCoding) Encode ¶
func (h *HexStringCoding) Encode(data []byte) string
type Month ¶
type Month int
func CurrentMonth ¶
func CurrentMonth() Month
func MonthFromDate ¶
func MonthFromId ¶
func MonthFromString ¶
func MonthFromTime ¶
func (*Month) AsShortNumber ¶
func (*Month) AsShortNumberReverse ¶
func (*Month) MarshalJSON ¶
func (*Month) UnmarshalJSON ¶
type MonthDataBase ¶
type MonthDataBase struct {
Month Month `gorm:"primary_key;index;index:,unique,composite:u_month" json:"month"`
}
func (*MonthDataBase) GetMonth ¶
func (w *MonthDataBase) GetMonth() Month
func (*MonthDataBase) InitMonth ¶
func (w *MonthDataBase) InitMonth()
func (*MonthDataBase) SetMonth ¶
func (w *MonthDataBase) SetMonth(m Month)
type StringCoding ¶
type StructTagHandler ¶
type WalkDirExtHandler ¶
type WithStringCoder ¶
type WithStringCoder interface {
Coder() StringCoding
}
type WithStringCoderBase ¶
type WithStringCoderBase struct {
StringCoding StringCoding
}
func (*WithStringCoderBase) Coder ¶
func (w *WithStringCoderBase) Coder() StringCoding
func (*WithStringCoderBase) Construct ¶
func (w *WithStringCoderBase) Construct(encoder ...StringCoding)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.