Core functionality for new aiterp.net servers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
512 B

package wrouter
import (
"net/http"
"git.aiterp.net/gisle/wrouter/auth"
)
// FunctionHandlerFunc is simply a function that is called directly rather than through a struct
type FunctionHandlerFunc func(path string, w http.ResponseWriter, req *http.Request, user *auth.User) bool
type functionHandler struct {
function FunctionHandlerFunc
}
func (handler *functionHandler) Handle(path string, w http.ResponseWriter, req *http.Request, user *auth.User) bool {
return handler.function(path, w, req, user)
}