Documentation ¶
Index ¶
- Variables
- 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 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 PtrNotNil[T any](val *T, fn func() *T) *T
- func PtrNotNilVoid[T any](val *T, fn func())
- func PtrStringTrimSpace(pointers ...*string)
- func PtrValue[T any](val *T, defaultValue T) T
- func RSelectFirst[T any](out []T, err error) (*T, error)
- 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
- type Future
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeZone string
Functions ¶
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 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 PtrNotNilVoid ¶
func PtrNotNilVoid[T any](val *T, fn func())
func PtrStringTrimSpace ¶ added in v1.0.10
func PtrStringTrimSpace(pointers ...*string)
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.