remove the legacy Inmem remote state
moved to a new backend
This commit is contained in:
parent
d710ecbd4d
commit
7f40f90c4c
|
@ -1,32 +0,0 @@
|
||||||
package remote
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/md5"
|
|
||||||
)
|
|
||||||
|
|
||||||
// InmemClient is a Client implementation that stores data in memory.
|
|
||||||
type InmemClient struct {
|
|
||||||
Data []byte
|
|
||||||
MD5 []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *InmemClient) Get() (*Payload, error) {
|
|
||||||
return &Payload{
|
|
||||||
Data: c.Data,
|
|
||||||
MD5: c.MD5,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *InmemClient) Put(data []byte) error {
|
|
||||||
md5 := md5.Sum(data)
|
|
||||||
|
|
||||||
c.Data = data
|
|
||||||
c.MD5 = md5[:]
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *InmemClient) Delete() error {
|
|
||||||
c.Data = nil
|
|
||||||
c.MD5 = nil
|
|
||||||
return nil
|
|
||||||
}
|
|
|
@ -6,19 +6,6 @@ import (
|
||||||
"github.com/hashicorp/terraform/state"
|
"github.com/hashicorp/terraform/state"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestState(t *testing.T) {
|
|
||||||
s := &State{
|
|
||||||
Client: new(InmemClient),
|
|
||||||
state: state.TestStateInitial(),
|
|
||||||
readState: state.TestStateInitial(),
|
|
||||||
}
|
|
||||||
if err := s.PersistState(); err != nil {
|
|
||||||
t.Fatalf("err: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
state.TestState(t, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestState_impl(t *testing.T) {
|
func TestState_impl(t *testing.T) {
|
||||||
var _ state.StateReader = new(State)
|
var _ state.StateReader = new(State)
|
||||||
var _ state.StateWriter = new(State)
|
var _ state.StateWriter = new(State)
|
||||||
|
|
Loading…
Reference in New Issue