mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-04 13:17:43 -06:00
f40800b3a4
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
39 lines
998 B
Go
39 lines
998 B
Go
package remote
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/internal/states/statemgr"
|
|
)
|
|
|
|
// Client is the interface that must be implemented for a remote state
|
|
// driver. It supports dumb put/get/delete, and the higher level structs
|
|
// handle persisting the state properly here.
|
|
type Client interface {
|
|
Get() (*Payload, error)
|
|
Put([]byte) error
|
|
Delete() error
|
|
}
|
|
|
|
// ClientForcePusher is an optional interface that allows a remote
|
|
// state to force push by managing a flag on the client that is
|
|
// toggled on by a call to EnableForcePush.
|
|
type ClientForcePusher interface {
|
|
Client
|
|
EnableForcePush()
|
|
}
|
|
|
|
// ClientLocker is an optional interface that allows a remote state
|
|
// backend to enable state lock/unlock.
|
|
type ClientLocker interface {
|
|
Client
|
|
statemgr.Locker
|
|
}
|
|
|
|
// Payload is the return value from the remote state storage.
|
|
type Payload struct {
|
|
MD5 []byte
|
|
Data []byte
|
|
}
|
|
|
|
// Factory is the factory function to create a remote client.
|
|
type Factory func(map[string]string) (Client, error)
|