Change project dir structure

This commit is contained in:
Andrew Gutekanst
2020-01-13 17:32:49 -05:00
parent e5257eb6ed
commit 30219b8bcf
16 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
package launcherserver
import (
"net/http"
)
// ServerHandler is a handler function akin to http.Handler's ServeHTTP,
// but has an additional *Server argument.
type ServerHandler func(*Server, http.ResponseWriter, *http.Request)
// ServerHandlerFunc is a small type that implements http.Handler and
// wraps a calling ServerHandler with a *Server argument.
type ServerHandlerFunc struct {
server *Server
f ServerHandler
}
func (shf ServerHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
shf.f(shf.server, w, r)
}