Browse Source

Update README, etc

Peter Kieltyka 3 years ago
parent
commit
1f2fb7ebd0
4 changed files with 37 additions and 18 deletions
  1. 1
    1
      CHANGELOG.md
  2. 17
    11
      README.md
  3. 1
    1
      chain.go
  4. 18
    5
      docgen/README.md

+ 1
- 1
CHANGELOG.md View File

@@ -1,6 +1,6 @@
1 1
 # Changelog
2 2
 
3
-## v2.0.0 (2016-07-26)
3
+## v2.0.0rc1 (2016-07-26)
4 4
 
5 5
 - Huge update! chi v2 is a large refactor targetting Go 1.7+. As of Go 1.7, the popular
6 6
 community `"net/context"` package has been included in the standard library as `"context"` and

+ 17
- 11
README.md View File

@@ -3,17 +3,23 @@
3 3
 
4 4
 [![GoDoc Widget]][GoDoc] [![Travis Widget]][Travis]
5 5
 
6
-`chi` is a small, idiomatic and composable router for building Go 1.7+ HTTP services. `chi` utilizes
7
-the new `context` package introduced in Go 1.7 to handle signaling, cancelation and request-scoped
8
-values across a handler chain.
9
-
10
-Chi encourages writing services by composing small handlers and middlewares constructed together
11
-from multiple sub-routers that make up the complete service API.
12
-
13
-In order to get the most out of this pattern, chi's routing methods (Get, Post, Handle, Mount, etc.)
14
-support inline middlewares, middleware groups, and mounting (composing) any chi router to another.
15
-We've designed the Pressly API (150+ routes/handlers) exactly like this for the goals of productivity,
16
-maintainability and expression.
6
+`chi` is a lightweight, idiomatic and composable router for building Go 1.7+ HTTP services. It's
7
+especially good at helping you write large REST API services that are kept maintainable as your
8
+project grows and changes. `chi` is built on the new `context` package introduced in Go 1.7 to
9
+handle signaling, cancelation and request-scoped values across a handler chain.
10
+
11
+The focus of the project has been to seek out an elegant and comfortable design for writing
12
+REST API servers, written during the development of the Pressly API service that powers our
13
+network of services.
14
+
15
+The key considerations of chi's design were: project structure, maintainability, standard http
16
+handlers (stdlib-only), developer productivity, and deconstructing a large system into many small
17
+parts. The core router `github.com/pressly/chi` is quite small (less than 1000 LOC), but we've also
18
+included some useful/optional subpackages: `middleware`, `render` and `docgen`. We hope it helps you too!
19
+
20
+Looking ahead from the common REST convention for writing HTTP services, I also recommend newer works
21
+in the field coming from gRPC, go-kit and graphql. They're all maturing nicely, each with their
22
+own unique approaches and benefits.
17 23
 
18 24
 
19 25
 ## Features

+ 1
- 1
chain.go View File

@@ -2,7 +2,7 @@ package chi
2 2
 
3 3
 import "net/http"
4 4
 
5
-// Chain returns a Middlewares slice.
5
+// Chain returns a Middlewares type from a slice of middleware handlers.
6 6
 func Chain(middlewares ...func(http.Handler) http.Handler) Middlewares {
7 7
 	return Middlewares(middlewares)
8 8
 }

+ 18
- 5
docgen/README.md View File

@@ -2,8 +2,21 @@
2 2
 
3 3
 ## TODO
4 4
 
5
-- [ ] Description - can we get description of each?
6
-- [ ] sourcePath - hmm.. possible..? reflect..?
7
-- [ ] endPoint - the function name..
8
-- [ ] middleware - the function name
9
-- [ ] 
5
+- [ ] Docgen: figure out projectPath, $GOPATH/src/XXX
6
+- [ ] Docgen: parse comments from file line for handlers and middlewares
7
+- [ ] Docgen: function name
8
+  - [ ] anonymous?
9
+  - [ ] name?
10
+  - [ ] package?
11
+- [ ] Docgen: generate markdown from the JSON file ..
12
+- [ ] Docgen: chi.Routes to not consider a chi.Router at all..?
13
+- [ ] Docgen: for each handler/middleware:
14
+
15
+    "func": "ListHubs",
16
+    "pkg": "github.com/pressly/api/web/handlers/hubs"
17
+    "file": "github.com/pressly/api/web/handlers/hubs.go",
18
+    "line": "173"
19
+
20
+- [ ] chi: method name for Chain() method? Inline()? something else?
21
+- [ ] chi: Any() ?
22
+- [ ] chi: Handle and HandleFunc ? 

Loading…
Cancel
Save