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
8a17ea48
Commit
8a17ea48
authored
Apr 16, 2015
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Delete method to endpoints client.
parent
f6238fa6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
endpoints.go
pkg/client/endpoints.go
+6
-0
fake_endpoints.go
pkg/client/testclient/fake_endpoints.go
+5
-0
No files found.
pkg/client/endpoints.go
View file @
8a17ea48
...
@@ -35,6 +35,7 @@ type EndpointsInterface interface {
...
@@ -35,6 +35,7 @@ type EndpointsInterface interface {
Create
(
endpoints
*
api
.
Endpoints
)
(
*
api
.
Endpoints
,
error
)
Create
(
endpoints
*
api
.
Endpoints
)
(
*
api
.
Endpoints
,
error
)
List
(
selector
labels
.
Selector
)
(
*
api
.
EndpointsList
,
error
)
List
(
selector
labels
.
Selector
)
(
*
api
.
EndpointsList
,
error
)
Get
(
name
string
)
(
*
api
.
Endpoints
,
error
)
Get
(
name
string
)
(
*
api
.
Endpoints
,
error
)
Delete
(
name
string
)
error
Update
(
endpoints
*
api
.
Endpoints
)
(
*
api
.
Endpoints
,
error
)
Update
(
endpoints
*
api
.
Endpoints
)
(
*
api
.
Endpoints
,
error
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
}
}
...
@@ -76,6 +77,11 @@ func (c *endpoints) Get(name string) (result *api.Endpoints, err error) {
...
@@ -76,6 +77,11 @@ func (c *endpoints) Get(name string) (result *api.Endpoints, err error) {
return
return
}
}
// Delete takes the name of the endpoint, and returns an error if one occurs
func
(
c
*
endpoints
)
Delete
(
name
string
)
error
{
return
c
.
r
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"endpoints"
)
.
Name
(
name
)
.
Do
()
.
Error
()
}
// Watch returns a watch.Interface that watches the requested endpoints for a service.
// Watch returns a watch.Interface that watches the requested endpoints for a service.
func
(
c
*
endpoints
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
{
func
(
c
*
endpoints
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
{
return
c
.
r
.
Get
()
.
return
c
.
r
.
Get
()
.
...
...
pkg/client/testclient/fake_endpoints.go
View file @
8a17ea48
...
@@ -45,6 +45,11 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
...
@@ -45,6 +45,11 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
return
obj
.
(
*
api
.
Endpoints
),
err
return
obj
.
(
*
api
.
Endpoints
),
err
}
}
func
(
c
*
FakeEndpoints
)
Delete
(
name
string
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
FakeAction
{
Action
:
"delete-endpoints"
,
Value
:
name
},
&
api
.
Endpoints
{})
return
err
}
func
(
c
*
FakeEndpoints
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
{
func
(
c
*
FakeEndpoints
)
Watch
(
label
labels
.
Selector
,
field
fields
.
Selector
,
resourceVersion
string
)
(
watch
.
Interface
,
error
)
{
c
.
Fake
.
Actions
=
append
(
c
.
Fake
.
Actions
,
FakeAction
{
Action
:
"watch-endpoints"
,
Value
:
resourceVersion
})
c
.
Fake
.
Actions
=
append
(
c
.
Fake
.
Actions
,
FakeAction
{
Action
:
"watch-endpoints"
,
Value
:
resourceVersion
})
return
c
.
Fake
.
Watch
,
c
.
Fake
.
Err
return
c
.
Fake
.
Watch
,
c
.
Fake
.
Err
...
...
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