github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/apiserver/environmentmanager/state.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package environmentmanager 5 6 import ( 7 "github.com/juju/names" 8 9 "github.com/juju/juju/environs/config" 10 "github.com/juju/juju/state" 11 ) 12 13 var getState = func(st *state.State) stateInterface { 14 return stateShim{st} 15 } 16 17 type stateInterface interface { 18 EnvironmentsForUser(names.UserTag) ([]*state.UserEnvironment, error) 19 IsSystemAdministrator(user names.UserTag) (bool, error) 20 NewEnvironment(*config.Config, names.UserTag) (*state.Environment, *state.State, error) 21 StateServerEnvironment() (*state.Environment, error) 22 } 23 24 type stateShim struct { 25 *state.State 26 }