Files
core/cluster/fsm.go
Ingo Oppermann e6b64dbe97 WIP: raft
2023-04-13 09:42:19 +02:00

35 lines
512 B
Go

package cluster
import (
"io"
"github.com/hashicorp/raft"
)
// Implement a FSM
type fsm struct{}
func NewFSM() (raft.FSM, error) {
return &fsm{}, nil
}
func (f *fsm) Apply(*raft.Log) interface{} {
return nil
}
func (f *fsm) Snapshot() (raft.FSMSnapshot, error) {
return &fsmSnapshot{}, nil
}
func (f *fsm) Restore(snapshot io.ReadCloser) error {
return nil
}
type fsmSnapshot struct{}
func (s *fsmSnapshot) Persist(sink raft.SnapshotSink) error {
return nil
}
func (s *fsmSnapshot) Release() {}