![]() |
há 8 anos atrás | |
---|---|---|
.. | ||
examples | há 8 anos atrás | |
log | há 8 anos atrás | |
swagger | há 8 anos atrás | |
.gitignore | há 8 anos atrás | |
CHANGES.md | há 8 anos atrás | |
LICENSE | há 8 anos atrás | |
README.md | há 8 anos atrás | |
Srcfile | há 8 anos atrás | |
bench_curly_test.go | há 8 anos atrás | |
bench_test.go | há 8 anos atrás | |
bench_test.sh | há 8 anos atrás | |
compress.go | há 8 anos atrás | |
compress_test.go | há 8 anos atrás | |
compressor_cache.go | há 8 anos atrás | |
compressor_pools.go | há 8 anos atrás | |
compressors.go | há 8 anos atrás | |
constants.go | há 8 anos atrás | |
container.go | há 8 anos atrás | |
container_test.go | há 8 anos atrás | |
cors_filter.go | há 8 anos atrás | |
cors_filter_test.go | há 8 anos atrás | |
coverage.sh | há 8 anos atrás | |
curly.go | há 8 anos atrás | |
curly_route.go | há 8 anos atrás | |
curly_test.go | há 8 anos atrás | |
doc.go | há 8 anos atrás | |
doc_examples_test.go | há 8 anos atrás | |
entity_accessors.go | há 8 anos atrás | |
entity_accessors_test.go | há 8 anos atrás | |
filter.go | há 8 anos atrás | |
filter_test.go | há 8 anos atrás | |
install.sh | há 8 anos atrás | |
jsr311.go | há 8 anos atrás | |
jsr311_test.go | há 8 anos atrás | |
logger.go | há 8 anos atrás | |
mime.go | há 8 anos atrás | |
mime_test.go | há 8 anos atrás | |
options_filter.go | há 8 anos atrás | |
options_filter_test.go | há 8 anos atrás | |
parameter.go | há 8 anos atrás | |
path_expression.go | há 8 anos atrás | |
path_expression_test.go | há 8 anos atrás | |
request.go | há 8 anos atrás | |
request_test.go | há 8 anos atrás | |
response.go | há 8 anos atrás | |
response_test.go | há 8 anos atrás | |
route.go | há 8 anos atrás | |
route_builder.go | há 8 anos atrás | |
route_builder_test.go | há 8 anos atrás | |
route_test.go | há 8 anos atrás | |
router.go | há 8 anos atrás | |
service_error.go | há 8 anos atrás | |
tracer_test.go | há 8 anos atrás | |
web_service.go | há 8 anos atrás | |
web_service_container.go | há 8 anos atrás | |
web_service_test.go | há 8 anos atrás |
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")
...
}
(c) 2012 - 2015, http://ernestmicklei.com. MIT License
Type git shortlog -s
for a full list of contributors.