<commit_before>package gopher

import "net/http"

//
func (c appContainer) Get(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Get(path, nfn)
}

func (c appContainer) Head(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Head(path, nfn)
}

func (c appContainer) Post(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Post(path, nfn)
}

func (c appContainer) Put(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Put(path, nfn)
}

func (c appContainer) Patch(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Patch(path, nfn)
}

func (c appContainer) Delete(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Delete(path, nfn)
}

func (c appContainer) Options(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Options(path, nfn)
}

func (c appContainer) Match(path string, fn handlerFn, verbs ...string) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).Match(path, nfn, verbs...)
}

func (c appContainer) All(path string, fn handlerFn) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(c, rw, req, fn)
	}
	c.providers[ROUTER].(Routable).All(path, nfn)
}

//
func (c appContainer) Serve() {
	c.providers[ROUTER].(Routable).Serve()
}

// Parameters
func (c appContainer) PathParams(req *http.Request) map[string]string {
	return c.providers[PARAMS].(Parametable).PathParams(req)
}
<commit_msg>Moved routable facade up to the router level<commit_after>package gopher

import "net/http"

type routerFacade struct {
	http.Handler
	name string
}

var routerFac = routerFacade{}

// Router()
func (c appContainer) Router() Routable {
	return routerFac
}
func (r routerFacade) Register(config map[string]interface{}) interface{} {
	return r
}

func (r routerFacade) GetKey() string {
	return "ROUTER"
}

func (r routerFacade) Get(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Get(path, nfn)
}

func (r routerFacade) Head(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Head(path, nfn)
}

func (r routerFacade) Post(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Post(path, nfn)
}

func (r routerFacade) Put(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Put(path, nfn)
}

func (r routerFacade) Patch(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Patch(path, nfn)
}

func (r routerFacade) Delete(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Delete(path, nfn)
}

func (r routerFacade) Options(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Options(path, nfn)
}

func (r routerFacade) Match(
	path string,
	fn func(rw http.ResponseWriter, req *http.Request), verbs ...string) {

	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).Match(path, nfn, verbs...)

}

func (r routerFacade) All(path string, fn func(rw http.ResponseWriter, req *http.Request)) {
	nfn := func(rw http.ResponseWriter, req *http.Request) {
		routeMiddleware(container, rw, req, fn)
	}
	container.providers[ROUTER].(Routable).All(path, nfn)
}

func (r routerFacade) Serve() {
	container.providers[ROUTER].(Routable).Serve()
}

// Parameters
func (c appContainer) PathParams(req *http.Request) map[string]string {
	return c.providers[PARAMS].(Parametable).PathParams(req)
}

{'fraction_non_alphanumeric': 0.150390625, 'fraction_numerical': 0.0, 'mean_word_length': 5.214805825242719, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3764881', 'n_tokens_mistral': 1916, 'n_tokens_neox': 1883, 'n_words': 433}