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:
parent
92b37efdc7
commit
62111462fe
@ -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
|
||||
|
15
peermanager/peermanager.go
Normal file
15
peermanager/peermanager.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user