package types import ( "database/sql" "net/http" "time" "penguins.lan/args" "penguins.lan/database" ) type RequestContext struct { DBConn *sql.DB Args *args.Arguments Id string Start time.Time // User is the authenticated account (nil until resolved/required). User *database.User // ClientMAC is the visitor's hardware address, if we could read it. ClientMAC string // Nick mirrors User.Username for templates and the chat hub. Nick string TemplateData *map[string]interface{} } type BannerMessages struct { Messages []string } // Continuation-passing style: each step is a Continuation that, given a // (success, failure) pair, returns the next link in the chain. This lets routes // read as a flat pipeline in serve.go while still branching on errors. type Continuation func(*RequestContext, *http.Request, http.ResponseWriter) ContinuationChain type ContinuationChain func(Continuation, Continuation) ContinuationChain