github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/worker/resumer/shim.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package resumer
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  
     9  	"github.com/juju/juju/api/base"
    10  	"github.com/juju/juju/api/resumer"
    11  	"github.com/juju/juju/worker"
    12  )
    13  
    14  // NewFacade returns a useful live implementation for
    15  // ManifoldConfig.NewFacade.
    16  func NewFacade(apiCaller base.APICaller) (Facade, error) {
    17  	return resumer.NewAPI(apiCaller), nil
    18  }
    19  
    20  // NewWorker returns a useful live implementation for
    21  // ManifoldConfig.NewWorker.
    22  func NewWorker(config Config) (worker.Worker, error) {
    23  	worker, err := NewResumer(config)
    24  	if err != nil {
    25  		return nil, errors.Trace(err)
    26  	}
    27  	return worker, nil
    28  }