Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1f113d6a
Commit
1f113d6a
authored
Feb 06, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20730 from deads2k/add-string-for-debug
Auto commit by PR queue bot
parents
e76caf43
41756884
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
restmapper.go
pkg/api/meta/restmapper.go
+15
-0
No files found.
pkg/api/meta/restmapper.go
View file @
1f113d6a
...
@@ -83,6 +83,10 @@ type DefaultRESTMapper struct {
...
@@ -83,6 +83,10 @@ type DefaultRESTMapper struct {
interfacesFunc
VersionInterfacesFunc
interfacesFunc
VersionInterfacesFunc
}
}
func
(
m
*
DefaultRESTMapper
)
String
()
string
{
return
fmt
.
Sprintf
(
"DefaultRESTMapper{kindToPluralResource=%v}"
,
m
.
kindToPluralResource
)
}
var
_
RESTMapper
=
&
DefaultRESTMapper
{}
var
_
RESTMapper
=
&
DefaultRESTMapper
{}
// VersionInterfacesFunc returns the appropriate typer, and metadata accessor for a
// VersionInterfacesFunc returns the appropriate typer, and metadata accessor for a
...
@@ -511,6 +515,17 @@ func (m *DefaultRESTMapper) ResourceIsValid(resource unversioned.GroupVersionRes
...
@@ -511,6 +515,17 @@ func (m *DefaultRESTMapper) ResourceIsValid(resource unversioned.GroupVersionRes
// MultiRESTMapper is a wrapper for multiple RESTMappers.
// MultiRESTMapper is a wrapper for multiple RESTMappers.
type
MultiRESTMapper
[]
RESTMapper
type
MultiRESTMapper
[]
RESTMapper
func
(
m
MultiRESTMapper
)
String
()
string
{
nested
:=
[]
string
{}
for
_
,
t
:=
range
m
{
currString
:=
fmt
.
Sprintf
(
"%v"
,
t
)
splitStrings
:=
strings
.
Split
(
currString
,
"
\n
"
)
nested
=
append
(
nested
,
strings
.
Join
(
splitStrings
,
"
\n\t
"
))
}
return
fmt
.
Sprintf
(
"MultiRESTMapper{
\n\t
%s
\n
}"
,
strings
.
Join
(
nested
,
"
\n\t
"
))
}
// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod)
// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod)
// This implementation supports multiple REST schemas and return the first match.
// This implementation supports multiple REST schemas and return the first match.
func
(
m
MultiRESTMapper
)
ResourceSingularizer
(
resource
string
)
(
singular
string
,
err
error
)
{
func
(
m
MultiRESTMapper
)
ResourceSingularizer
(
resource
string
)
(
singular
string
,
err
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment