package handler import ( "net/http" ) type HandlerFunc func(http.ResponseWriter, *http.Request) type AuthMux struct { mux *http.ServeMux Port int } func NewAuthMux() *AuthMux { mux := AuthMux{ mux: http.NewServeMux(), Port: 32039, } http.Handle("/", mux.mux) return &mux } func (authMux *AuthMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { authMux.mux.ServeHTTP(w, r) } func (authMux *AuthMux) PublicHandleFunc(pattern string, handlerFunc HandlerFunc) { authMux.mux.HandleFunc(pattern, handlerFunc) } func (authMux *AuthMux) PublicHandle(pattern string, handler http.Handler) { authMux.mux.Handle(pattern, handler) } func (authMux *AuthMux) ListenAndServe() { http.ListenAndServe(":32039", nil) }