Update the path param name to namespace instead of namespaces

This commit is contained in:
nikhiljindal
2015-06-18 13:20:28 -07:00
parent 11f9fd1dcd
commit 6c6398edaa
5 changed files with 445 additions and 459 deletions

View File

@@ -115,10 +115,8 @@ type RESTScope interface {
// ParamName is the optional name of the parameter that should be inserted in the resource url
// If empty, no param will be inserted
ParamName() string
// ParamPath is a boolean that controls how the parameter is manifested in resource paths
// If true, this parameter is encoded in path (i.e. /{paramName}/{paramValue})
// If false, this parameter is encoded in query (i.e. ?{paramName}={paramValue})
ParamPath() bool
// ArgumentName is the optional name that should be used for the variable holding the value.
ArgumentName() string
// ParamDescription is the optional description to use to document the parameter in api documentation
ParamDescription() string
}

View File

@@ -26,7 +26,7 @@ import (
type restScope struct {
name RESTScopeName
paramName string
paramPath bool
argumentName string
paramDescription string
}
@@ -36,24 +36,17 @@ func (r *restScope) Name() RESTScopeName {
func (r *restScope) ParamName() string {
return r.paramName
}
func (r *restScope) ParamPath() bool {
return r.paramPath
func (r *restScope) ArgumentName() string {
return r.argumentName
}
func (r *restScope) ParamDescription() string {
return r.paramDescription
}
var RESTScopeNamespaceLegacy = &restScope{
name: RESTScopeNameNamespace,
paramName: "namespace",
paramPath: false,
paramDescription: "object name and auth scope, such as for teams and projects",
}
var RESTScopeNamespace = &restScope{
name: RESTScopeNameNamespace,
paramName: "namespaces",
paramPath: true,
argumentName: "namespace",
paramDescription: "object name and auth scope, such as for teams and projects",
}