1
0
mirror of https://github.com/rancher/types.git synced 2025-04-27 02:10:48 +00:00

Add peer manager

This commit is contained in:
Darren Shepherd 2018-09-17 15:58:44 -07:00 committed by Craig Jellick
parent 92b37efdc7
commit 62111462fe
2 changed files with 17 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import (
projectSchema "github.com/rancher/types/apis/project.cattle.io/v3/schema"
rbacv1 "github.com/rancher/types/apis/rbac.authorization.k8s.io/v1"
"github.com/rancher/types/config/dialer"
"github.com/rancher/types/peermanager"
"github.com/rancher/types/user"
"github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
@ -51,7 +52,7 @@ type ScaledContext struct {
AccessControl types.AccessControl
Dialer dialer.Factory
UserManager user.Manager
Leader bool
PeerManager peermanager.PeerManager
Management managementv3.Interface
Project projectv3.Interface

View File

@ -0,0 +1,15 @@
package peermanager
type Peers struct {
SelfID string
IDs []string
Ready bool
Leader bool
}
type PeerManager interface {
IsLeader() bool
Leader()
AddListener(l chan<- Peers)
RemoveListener(l chan<- Peers)
}