f9

package
v1.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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 GetMapStructPbValue(m map[string]interface{}) map[string]*structpb.Value

func GetStructPbValue added in v1.0.11

func GetStructPbValue[R any](val *structpb.Value) R

func IfAllNil added in v1.0.10

func IfAllNil(items ...interface{}) bool

func IfAllStructPbNil added in v1.0.11

func IfAllStructPbNil(items ...*structpb.Value) bool

func IfEqual added in v1.1.13

func IfEqual[T comparable](left *T, right T) bool

func IfHaveEmpty added in v1.0.11

func IfHaveEmpty(items ...string) bool

func IfHaveIn added in v1.1.13

func IfHaveIn[T comparable](val T, in ...T) bool

func IfHaveNil added in v1.1.13

func IfHaveNil(items ...interface{}) 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 IfStrNilOrEmpty(val *string) bool

func IfStrNotNilButEmpty added in v1.0.10

func IfStrNotNilButEmpty(val *string) bool

func Ls added in v1.1.15

func Ls[T any](vals ...T) []T

func PanicCatcher added in v1.0.6

func PanicCatcher(fn func()) (err error)

func Ptr

func Ptr[T any](val T) *T

func PtrNotNil

func PtrNotNil[T any](val *T, fn func() *T) *T

func PtrNotNilVoid

func PtrNotNilVoid[T any](val *T, fn func())

func PtrStringTrimSpace added in v1.0.10

func PtrStringTrimSpace(pointers ...*string)

func PtrValue added in v1.1.15

func PtrValue[T any](val *T, defaultValue T) T

func RSelectFirst added in v1.0.15

func RSelectFirst[T any](out []T, err error) (*T, error)

func Ternary

func Ternary[T any](condition bool, a, b T) T

func TernaryFn

func TernaryFn[T any](condition bool, a, b func() T) T

func TernaryFnA

func TernaryFnA[T any](condition bool, a func() T, b T) T

func TernaryFnB

func TernaryFnB[T any](condition bool, a T, b func() T) T

func TimeNow

func TimeNow(timezone ...string) time.Time

func TimeRemoveTimeZone added in v1.0.10

func TimeRemoveTimeZone(tm time.Time) time.Time

func ToCurrencyFormat added in v1.0.14

func ToCurrencyFormat[T string | int | int32 | int64 | float32 | float64](val T, decimalPoint int, thousandSeparator, decimalSeparator string) string

func ToJsonRaw added in v1.1.0

func ToJsonRaw(data []byte) json.RawMessage

Types

type Future added in v1.0.1

type Future interface {
	Await() interface{}
}

func Async added in v1.0.1

func Async(fn func() interface{}) Future

func Async1 added in v1.0.1

func Async1[T1 any](fn func(p1 T1) interface{}, p1 T1) Future

func Async2 added in v1.0.1

func Async2[T1 any, T2 any](fn func(p1 T1, p2 T2) interface{}, p1 T1, p2 T2) Future

func Async3 added in v1.0.1

func Async3[T1 any, T2 any, T3 any](fn func(p1 T1, p2 T2, p3 T3) interface{}, p1 T1, p2 T2, p3 T3) Future

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL