terraform-provider-google/vendor/github.com/hashicorp/terraform/provisioners/factory.go
Riley Karson dbf9188792
Vendor 0.12 SDK (#3432)
```bash
GO111MODULE=on go get github.com/hashicorp/terraform@pluginsdk-v0.12-early7
GO111MODULE=on go mod vendor
GO111MODULE=on go mod tidy
```
2019-04-15 13:39:47 -07:00

20 lines
738 B
Go

package provisioners
// Factory is a function type that creates a new instance of a resource
// provisioner, or returns an error if that is impossible.
type Factory func() (Interface, error)
// FactoryFixed is a helper that creates a Factory that just returns some given
// single provisioner.
//
// Unlike usual factories, the exact same instance is returned for each call
// to the factory and so this must be used in only specialized situations where
// the caller can take care to either not mutate the given provider at all
// or to mutate it in ways that will not cause unexpected behavior for others
// holding the same reference.
func FactoryFixed(p Interface) Factory {
return func() (Interface, error) {
return p, nil
}
}