Documentation ¶
Index ¶
- Constants
- Variables
- func TestClient(t *testing.T, c Client)
- func TestRemoteLocks(t *testing.T, a, b Client)
- type ArtifactoryClient
- type AtlasClient
- type AzureClient
- type Client
- type ClientLocker
- type EtcdClient
- type Factory
- type FileClient
- type GCSClient
- type HTTPClient
- type InmemClient
- type MantaClient
- type Payload
- type S3Client
- type State
- type SwiftClient
Constants ¶
const ARTIF_TFSTATE_NAME = "terraform.tfstate"
const DEFAULT_OBJECT_NAME = "terraform.tfstate"
const TFSTATE_NAME = "tfstate.tf"
Variables ¶
var BuiltinClients = map[string]Factory{
"artifactory": artifactoryFactory,
"atlas": atlasFactory,
"azure": azureFactory,
"etcd": etcdFactory,
"gcs": gcsFactory,
"http": httpFactory,
"local": fileFactory,
"s3": s3Factory,
"swift": swiftFactory,
"manta": mantaFactory,
}
BuiltinClients is the list of built-in clients that can be used with NewClient.
Functions ¶
func TestClient ¶
TestClient is a generic function to test any client.
func TestRemoteLocks ¶
Test the lock implementation for a remote.Client. This test requires 2 client instances, in oder to have multiple remote clients since some implementations may tie the client to the lock, or may have reentrant locks.
Types ¶
type ArtifactoryClient ¶ added in v0.6.9
type ArtifactoryClient struct {
// contains filtered or unexported fields
}
func (*ArtifactoryClient) Delete ¶ added in v0.6.9
func (c *ArtifactoryClient) Delete() error
func (*ArtifactoryClient) Get ¶ added in v0.6.9
func (c *ArtifactoryClient) Get() (*Payload, error)
func (*ArtifactoryClient) Put ¶ added in v0.6.9
func (c *ArtifactoryClient) Put(data []byte) error
type AtlasClient ¶
type AtlasClient struct { Server string ServerURL *url.URL User string Name string AccessToken string RunId string HTTPClient *retryablehttp.Client // contains filtered or unexported fields }
AtlasClient implements the Client interface for an Atlas compatible server.
func (*AtlasClient) Delete ¶
func (c *AtlasClient) Delete() error
func (*AtlasClient) Get ¶
func (c *AtlasClient) Get() (*Payload, error)
func (*AtlasClient) Put ¶
func (c *AtlasClient) Put(state []byte) error
type AzureClient ¶ added in v0.7.0
type AzureClient struct {
// contains filtered or unexported fields
}
func (*AzureClient) Delete ¶ added in v0.7.0
func (c *AzureClient) Delete() error
func (*AzureClient) Get ¶ added in v0.7.0
func (c *AzureClient) Get() (*Payload, error)
func (*AzureClient) Put ¶ added in v0.7.0
func (c *AzureClient) Put(data []byte) error
type Client ¶
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 ClientLocker ¶
ClientLocker is an optional interface that allows a remote state backend to enable state lock/unlock.
type EtcdClient ¶ added in v0.6.5
EtcdClient is a remote client that stores data in etcd.
func (*EtcdClient) Delete ¶ added in v0.6.5
func (c *EtcdClient) Delete() error
func (*EtcdClient) Get ¶ added in v0.6.5
func (c *EtcdClient) Get() (*Payload, error)
func (*EtcdClient) Put ¶ added in v0.6.5
func (c *EtcdClient) Put(data []byte) error
type FileClient ¶
type FileClient struct {
Path string
}
FileClient is a remote client that stores data locally on disk. This is only used for development reasons to test remote state... locally.
func (*FileClient) Delete ¶
func (c *FileClient) Delete() error
func (*FileClient) Get ¶
func (c *FileClient) Get() (*Payload, error)
func (*FileClient) Put ¶
func (c *FileClient) Put(data []byte) error
type GCSClient ¶ added in v0.7.0
type GCSClient struct {
// contains filtered or unexported fields
}
type HTTPClient ¶
HTTPClient is a remote client that stores data in Consul or HTTP REST.
func (*HTTPClient) Delete ¶
func (c *HTTPClient) Delete() error
func (*HTTPClient) Get ¶
func (c *HTTPClient) Get() (*Payload, error)
func (*HTTPClient) Put ¶
func (c *HTTPClient) Put(data []byte) error
type InmemClient ¶
InmemClient is a Client implementation that stores data in memory.
func (*InmemClient) Delete ¶
func (c *InmemClient) Delete() error
func (*InmemClient) Get ¶
func (c *InmemClient) Get() (*Payload, error)
func (*InmemClient) Put ¶
func (c *InmemClient) Put(data []byte) error
type MantaClient ¶ added in v0.7.4
func (*MantaClient) Delete ¶ added in v0.7.4
func (c *MantaClient) Delete() error
func (*MantaClient) Get ¶ added in v0.7.4
func (c *MantaClient) Get() (*Payload, error)
func (*MantaClient) Put ¶ added in v0.7.4
func (c *MantaClient) Put(data []byte) error
type State ¶
type State struct { Client Client // contains filtered or unexported fields }
State implements the State interfaces in the state package to handle reading and writing the remote state. This State on its own does no local caching so every persist will go to the remote storage and local writes will go to memory.
type SwiftClient ¶ added in v0.6.0
type SwiftClient struct {
// contains filtered or unexported fields
}
SwiftClient implements the Client interface for an Openstack Swift server.
func (*SwiftClient) Delete ¶ added in v0.6.0
func (c *SwiftClient) Delete() error
func (*SwiftClient) Get ¶ added in v0.6.0
func (c *SwiftClient) Get() (*Payload, error)
func (*SwiftClient) Put ¶ added in v0.6.0
func (c *SwiftClient) Put(data []byte) error