typlect

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeAny     = reflect.TypeOf((*any)(nil)).Elem()
	TypeErr     = reflect.TypeOf((*error)(nil)).Elem()
	TypeNoParam = reflect.TypeOf(NoParam{})
	TypeCtx     = reflect.TypeOf((*context.Context)(nil)).Elem()
	TypeTime    = reflect.TypeOf(time.Time{})
)

Functions

func BuildCtrFromValue

func BuildCtrFromValue(t any) any

func BuildCtrInvoker

func BuildCtrInvoker(ctr any, h func(v any) error) any

func CtrOf

func CtrOf[T any](ctr any) bool

func CtrOfValue

func CtrOfValue[T any](ctr any) bool

func FuncInOut

func FuncInOut(v any) ([]reflect.Type, []reflect.Type)

func FuncName

func FuncName(fn any) string

func GetByReturns

func GetByReturns[T any](ctr any) (T, bool)

func GetType

func GetType[T any]() reflect.Type

func HasTag

func HasTag(s any, tag string) bool

func HasTypeOf

func HasTypeOf[T any](p ...any) bool

func InvokerFromValues

func InvokerFromValues(vs ...any) any

func IsFunc

func IsFunc(v any) bool

func IsInterface

func IsInterface[T any]() (ok bool)

func IsVariadicFunc

func IsVariadicFunc(v any) bool

Types

type NoParam

type NoParam struct{}

type ValFunc

type ValFunc = func() any

type ValFuncE

type ValFuncE = func() (any, error)

Jump to

Keyboard shortcuts

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