Documentation ¶
Index ¶
- Variables
- func CustomTime(year, month, day, hour, min, sec, nsec int, timezone ...string) time.Time
- func FnGO(funcs ...func() error) (err error)
- func FnIfPtrNotNil[T any](val *T, fn ...func(v T))
- func GetDefault[T any](ls []T, defVal T) T
- func GetKeyFromMap[K comparable, V any](m map[K]V) []K
- func GetMapStructPbValue(m map[string]interface{}) map[string]*structpb.Value
- func GetStructPbValue[R any](val *structpb.Value) R
- func GetValueFromKey[K comparable, V any](defaultValue V, kvs map[K]V, key K) V
- func IfAllNil(items ...interface{}) bool
- func IfAllStructPbNil(items ...*structpb.Value) bool
- func IfEqual[T comparable](left *T, right T) bool
- func IfHaveEmpty(items ...string) bool
- func IfHaveIn[T comparable](val T, in ...T) bool
- func IfHaveNil(items ...interface{}) bool
- func IfPtrValueEqual[T constraint.ComparisonType, PtrT *T](left, right PtrT) bool
- func IfStrNilOrEmpty(val *string) bool
- func IfStrNotNilButEmpty(val *string) bool
- func Ls[T any](vals ...T) []T
- func PanicCatcher(fn func()) (err error)
- func Ptr[T any](val T) *T
- func PtrEqual[T comparable](val *T, compare T) bool
- func PtrGetValueFromKey[K comparable, V any](defaultValue V, kvs map[K]V, key *K) V
- func PtrNotNil[T any](val *T, fn func() *T) *T
- func PtrNotNilVoid[T any](val *T, fn func())
- func PtrStringTrimSpace(pointers ...*string) *string
- func PtrValue[T any](val *T, defaultValue T) T
- func RSelectFirst[T any](out []T, err error) (*T, error)
- func Retry[T any](executor func() (T, error), retries int, delay time.Duration, ...) (T, error)
- func SVal[T any](obj interface{}, defaultValue ...T) (*T, bool)
- func Ternary[T any](condition bool, a, b T) T
- func TernaryFn[T any](condition bool, a, b func() T) T
- func TernaryFnA[T any](condition bool, a func() T, b T) T
- func TernaryFnB[T any](condition bool, a T, b func() T) T
- func TimeNow(timezone ...string) time.Time
- func TimeRemoveTimeZone(tm time.Time) time.Time
- func ToCurrencyFormat[T string | int | int32 | int64 | float32 | float64](val T, decimalPoint int, thousandSeparator, decimalSeparator string) string
- func ToJsonRaw(data []byte) json.RawMessage
- func Val[T any](obj interface{}, defaultValue ...T) *T
- type Future
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TimeZone string
)
Functions ¶
func CustomTime ¶ added in v1.1.20
func FnIfPtrNotNil ¶ added in v1.0.10
func FnIfPtrNotNil[T any](val *T, fn ...func(v T))
func GetDefault ¶ added in v1.0.5
func GetDefault[T any](ls []T, defVal T) T
func GetKeyFromMap ¶ added in v1.0.11
func GetKeyFromMap[K comparable, V any](m map[K]V) []K
func GetMapStructPbValue ¶ added in v1.0.11
func GetStructPbValue ¶ added in v1.0.11
func GetValueFromKey ¶ added in v1.2.3
func GetValueFromKey[K comparable, V any](defaultValue V, kvs map[K]V, key K) V
func IfAllStructPbNil ¶ added in v1.0.11
func IfEqual ¶ added in v1.1.13
func IfEqual[T comparable](left *T, right T) bool
func IfHaveEmpty ¶ added in v1.0.11
func IfHaveIn ¶ added in v1.1.13
func IfHaveIn[T comparable](val T, in ...T) bool
func IfPtrValueEqual ¶ added in v1.0.10
func IfPtrValueEqual[T constraint.ComparisonType, PtrT *T](left, right PtrT) bool
func IfStrNilOrEmpty ¶ added in v1.0.11
func IfStrNotNilButEmpty ¶ added in v1.0.10
func PanicCatcher ¶ added in v1.0.6
func PanicCatcher(fn func()) (err error)
func PtrEqual ¶ added in v1.1.55
func PtrEqual[T comparable](val *T, compare T) bool
func PtrGetValueFromKey ¶ added in v1.2.3
func PtrGetValueFromKey[K comparable, V any](defaultValue V, kvs map[K]V, key *K) V
func PtrNotNilVoid ¶
func PtrNotNilVoid[T any](val *T, fn func())
func PtrStringTrimSpace ¶ added in v1.0.10
func RSelectFirst ¶ added in v1.0.15
func TernaryFnA ¶
func TernaryFnB ¶
func ToCurrencyFormat ¶ added in v1.0.14
func ToJsonRaw ¶ added in v1.1.0
func ToJsonRaw(data []byte) json.RawMessage
Types ¶
Click to show internal directories.
Click to hide internal directories.