golazy.dev golazy.dev / lazyroutes / actioncall Index | Files

package actioncall

import "golazy.dev/lazyroutes/actioncall"

Package actioncall compiles and invokes controller action call plans for lazyroutes.

It is public so the routing package can keep the reflection-heavy planner in a focused subpackage, but application code should normally use lazyroutes instead. The supported controller action contract is documented by lazyroutes: standard actions receive http.ResponseWriter and *http.Request, while generator-backed actions resolve route parameters and GenX methods.

Types

type Plan

type Plan struct {
	// contains filtered or unexported fields
}
func Compile
func Compile(controllerType reflect.Type, action reflect.Value, opts Options) (*Plan, error)
func (p *Plan) Call
func (p *Plan) Call(controller reflect.Value, w http.ResponseWriter, r *http.Request) error