|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
package remote
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/states/statemgr"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@ -38,18 +36,3 @@ type Payload struct {
|
|
|
|
|
|
|
|
|
|
// Factory is the factory function to create a remote client.
|
|
|
|
|
type Factory func(map[string]string) (Client, error)
|
|
|
|
|
|
|
|
|
|
// NewClient returns a new Client with the given type and configuration.
|
|
|
|
|
// The client is looked up in the BuiltinClients variable.
|
|
|
|
|
func NewClient(t string, conf map[string]string) (Client, error) {
|
|
|
|
|
f, ok := BuiltinClients[t]
|
|
|
|
|
if !ok {
|
|
|
|
|
return nil, fmt.Errorf("unknown remote client type: %s", t)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return f(conf)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuiltinClients is the list of built-in clients that can be used with
|
|
|
|
|
// NewClient.
|
|
|
|
|
var BuiltinClients = map[string]Factory{}
|
|
|
|
|
|