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
7f28eda9
Commit
7f28eda9
authored
Aug 07, 2016
by
Hongchao Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage interface: remove Backends()
parent
e19ea41a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
41 deletions
+0
-41
cacher.go
pkg/storage/cacher.go
+0
-5
etcd_helper.go
pkg/storage/etcd/etcd_helper.go
+0
-17
store.go
pkg/storage/etcd3/store.go
+0
-14
interfaces.go
pkg/storage/interfaces.go
+0
-5
No files found.
pkg/storage/cacher.go
View file @
7f28eda9
...
@@ -244,11 +244,6 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
...
@@ -244,11 +244,6 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
}
}
// Implements storage.Interface.
// Implements storage.Interface.
func
(
c
*
Cacher
)
Backends
(
ctx
context
.
Context
)
[]
string
{
return
c
.
storage
.
Backends
(
ctx
)
}
// Implements storage.Interface.
func
(
c
*
Cacher
)
Versioner
()
Versioner
{
func
(
c
*
Cacher
)
Versioner
()
Versioner
{
return
c
.
storage
.
Versioner
()
return
c
.
storage
.
Versioner
()
}
}
...
...
pkg/storage/etcd/etcd_helper.go
View file @
7f28eda9
...
@@ -91,23 +91,6 @@ func (h *etcdHelper) Codec() runtime.Codec {
...
@@ -91,23 +91,6 @@ func (h *etcdHelper) Codec() runtime.Codec {
}
}
// Implements storage.Interface.
// Implements storage.Interface.
func
(
h
*
etcdHelper
)
Backends
(
ctx
context
.
Context
)
[]
string
{
if
ctx
==
nil
{
glog
.
Errorf
(
"Context is nil"
)
}
members
,
err
:=
h
.
etcdMembersAPI
.
List
(
ctx
)
if
err
!=
nil
{
glog
.
Errorf
(
"Error obtaining etcd members list: %q"
,
err
)
return
nil
}
mlist
:=
[]
string
{}
for
_
,
member
:=
range
members
{
mlist
=
append
(
mlist
,
member
.
ClientURLs
...
)
}
return
mlist
}
// Implements storage.Interface.
func
(
h
*
etcdHelper
)
Versioner
()
storage
.
Versioner
{
func
(
h
*
etcdHelper
)
Versioner
()
storage
.
Versioner
{
return
h
.
versioner
return
h
.
versioner
}
}
...
...
pkg/storage/etcd3/store.go
View file @
7f28eda9
...
@@ -73,20 +73,6 @@ func newStore(c *clientv3.Client, codec runtime.Codec, prefix string) *store {
...
@@ -73,20 +73,6 @@ func newStore(c *clientv3.Client, codec runtime.Codec, prefix string) *store {
}
}
}
}
// Backends implements storage.Interface.Backends.
func
(
s
*
store
)
Backends
(
ctx
context
.
Context
)
[]
string
{
resp
,
err
:=
s
.
client
.
MemberList
(
ctx
)
if
err
!=
nil
{
glog
.
Errorf
(
"Error obtaining etcd members list: %q"
,
err
)
return
nil
}
var
mlist
[]
string
for
_
,
member
:=
range
resp
.
Members
{
mlist
=
append
(
mlist
,
member
.
ClientURLs
...
)
}
return
mlist
}
// Codec implements storage.Interface.Codec.
// Codec implements storage.Interface.Codec.
func
(
s
*
store
)
Codec
()
runtime
.
Codec
{
func
(
s
*
store
)
Codec
()
runtime
.
Codec
{
return
s
.
codec
return
s
.
codec
...
...
pkg/storage/interfaces.go
View file @
7f28eda9
...
@@ -112,11 +112,6 @@ func NewUIDPreconditions(uid string) *Preconditions {
...
@@ -112,11 +112,6 @@ func NewUIDPreconditions(uid string) *Preconditions {
// Interface offers a common interface for object marshaling/unmarshaling operations and
// Interface offers a common interface for object marshaling/unmarshaling operations and
// hides all the storage-related operations behind it.
// hides all the storage-related operations behind it.
type
Interface
interface
{
type
Interface
interface
{
// Returns list of servers addresses of the underyling database.
// TODO: This method is used only in a single place. Consider refactoring and getting rid
// of this method from the interface.
Backends
(
ctx
context
.
Context
)
[]
string
// Returns Versioner associated with this interface.
// Returns Versioner associated with this interface.
Versioner
()
Versioner
Versioner
()
Versioner
...
...
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