|
|
5 年之前 | |
|---|---|---|
| .. | ||
| log | 5 年之前 | |
| .gitignore | 5 年之前 | |
| .travis.yml | 5 年之前 | |
| BUILD | 5 年之前 | |
| CHANGES.md | 5 年之前 | |
| LICENSE | 5 年之前 | |
| Makefile | 5 年之前 | |
| README.md | 5 年之前 | |
| Srcfile | 5 年之前 | |
| bench_test.sh | 5 年之前 | |
| compress.go | 5 年之前 | |
| compressor_cache.go | 5 年之前 | |
| compressor_pools.go | 5 年之前 | |
| compressors.go | 5 年之前 | |
| constants.go | 5 年之前 | |
| container.go | 5 年之前 | |
| cors_filter.go | 5 年之前 | |
| coverage.sh | 5 年之前 | |
| curly.go | 5 年之前 | |
| curly_route.go | 5 年之前 | |
| doc.go | 5 年之前 | |
| entity_accessors.go | 5 年之前 | |
| filter.go | 5 年之前 | |
| json.go | 5 年之前 | |
| jsoniter.go | 5 年之前 | |
| jsr311.go | 5 年之前 | |
| logger.go | 5 年之前 | |
| mime.go | 5 年之前 | |
| options_filter.go | 5 年之前 | |
| parameter.go | 5 年之前 | |
| path_expression.go | 5 年之前 | |
| path_processor.go | 5 年之前 | |
| request.go | 5 年之前 | |
| response.go | 5 年之前 | |
| route.go | 5 年之前 | |
| route_builder.go | 5 年之前 | |
| router.go | 5 年之前 | |
| service_error.go | 5 年之前 | |
| web_service.go | 5 年之前 | |
| web_service_container.go | 5 年之前 | |
package for building REST-style Web Services using Google Go
REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping:
ws := new(restful.WebService)
ws.
Path("/users").
Consumes(restful.MIME_XML, restful.MIME_JSON).
Produces(restful.MIME_JSON, restful.MIME_XML)
ws.Route(ws.GET("/{user-id}").To(u.findUser).
Doc("get a user").
Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")).
Writes(User{}))
...
func (u UserResource) findUser(request *restful.Request, response *restful.Response) {
id := request.PathParameter("user-id")
...
}
There are several hooks to customize the behavior of the go-restful package.
go build -tags=jsoniter .TODO: write examples of these.
Type git shortlog -s for a full list of contributors.
© 2012 - 2018, http://ernestmicklei.com. MIT License. Contributions are welcome.