juju: github.com/juju/juju/container/factory Index | Files

package factory

import "github.com/juju/juju/container/factory"


Package Files



var NewContainerManager = func(forType instance.ContainerType, conf container.ManagerConfig) (container.Manager, error) {
    switch forType {
    case instance.LXD:
        svr, err := lxd.MaybeNewLocalServer()
        if err != nil {
            return nil, errors.Annotate(err, "creating LXD container manager")
        return lxd.NewContainerManager(conf, svr)
    case instance.KVM:
        return kvm.NewContainerManager(conf)
    return nil, errors.Errorf("unknown container type: %q", forType)

NewContainerManager creates the appropriate container.Manager for the specified container type.

Package factory imports 5 packages (graph) and is imported by 64 packages. Updated 2018-12-23. Refresh now. Tools for package owners.