2024-02-08 03:48:59 -06:00
|
|
|
// Copyright (c) The OpenTofu Authors
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
2023-05-02 10:33:06 -05:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2018-06-08 18:18:30 -05:00
|
|
|
package statemgr
|
|
|
|
|
2018-07-13 16:44:13 -05:00
|
|
|
// Storage is the union of Transient and Persistent, for state managers that
|
|
|
|
// have both transient and persistent storage.
|
|
|
|
//
|
|
|
|
// Types implementing this interface coordinate between their Transient
|
|
|
|
// and Persistent implementations so that the persistent operations read
|
|
|
|
// or write the transient store.
|
|
|
|
type Storage interface {
|
|
|
|
Transient
|
|
|
|
Persistent
|
|
|
|
}
|
|
|
|
|
2018-06-08 18:18:30 -05:00
|
|
|
// Full is the union of all of the more-specific state interfaces.
|
|
|
|
//
|
|
|
|
// This interface may grow over time, so state implementations aiming to
|
|
|
|
// implement it may need to be modified for future changes. To ensure that
|
|
|
|
// this need can be detected, always include a statement nearby the declaration
|
|
|
|
// of the implementing type that will fail at compile time if the interface
|
|
|
|
// isn't satisfied, such as:
|
|
|
|
//
|
2022-08-17 13:46:02 -05:00
|
|
|
// var _ statemgr.Full = (*ImplementingType)(nil)
|
2018-06-08 18:18:30 -05:00
|
|
|
type Full interface {
|
2018-07-13 16:44:13 -05:00
|
|
|
Storage
|
2018-06-08 18:18:30 -05:00
|
|
|
Locker
|
|
|
|
}
|