added etcd support
This commit is contained in:
parent
59d44932a4
commit
85a8ba23bd
21 changed files with 767 additions and 247 deletions
|
|
@ -8,7 +8,8 @@ import (
|
|||
)
|
||||
|
||||
type Cluster interface {
|
||||
Start(logr.Logger, *config.Config) error
|
||||
Start(*config.Config) error
|
||||
SetCallbacks(Callbacks) error
|
||||
Stepdown()
|
||||
Stop()
|
||||
}
|
||||
|
|
@ -19,7 +20,13 @@ type KV interface {
|
|||
Delete(k string) error
|
||||
}
|
||||
|
||||
type Callbacks struct {
|
||||
Leader func(context.Context, KV)
|
||||
Follower func(context.Context, KV)
|
||||
type CallbackContext interface {
|
||||
logr.Logger
|
||||
KV
|
||||
ID() string
|
||||
}
|
||||
|
||||
type Callbacks struct {
|
||||
Leader func(context.Context, CallbackContext)
|
||||
Follower func(context.Context, CallbackContext)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue