mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 08:51:02 -06:00
ebcf7455eb
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf". Signed-off-by: Jakub Martin <kubam@spacelift.io> * Gofmt. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Regenerate protobuf. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Fix comments. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Undo issue and pull request link changes. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Undo comment changes. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Fix comment. Signed-off-by: Jakub Martin <kubam@spacelift.io> * Undo some link changes. Signed-off-by: Jakub Martin <kubam@spacelift.io> * make generate && make protobuf Signed-off-by: Jakub Martin <kubam@spacelift.io> --------- Signed-off-by: Jakub Martin <kubam@spacelift.io>
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package remote
|
|
|
|
import (
|
|
"github.com/placeholderplaceholderplaceholder/opentf/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)
|