terraform/state/inmem.go

29 lines
496 B
Go
Raw Normal View History

2015-02-23 18:53:20 +01:00
package state
import (
"github.com/hashicorp/terraform/terraform"
)
// InmemState is an in-memory state storage.
type InmemState struct {
state *terraform.State
}
func (s *InmemState) State() *terraform.State {
2015-02-24 06:36:35 +01:00
return s.state.DeepCopy()
2015-02-23 18:53:20 +01:00
}
func (s *InmemState) RefreshState() error {
return nil
}
func (s *InmemState) WriteState(state *terraform.State) error {
2015-02-24 06:26:33 +01:00
state.IncrementSerialMaybe(s.state)
2015-02-23 18:53:20 +01:00
s.state = state
return nil
}
func (s *InmemState) PersistState() error {
return nil
}