2424 xmlHeaderBytes = []byte (xml .Header )
2525)
2626
27- // Pure is the main instance
28- type Pure struct {
27+ // Mux is the main request multiplexer
28+ type Mux struct {
2929 routeGroup
3030 get * node
3131 post * node
@@ -112,9 +112,9 @@ var (
112112)
113113
114114// New Creates and returns a new Pure instance
115- func New () * Pure {
115+ func New () * Mux {
116116
117- p := & Pure {
117+ p := & Mux {
118118 routeGroup : routeGroup {
119119 middleware : make ([]Middleware , 0 ),
120120 },
@@ -150,7 +150,7 @@ func New() *Pure {
150150
151151// Register404 alows for overriding of the not found handler function.
152152// NOTE: this is run after not finding a route even after redirecting with the trailing slash
153- func (p * Pure ) Register404 (notFound http.HandlerFunc , middleware ... Middleware ) {
153+ func (p * Mux ) Register404 (notFound http.HandlerFunc , middleware ... Middleware ) {
154154
155155 h := notFound
156156
@@ -164,7 +164,7 @@ func (p *Pure) Register404(notFound http.HandlerFunc, middleware ...Middleware)
164164// RegisterAutomaticOPTIONS tells pure whether to
165165// automatically handle OPTION requests; manually configured
166166// OPTION handlers take precedence. default true
167- func (p * Pure ) RegisterAutomaticOPTIONS (middleware ... Middleware ) {
167+ func (p * Mux ) RegisterAutomaticOPTIONS (middleware ... Middleware ) {
168168
169169 p .automaticallyHandleOPTIONS = true
170170
@@ -180,13 +180,13 @@ func (p *Pure) RegisterAutomaticOPTIONS(middleware ...Middleware) {
180180// SetRedirectTrailingSlash tells pure whether to try
181181// and fix a URL by trying to find it
182182// lowercase -> with or without slash -> 404
183- func (p * Pure ) SetRedirectTrailingSlash (set bool ) {
183+ func (p * Mux ) SetRedirectTrailingSlash (set bool ) {
184184 p .redirectTrailingSlash = set
185185}
186186
187187// RegisterMethodNotAllowed tells pure whether to
188188// handle the http 405 Method Not Allowed status code
189- func (p * Pure ) RegisterMethodNotAllowed (middleware ... Middleware ) {
189+ func (p * Mux ) RegisterMethodNotAllowed (middleware ... Middleware ) {
190190
191191 p .handleMethodNotAllowed = true
192192
@@ -200,7 +200,7 @@ func (p *Pure) RegisterMethodNotAllowed(middleware ...Middleware) {
200200}
201201
202202// Serve returns an http.Handler to be used.
203- func (p * Pure ) Serve () http.Handler {
203+ func (p * Mux ) Serve () http.Handler {
204204
205205 // reserved for any logic that needs to happen before serving starts.
206206 // i.e. although this router does not use priority to determine route order
@@ -210,7 +210,7 @@ func (p *Pure) Serve() http.Handler {
210210}
211211
212212// Conforms to the http.Handler interface.
213- func (p * Pure ) serveHTTP (w http.ResponseWriter , r * http.Request ) {
213+ func (p * Mux ) serveHTTP (w http.ResponseWriter , r * http.Request ) {
214214
215215 var tree * node
216216
504504 p .pool .Put (rv )
505505}
506506
507- func (p * Pure ) redirect (method string , to string ) (h http.HandlerFunc ) {
507+ func (p * Mux ) redirect (method string , to string ) (h http.HandlerFunc ) {
508508
509509 code := http .StatusMovedPermanently
510510
0 commit comments