add get available versions commmand

This commit is contained in:
Young
2015-03-17 13:51:18 +00:00
parent 5c99bc9e96
commit 97b647207e
4 changed files with 72 additions and 0 deletions

View File

@@ -16,6 +16,10 @@ limitations under the License.
package api
import (
"strings"
)
// This file contains API types that are unversioned.
// APIVersions lists the api versions that are available, to allow
@@ -49,3 +53,12 @@ func FieldSelectorQueryParam(version string) string {
}
return "field-selector"
}
// String returns available api versions as a human-friendly version string.
func (apiVersions APIVersions) String() string {
return strings.Join(apiVersions.Versions, ",")
}
func (apiVersions APIVersions) GoString() string {
return apiVersions.String()
}