github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/internal/states/remote/remote.go (about)

     1  package remote
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/internal/states/statemgr"
     5  )
     6  
     7  // Client is the interface that must be implemented for a remote state
     8  // driver. It supports dumb put/get/delete, and the higher level structs
     9  // handle persisting the state properly here.
    10  type Client interface {
    11  	Get() (*Payload, error)
    12  	Put([]byte) error
    13  	Delete() error
    14  }
    15  
    16  // ClientForcePusher is an optional interface that allows a remote
    17  // state to force push by managing a flag on the client that is
    18  // toggled on by a call to EnableForcePush.
    19  type ClientForcePusher interface {
    20  	Client
    21  	EnableForcePush()
    22  }
    23  
    24  // ClientLocker is an optional interface that allows a remote state
    25  // backend to enable state lock/unlock.
    26  type ClientLocker interface {
    27  	Client
    28  	statemgr.Locker
    29  }
    30  
    31  // Payload is the return value from the remote state storage.
    32  type Payload struct {
    33  	MD5  []byte
    34  	Data []byte
    35  }
    36  
    37  // Factory is the factory function to create a remote client.
    38  type Factory func(map[string]string) (Client, error)