Documentation ¶
Index ¶
- func AddTo[T any](collections *[]T, collection T, index int)
- func ConvertErrMsg[R any](errF any) ([]*R, error)
- func Distinct[T any](collections *[]T)
- func Exist[T any](collections []T, fn func(T) bool) (state bool)
- func FileMove(src string, dst string, perm os.FileMode, file ...string)
- func First[T any](collections []T) (col T)
- func FirstWhere[T any](collections []T, fn func(T) bool) (col T)
- func GenerateSignature(key string, second ...int64) (signature string)
- func GetTimebaseUnix(seconds int64) int64
- func IndexWhere[T any](collections []T, fn func(T) bool) (index int)
- func IndexesOf[T any](collections []T, val T) (indexes []int)
- func IndexesWhere[T any](collections []T, fn func(T) bool) (indexes []int)
- func IsRFC3339(field validator.FieldLevel) bool
- func Last[T any](collections []T) (col T)
- func LastIndexWhere[T any](collections []T, fn func(T) bool) (index int)
- func LastWhere[T any](collections []T, fn func(T) bool) (col T)
- func Prepend[T any](collections []T, cols ...T) (res []T)
- func RandString(length int) string
- func RandStringLower(length int) string
- func RandStringUpper(length int) string
- func RandStringWithCharset(length int, charset string) string
- func RandomHex(n int) string
- func RandomHexUpper(n int) string
- func RemoveAt[T any](collections *[]T, index int)
- func RemoveIn[T any](collections *[]T, indexes []int)
- func RemoveWhere[T any](collections *[]T, fn func(T) bool)
- func Substring(text string, indexs ...int) string
- func VerifySignature(key string, signature string, second ...int64) bool
- func Where[T any](collections *[]T, fn func(T) bool)
- type CustomValidator
- type ErrField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertErrMsg ¶ added in v1.0.2
func Distinct ¶ added in v1.0.2
func Distinct[T any](collections *[]T)
Distinct (collections): Distinct slices value
func FirstWhere ¶ added in v1.0.2
func GenerateSignature ¶ added in v1.0.2
func GetTimebaseUnix ¶ added in v1.0.2
func IndexWhere ¶ added in v1.0.2
func IndexesWhere ¶ added in v1.0.2
func LastIndexWhere ¶ added in v1.0.2
func RandString ¶
func RandStringLower ¶
func RandStringUpper ¶
func RandStringWithCharset ¶
func RandomHexUpper ¶
func RemoveWhere ¶ added in v1.0.2
func VerifySignature ¶ added in v1.0.2
Types ¶
type CustomValidator ¶ added in v1.0.2
type CustomValidator struct { Validate *validator.Validate Translator ut.Translator }
func NewValidator ¶ added in v1.0.2
func NewValidator() *CustomValidator
func (*CustomValidator) GetErrMsg ¶ added in v1.0.2
func (cv *CustomValidator) GetErrMsg(err error) string
func (*CustomValidator) GetErrMsgField ¶ added in v1.0.2
func (cv *CustomValidator) GetErrMsgField(err error) (errF []ErrField)
func (*CustomValidator) SetTranslation ¶ added in v1.0.2
func (cv *CustomValidator) SetTranslation(locale string) *CustomValidator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.