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
41756884
Commit
41756884
authored
Feb 05, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add restmapper Stringer methods for debugging
parent
6485584f
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 @
41756884
...
@@ -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