Documentation ¶
Index ¶
- Constants
- func CallOrderedInit()
- func DirectPbwGet[T any](obj any, dval ...T) *T
- func GetDefault[T any](val *T, dval T) T
- func GetFirst[T any](ls []T, dval ...T) *T
- func GrpcCall[T any, R any](clog clog.Instance, ...) (*R, error)
- func GrpcClient[T any](address string, fn func(cc grpc.ClientConnInterface) T) (T, error)
- func GrpcHeader(ctx context.Context) map[string]string
- func IfHaveIn[T comparable](val T, in ...T) bool
- func IsNil(val any) bool
- func MapCopy[K comparable, V any](original map[K]V) map[K]V
- func OrderedInit(level int, fn func())
- func PbwDouble(val *float64) *wrapperspb.DoubleValue
- func PbwFloat(val *float64) *wrapperspb.FloatValue
- func PbwGet[T any](obj any, dval ...T) (*T, bool)
- func PbwInt32(val *int) *wrapperspb.Int32Value
- func PbwString(val *string) *wrapperspb.StringValue
- func Ptr[T any](val T) *T
- func PtrGetFirst[T any](ls []*T, dval ...*T) *T
- func Ternary[T any](condition bool, a, b T) T
- func Ternary2LR[A any, B any](condition bool, l, r func() (A, B)) (A, B)
- func TernaryR[T any](condition bool, a T, b func() T) T
- func Val[T any](condition bool, fn func() T) *T
Constants ¶
View Source
const ( OrderedLevelRepo = 2 OrderedLevelHandler = 3 OrderedLevelService = 9 )
Variables ¶
This section is empty.
Functions ¶
func CallOrderedInit ¶
func CallOrderedInit()
func DirectPbwGet ¶
func GetDefault ¶
func GetDefault[T any](val *T, dval T) T
func GrpcClient ¶
func GrpcClient[T any](address string, fn func(cc grpc.ClientConnInterface) T) (T, error)
func IfHaveIn ¶
func IfHaveIn[T comparable](val T, in ...T) bool
func MapCopy ¶
func MapCopy[K comparable, V any](original map[K]V) map[K]V
func OrderedInit ¶
func OrderedInit(level int, fn func())
func PbwDouble ¶ added in v1.0.9
func PbwDouble(val *float64) *wrapperspb.DoubleValue
func PbwFloat ¶ added in v1.0.9
func PbwFloat(val *float64) *wrapperspb.FloatValue
func PbwInt32 ¶
func PbwInt32(val *int) *wrapperspb.Int32Value
func PbwString ¶
func PbwString(val *string) *wrapperspb.StringValue
func PtrGetFirst ¶
func PtrGetFirst[T any](ls []*T, dval ...*T) *T
func Ternary2LR ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.