github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/apiserver/environment/environment.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package environment
     5  
     6  import (
     7  	"github.com/juju/juju/apiserver/common"
     8  	"github.com/juju/juju/state"
     9  )
    10  
    11  func init() {
    12  	common.RegisterStandardFacade("Environment", 0, NewEnvironmentAPI)
    13  }
    14  
    15  // EnvironmentAPI implements the API used by the machine environment worker.
    16  type EnvironmentAPI struct {
    17  	*common.EnvironWatcher
    18  }
    19  
    20  // NewEnvironmentAPI creates a new instance of the Environment API.
    21  func NewEnvironmentAPI(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*EnvironmentAPI, error) {
    22  	return &EnvironmentAPI{
    23  		EnvironWatcher: common.NewEnvironWatcher(st, resources, authorizer),
    24  	}, nil
    25  }