adding the glide Vendor Package Management support

This commit is contained in:
Ramakrishnan, Kuralamudhan
2017-06-29 17:15:54 +01:00
parent 6b266a44f1
commit 557d35d977
4041 changed files with 1920513 additions and 12685 deletions

View File

@@ -0,0 +1,26 @@
package main
import (
. "github.com/emicklei/go-restful"
"io"
"net/http"
)
// This example shows how to a Route that matches the "tail" of a path.
// Requires the use of a CurlyRouter and the star "*" path parameter pattern.
//
// GET http://localhost:8080/basepath/some/other/location/test.xml
func main() {
DefaultContainer.Router(CurlyRouter{})
ws := new(WebService)
ws.Route(ws.GET("/basepath/{resource:*}").To(staticFromPathParam))
Add(ws)
println("[go-restful] serve path tails from http://localhost:8080/basepath")
http.ListenAndServe(":8080", nil)
}
func staticFromPathParam(req *Request, resp *Response) {
io.WriteString(resp, "Tail="+req.PathParameter("resource"))
}