fix: k8s dependency version: emicklei/go-restful
`emicklei/go-restful` is used by:
- `k8s.io/client-go` (Godeps)
Refs:
- e121606b0d/Godeps/Godeps.json
This commit is contained in:
parent
a7297b49a4
commit
5aa017d9b5
26 changed files with 957 additions and 380 deletions
27
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
27
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
|
@ -1,7 +1,7 @@
|
|||
package restful
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
|
@ -36,9 +36,6 @@ func (w *WebService) SetDynamicRoutes(enable bool) {
|
|||
|
||||
// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it.
|
||||
func (w *WebService) compilePathExpression() {
|
||||
if len(w.rootPath) == 0 {
|
||||
w.Path("/") // lazy initialize path
|
||||
}
|
||||
compiled, err := newPathExpression(w.rootPath)
|
||||
if err != nil {
|
||||
log.Printf("[restful] invalid path:%s because:%v", w.rootPath, err)
|
||||
|
@ -54,12 +51,15 @@ func (w *WebService) ApiVersion(apiVersion string) *WebService {
|
|||
}
|
||||
|
||||
// Version returns the API version for documentation purposes.
|
||||
func (w WebService) Version() string { return w.apiVersion }
|
||||
func (w *WebService) Version() string { return w.apiVersion }
|
||||
|
||||
// Path specifies the root URL template path of the WebService.
|
||||
// All Routes will be relative to this path.
|
||||
func (w *WebService) Path(root string) *WebService {
|
||||
w.rootPath = root
|
||||
if len(w.rootPath) == 0 {
|
||||
w.rootPath = "/"
|
||||
}
|
||||
w.compilePathExpression()
|
||||
return w
|
||||
}
|
||||
|
@ -155,15 +155,20 @@ func (w *WebService) Route(builder *RouteBuilder) *WebService {
|
|||
// RemoveRoute removes the specified route, looks for something that matches 'path' and 'method'
|
||||
func (w *WebService) RemoveRoute(path, method string) error {
|
||||
if !w.dynamicRoutes {
|
||||
return fmt.Errorf("dynamic routes are not enabled.")
|
||||
return errors.New("dynamic routes are not enabled.")
|
||||
}
|
||||
w.routesLock.Lock()
|
||||
defer w.routesLock.Unlock()
|
||||
newRoutes := make([]Route, (len(w.routes) - 1))
|
||||
current := 0
|
||||
for ix := range w.routes {
|
||||
if w.routes[ix].Method == method && w.routes[ix].Path == path {
|
||||
w.routes = append(w.routes[:ix], w.routes[ix+1:]...)
|
||||
continue
|
||||
}
|
||||
newRoutes[current] = w.routes[ix]
|
||||
current = current + 1
|
||||
}
|
||||
w.routes = newRoutes
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -187,7 +192,7 @@ func (w *WebService) Consumes(accepts ...string) *WebService {
|
|||
}
|
||||
|
||||
// Routes returns the Routes associated with this WebService
|
||||
func (w WebService) Routes() []Route {
|
||||
func (w *WebService) Routes() []Route {
|
||||
if !w.dynamicRoutes {
|
||||
return w.routes
|
||||
}
|
||||
|
@ -202,12 +207,12 @@ func (w WebService) Routes() []Route {
|
|||
}
|
||||
|
||||
// RootPath returns the RootPath associated with this WebService. Default "/"
|
||||
func (w WebService) RootPath() string {
|
||||
func (w *WebService) RootPath() string {
|
||||
return w.rootPath
|
||||
}
|
||||
|
||||
// PathParameters return the path parameter names for (shared amoung its Routes)
|
||||
func (w WebService) PathParameters() []*Parameter {
|
||||
func (w *WebService) PathParameters() []*Parameter {
|
||||
return w.pathParameters
|
||||
}
|
||||
|
||||
|
@ -224,7 +229,7 @@ func (w *WebService) Doc(plainText string) *WebService {
|
|||
}
|
||||
|
||||
// Documentation returns it.
|
||||
func (w WebService) Documentation() string {
|
||||
func (w *WebService) Documentation() string {
|
||||
return w.documentation
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue