typecheck

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package typecheck provides type-checking predicates for common Go types used in Datapages handler signatures.

Index

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 IsBool

func IsBool(t types.Type) bool

IsBool reports whether t's underlying type is bool.

func IsError

func IsError(t types.Type) bool

IsError reports whether t is the builtin "error" type.

func IsInt

func IsInt(t types.Type) bool

IsInt reports whether t's underlying type is int.

func IsPtrToDatastarSSE

func IsPtrToDatastarSSE(
	expr ast.Expr, info *types.Info,
) bool

IsPtrToDatastarSSE reports whether expr resolves to *datastar.ServerSentEventGenerator.

func IsPtrToNetHTTPReq

func IsPtrToNetHTTPReq(
	expr ast.Expr, info *types.Info,
) bool

IsPtrToNetHTTPReq reports whether expr resolves to *net/http.Request.

func IsSessionType

func IsSessionType(
	expr ast.Expr, info *types.Info,
) bool

IsSessionType reports whether expr resolves to a named type called "Session".

func IsString

func IsString(t types.Type) bool

IsString reports whether t's underlying type is string.

func IsTemplComponent

func IsTemplComponent(t types.Type) bool

IsTemplComponent reports whether t is github.com/a-h/templ.Component.

func IsTimeTime

func IsTimeTime(t types.Type) bool

IsTimeTime reports whether t is time.Time from the standard library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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