generated from kedacore/github-template
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jorge Turrado <[email protected]>
- Loading branch information
Showing
5 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package k8s | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
v1 "k8s.io/api/core/v1" | ||
"k8s.io/apimachinery/pkg/watch" | ||
) | ||
|
||
// EndpointsCache is a simple cache of endpoints. | ||
// It allows callers to quickly get given endpoints in a given | ||
// namespace, or watch for changes to specific endpoints, all | ||
// without incurring the cost of issuing a network request | ||
// to the Kubernetes API | ||
type EndpointsCache interface { | ||
json.Marshaler | ||
// Get gets the endpoints with the given name | ||
// in the given namespace from the cache. | ||
// | ||
// If the endpoints doesn't exist in the cache, it | ||
// will be requested from the backing store (most commonly | ||
// the Kubernetes API server) | ||
Get(namespace, name string) (v1.Endpoints, error) | ||
// Watch opens a watch stream for the endpoints with | ||
// the given name in the given namespace from the cache. | ||
// | ||
// If the endpoints don't exist in the cache, it | ||
// will be requested from the backing store (most commonly | ||
// the Kubernetes API server) | ||
Watch(namespace, name string) (watch.Interface, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters