mirror of https://github.com/status-im/consul.git
Stubs
This commit is contained in:
parent
148607ac88
commit
d96636ced1
|
@ -33,6 +33,9 @@ func NewFSM() (*consulFSM, error) {
|
|||
}
|
||||
|
||||
func (c *consulFSM) Apply([]byte) interface{} {
|
||||
// TODO: Decode
|
||||
|
||||
// TODO: Execute
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -41,7 +44,19 @@ func (c *consulFSM) Snapshot() (raft.FSMSnapshot, error) {
|
|||
return snap, nil
|
||||
}
|
||||
|
||||
func (c *consulFSM) Restore(io.ReadCloser) error {
|
||||
func (c *consulFSM) Restore(old io.ReadCloser) error {
|
||||
defer old.Close()
|
||||
|
||||
// Create a new state store
|
||||
state, err := NewStateStore()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: Populate the new state
|
||||
|
||||
// Do an atomic flip, safe since Apply is not called concurrently
|
||||
c.state = state
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue