mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-17 13:11:58 +00:00
Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
26
vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go
generated
vendored
Normal file
26
vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
. "github.com/emicklei/go-restful"
|
||||
)
|
||||
|
||||
// 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"))
|
||||
}
|
||||
Reference in New Issue
Block a user