Documentation ¶
Index ¶
- func BooleanToInt(val bool) int
- func Btoi(b bool) int
- func ChunkAnySlice[T any](slice []T, chunkSize int) [][]T
- func ChunkSlice(slice []int64, chunkSize int) [][]int64
- func ChunkSliceStruct[T interface{}](slice []T, chunkSize int) [][]T
- func CompareSliceExact[T comparable](a, b []T) bool
- func CompareSliceValue[T comparable](a, b []T) bool
- func Contains[T comparable](s []T, e T) bool
- func ContainsInt64(i []int64, e int64) bool
- func ContainsString(str string, substrs []string) bool
- func ConvertPhoneFirstZero(phone string) (string, error)
- func CurrencySprint(a interface{}) string
- func DateToStringParsing(inputTime *time.Time) string
- func Explode(delimiter, text string) []string
- func FormatPhoneNumber(phone string) string
- func GetMilisecondAddDay(dayAdd int) int64
- func GetMilisecondNow() int64
- func GetRangeTimeFromNow(dayAdd int) (startDateEpoch, endDateEpoch int64)
- func HashAndSalt(pwd []byte) (string, error)
- func IntToSliceString(value []int) string
- func IsSlice(v interface{}) bool
- func Itob(i int) bool
- func NewValidator() *mValidator
- func ParseToBoolean(val interface{}) (bool, error)
- func ParseToNumber[T float64 | float32 | int64 | int32 | int16 | int8 | int](val interface{}) (T, error)
- func ParseToString(val interface{}) (string, error)
- func ParseToStruct(val interface{}, target interface{}) error
- func PrecisionRound(num float64, precision int) float64
- func SliceToSliceInt(value string) ([]int, error)
- func SplitStringTimeParsing(timeString string) (time.Time, error)
- func StringDateParsing(dateString string) (time.Time, error)
- func StringInSlice(a string, list []string) bool
- func StringTimeCustomParsing(timeString, layout string) (time.Time, error)
- func StringTimeParsing(timeString string) (time.Time, error)
- func StringToSliceString(value string) []string
- func TimeToCustomString(inputTime time.Time, layout string) string
- func TimeToString(inputTime time.Time, lang language.Tag) string
- func TimeToStringHHmm(inputTime time.Time, separator string) string
- func TimeToStringHHmmss(inputTime time.Time, separator string) string
- func TimeToStringLocale(inputTime time.Time) string
- func TimeToStringParsing(inputTime time.Time) string
- func TimeToStringYYYYmmDD(inputTime time.Time, separator string) string
- type GormLogger
- func (g GormLogger) Error(ctx context.Context, msg string, args ...interface{})
- func (g GormLogger) Info(ctx context.Context, msg string, args ...interface{})
- func (g *GormLogger) LogMode(logLevel gormLogger.LogLevel) gormLogger.Interface
- func (g *GormLogger) SetSlowThreshold(d time.Duration)
- func (g GormLogger) Trace(ctx context.Context, begin time.Time, ...)
- func (g GormLogger) Warn(ctx context.Context, msg string, args ...interface{})
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BooleanToInt ¶
func ChunkAnySlice ¶
func ChunkSlice ¶
func ChunkSliceStruct ¶
func ChunkSliceStruct[T interface{}](slice []T, chunkSize int) [][]T
func CompareSliceExact ¶
func CompareSliceExact[T comparable](a, b []T) bool
CompareSliceExact compare two slice with equal value and order
func CompareSliceValue ¶
func CompareSliceValue[T comparable](a, b []T) bool
CompareSliceValue compare two slice with equal value but not order
func Contains ¶
func Contains[T comparable](s []T, e T) bool
func ContainsInt64 ¶
func ContainsString ¶
func ConvertPhoneFirstZero ¶
func CurrencySprint ¶
func CurrencySprint(a interface{}) string
func DateToStringParsing ¶
func FormatPhoneNumber ¶
func GetMilisecondAddDay ¶
func GetMilisecondNow ¶
func GetMilisecondNow() int64
func GetRangeTimeFromNow ¶
func HashAndSalt ¶
func IntToSliceString ¶
func NewValidator ¶
func NewValidator() *mValidator
func ParseToBoolean ¶
func ParseToNumber ¶
func ParseToString ¶
func ParseToStruct ¶
func ParseToStruct(val interface{}, target interface{}) error
func PrecisionRound ¶
func SliceToSliceInt ¶
func StringInSlice ¶
func StringTimeCustomParsing ¶
func StringToSliceString ¶
func TimeToStringLocale ¶
func TimeToStringParsing ¶
Types ¶
type GormLogger ¶
func NewGormLogger ¶
func NewGormLogger(logger *logrus.Logger, logLevel gormLogger.LogLevel) *GormLogger
func (GormLogger) Error ¶
func (g GormLogger) Error(ctx context.Context, msg string, args ...interface{})
func (GormLogger) Info ¶
func (g GormLogger) Info(ctx context.Context, msg string, args ...interface{})
func (*GormLogger) LogMode ¶
func (g *GormLogger) LogMode(logLevel gormLogger.LogLevel) gormLogger.Interface
func (*GormLogger) SetSlowThreshold ¶
func (g *GormLogger) SetSlowThreshold(d time.Duration)
type Validator ¶
type Validator interface { // Real mengembalian validator instance asli Real() *validator.Validate // SliceStruct menerima payload []struct dan mengembalikan validasi error yang // didapatkan dalam bentuk map string, dan error aslinya. inputan valid apabila err nil SliceStruct(input interface{}) (map[string]interface{}, error) // SliceStruct menerima payload []struct dan mengembalikan validasi error yang // didapatkan dalam bentuk map string dan error aslinya. inputan valid apabila err nil Struct(input interface{}) (map[string]interface{}, error) // Var menerima payload variable dan mengembalikan validasi error yang // didapatkan dalam bentuk map string dan error aslinya. inputan valid apabila err nil // eg. // var i int // validate.Var(i, "gt=1,lt=10") Var(input interface{}, tag string) (map[string]interface{}, error) }
Click to show internal directories.
Click to hide internal directories.