Documentation
¶
Overview ¶
Package typecheck provides type-checking predicates for common Go types used in Datapages handler signatures.
Index ¶
- func EventTypeNameOf(expr ast.Expr, info *types.Info, eventTypeNames map[string]struct{}) (string, bool)
- func ImplementsTextUnmarshaler(t types.Type) bool
- func IsBool(t types.Type) bool
- func IsError(t types.Type) bool
- func IsEventType(expr ast.Expr, info *types.Info, eventTypeName string) bool
- func IsInputFieldType(t types.Type) bool
- func IsInt(t types.Type) bool
- func IsPtrToDatastarSSE(expr ast.Expr, info *types.Info) bool
- func IsPtrToNetHTTPReq(expr ast.Expr, info *types.Info) bool
- func IsSessionType(expr ast.Expr, info *types.Info) bool
- func IsString(t types.Type) bool
- func IsTemplComponent(t types.Type) bool
- func IsTimeTime(t types.Type) bool
- func IsUint64(t types.Type) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventTypeNameOf ¶
func EventTypeNameOf( expr ast.Expr, info *types.Info, eventTypeNames map[string]struct{}, ) (string, bool)
EventTypeNameOf returns the EventXXX type name for expr if it is (or points to) a named type whose name is in eventTypeNames.
func ImplementsTextUnmarshaler ¶ added in v0.4.2
ImplementsTextUnmarshaler reports whether t or *t implements encoding.TextUnmarshaler.
func IsEventType ¶ added in v0.4.0
IsEventType reports whether the expression resolves to the named event type eventTypeName.
func IsInputFieldType ¶ added in v0.4.2
IsInputFieldType reports whether t is a supported type for path and query struct fields: string, bool, integers (int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64), floats (float32, float64), or any type that implements encoding.TextUnmarshaler.
func IsPtrToDatastarSSE ¶
IsPtrToDatastarSSE reports whether expr resolves to *datastar.ServerSentEventGenerator.
func IsPtrToNetHTTPReq ¶
IsPtrToNetHTTPReq reports whether expr resolves to *net/http.Request.
func IsSessionType ¶
IsSessionType reports whether expr resolves to a named type called "Session".
func IsTemplComponent ¶
IsTemplComponent reports whether t is github.com/a-h/templ.Component.
func IsTimeTime ¶
IsTimeTime reports whether t is time.Time from the standard library.
Types ¶
This section is empty.