f9

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeZone string
)

Functions

func CustomTime added in v1.1.20

func CustomTime(year, month, day, hour, min, sec, nsec int, timezone ...string) time.Time

func FnGO added in v1.1.45

func FnGO(funcs ...func() error) (err error)

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 GetValueFromKey added in v1.2.3

func GetValueFromKey[K comparable, V any](defaultValue V, kvs map[K]V, key K) V

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 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 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) *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 Retry added in v1.1.37

func Retry[T any](executor func() (T, error), retries int, delay time.Duration, ctx ...context.Context) (T, error)

func SVal added in v1.1.37

func SVal[T any](obj interface{}, defaultValue ...T) (*T, bool)

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

func Val added in v1.1.37

func Val[T any](obj interface{}, defaultValue ...T) *T

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