vipman/pkg/cluster/cluster.go
2020-11-15 00:30:35 +01:00

25 lines
401 B
Go

package cluster
import (
"context"
"git.giftfish.de/ston1th/vipman/pkg/config"
"github.com/go-logr/logr"
)
type Cluster interface {
Start(logr.Logger, *config.Config) error
Stepdown()
Stop()
}
type KV interface {
Get(k string) []byte
Set(k string, v []byte) error
Delete(k string) error
}
type Callbacks struct {
Leader func(context.Context, KV)
Follower func(context.Context, KV)
}