|
@@ -1,10 +1,10 @@
|
1
|
|
-# PathRouter [![Build Status](https://travis-ci.org/naleek/PathRouter.svg?branch=master)](https://travis-ci.org/naleek/PathRouter) [![Coverage Status](https://coveralls.io/repos/github/naleek/PathRouter/badge.svg?branch=master)](https://coveralls.io/github/naleek/PathRouter?branch=master) [![GoDoc](https://godoc.org/github.com/naleek/PathRouter?status.svg)](http://godoc.org/github.com/naleek/PathRouter)
|
|
1
|
+# pathrouter [![Build Status](https://travis-ci.org/naleek/pathrouter.svg?branch=master)](https://travis-ci.org/naleek/PathRouter) [![Coverage Status](https://coveralls.io/repos/github/naleek/pathrouter/badge.svg?branch=master)](https://coveralls.io/github/naleek/pathrouter?branch=master) [![GoDoc](https://godoc.org/github.com/naleek/PathRouter?status.svg)](http://godoc.org/github.com/naleek/pathrouter)
|
2
|
2
|
|
3
|
|
-PathRouter is a lightweight high performance path router (also called *multiplexer* or just *mux* for short) for [Go](https://golang.org/).
|
|
3
|
+pathrouter is a lightweight high performance path router (also called *multiplexer* or just *mux* for short) for [Go](https://golang.org/).
|
4
|
4
|
|
5
|
5
|
The router is optimized for high performance and a small memory footprint. It scales well even with very long paths and a large number of routes. A compressing dynamic trie (radix tree) structure is used for efficient matching.
|
6
|
6
|
|
7
|
|
-PathRouter was born out of [github.com/julienschmidt/httprouter](http://github.com/julienschmidt/httprouter), It extracts the path matching logic, and discards all of the HTTP specific logic.
|
|
7
|
+pathrouter was born out of [github.com/julienschmidt/httprouter](http://github.com/julienschmidt/httprouter), It extracts the path matching logic, and discards all of the HTTP specific logic.
|
8
|
8
|
|
9
|
9
|
## Features
|
10
|
10
|
|
|
@@ -16,7 +16,7 @@ PathRouter was born out of [github.com/julienschmidt/httprouter](http://github.c
|
16
|
16
|
|
17
|
17
|
## Usage
|
18
|
18
|
|
19
|
|
-This is just a quick introduction, view the [GoDoc](http://godoc.org/github.com/naleek/PathRouter) for details.
|
|
19
|
+This is just a quick introduction, view the [GoDoc](http://godoc.org/github.com/naleek/pathrouter) for details.
|
20
|
20
|
|
21
|
21
|
Let's start with a trivial example:
|
22
|
22
|
|
|
@@ -42,7 +42,7 @@ func main() {
|
42
|
42
|
|
43
|
43
|
### Named parameters
|
44
|
44
|
|
45
|
|
-As you can see, `:name` is a *named parameter*. The values are accessible via `PathRouter.Params`, which is just a slice of `PathRouter.Param`s. You can get the value of a parameter either by its index in the slice, or by using the `ByName(name)` method: `:name` can be retrived by `ByName("name")`.
|
|
45
|
+As you can see, `:name` is a *named parameter*. The values are accessible via `pathrouter.Params`, which is just a slice of `pathrouter.Param`s. You can get the value of a parameter either by its index in the slice, or by using the `ByName(name)` method: `:name` can be retrived by `ByName("name")`.
|
46
|
46
|
|
47
|
47
|
Named parameters only match a single path segment:
|
48
|
48
|
|