Documentation ¶
Index ¶
- func LockWithContext(ctx context.Context, s State, info *LockInfo) (string, error)
- func TestState(t *testing.T, s State)
- func TestStateInitial() *states.State
- type BackupState
- type InmemState
- type LocalState
- func (s *LocalState) Lock(info *LockInfo) (string, error)
- func (s *LocalState) PersistState() error
- func (s *LocalState) RefreshState() error
- func (s *LocalState) SetState(state *terraform.State)
- func (s *LocalState) State() *terraform.State
- func (s *LocalState) Unlock(id string) error
- func (s *LocalState) WriteState(state *terraform.State) error
- type LockDisabled
- type LockError
- type LockInfo
- type Locker
- type State
- type StatePersister
- type StateReader
- type StateRefresher
- type StateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LockWithContext ¶ added in v0.9.3
Lock the state, using the provided context for timeout and cancellation. This backs off slightly to an upper limit.
func TestState ¶
TestState is a helper for testing state implementations. It is expected that the given implementation is pre-loaded with the TestStateInitial state.
func TestStateInitial ¶
TestStateInitial is the initial state that a State should have for TestState.
Types ¶
type BackupState ¶
BackupState wraps a State that backs up the state on the first time that a WriteState or PersistState is called.
If Path exists, it will be overwritten.
func (*BackupState) Lock ¶ added in v0.9.0
func (s *BackupState) Lock(info *LockInfo) (string, error)
func (*BackupState) PersistState ¶
func (s *BackupState) PersistState() error
func (*BackupState) RefreshState ¶
func (s *BackupState) RefreshState() error
func (*BackupState) State ¶
func (s *BackupState) State() *states.State
func (*BackupState) Unlock ¶ added in v0.9.0
func (s *BackupState) Unlock(id string) error
func (*BackupState) WriteState ¶
func (s *BackupState) WriteState(state *states.State) error
type InmemState ¶
type InmemState struct {
// contains filtered or unexported fields
}
InmemState is an in-memory state storage.
func (*InmemState) PersistState ¶
func (s *InmemState) PersistState() error
func (*InmemState) RefreshState ¶
func (s *InmemState) RefreshState() error
func (*InmemState) State ¶
func (s *InmemState) State() *terraform.State
func (*InmemState) Unlock ¶ added in v0.9.3
func (s *InmemState) Unlock(string) error
func (*InmemState) WriteState ¶
func (s *InmemState) WriteState(state *terraform.State) error
type LocalState ¶
type LocalState struct { // Path is the path to read the state from. PathOut is the path to // write the state to. If PathOut is not specified, Path will be used. // If PathOut already exists, it will be overwritten. Path string PathOut string // contains filtered or unexported fields }
LocalState manages a state storage that is local to the filesystem.
func (*LocalState) Lock ¶ added in v0.9.0
func (s *LocalState) Lock(info *LockInfo) (string, error)
Lock implements a local filesystem state.Locker.
func (*LocalState) PersistState ¶
func (s *LocalState) PersistState() error
PersistState for LocalState is a no-op since WriteState always persists.
StatePersister impl.
func (*LocalState) SetState ¶
func (s *LocalState) SetState(state *terraform.State)
SetState will force a specific state in-memory for this local state.
func (*LocalState) Unlock ¶ added in v0.9.0
func (s *LocalState) Unlock(id string) error
func (*LocalState) WriteState ¶
func (s *LocalState) WriteState(state *terraform.State) error
WriteState for LocalState always persists the state as well. TODO: this should use a more robust method of writing state, by first writing to a temp file on the same filesystem, and renaming the file over the original.
StateWriter impl.
type LockDisabled ¶ added in v0.9.0
type LockDisabled struct { // We can't embed State directly since Go dislikes that a field is // State and State interface has a method State Inner State }
LockDisabled implements State and Locker but disables state locking. If State doesn't support locking, this is a no-op. This is useful for easily disabling locking of an existing state or for tests.
func (*LockDisabled) Lock ¶ added in v0.9.0
func (s *LockDisabled) Lock(info *LockInfo) (string, error)
func (*LockDisabled) PersistState ¶ added in v0.9.0
func (s *LockDisabled) PersistState() error
func (*LockDisabled) RefreshState ¶ added in v0.9.0
func (s *LockDisabled) RefreshState() error
func (*LockDisabled) State ¶ added in v0.9.0
func (s *LockDisabled) State() *states.State
func (*LockDisabled) Unlock ¶ added in v0.9.0
func (s *LockDisabled) Unlock(id string) error
func (*LockDisabled) WriteState ¶ added in v0.9.0
func (s *LockDisabled) WriteState(v *states.State) error
type LockInfo ¶ added in v0.9.0
LockInfo is a deprecated lias for statemgr.LockInfo
func NewLockInfo ¶ added in v0.9.0
func NewLockInfo() *LockInfo
Generate a LockInfo structure, populating the required fields.
type StatePersister ¶
StatePersister is a deprecated alias for statemgr.Persister
type StateReader ¶
StateReader is a deprecated alias for statemgr.Reader
type StateRefresher ¶
StateRefresher is a deprecated alias for statemgr.Refresher
type StateWriter ¶
StateWriter is a deprecated alias for statemgr.Writer