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