github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/apiserver/proxyupdater/shims.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package proxyupdater
     5  
     6  import (
     7  	"github.com/juju/juju/apiserver/common"
     8  	"github.com/juju/juju/environs/config"
     9  	"github.com/juju/juju/network"
    10  	"github.com/juju/juju/state"
    11  )
    12  
    13  func init() {
    14  	common.RegisterStandardFacade("ProxyUpdater", 1, NewAPI)
    15  }
    16  
    17  // stateShim forwards and adapts state.State methods to Backend
    18  type stateShim struct {
    19  	st *state.State
    20  }
    21  
    22  func (s *stateShim) ModelConfig() (*config.Config, error) {
    23  	return s.st.ModelConfig()
    24  }
    25  
    26  func (s *stateShim) APIHostPorts() ([][]network.HostPort, error) {
    27  	return s.st.APIHostPorts()
    28  }
    29  
    30  func (s *stateShim) WatchAPIHostPorts() state.NotifyWatcher {
    31  	return s.st.WatchAPIHostPorts()
    32  }
    33  
    34  func (s *stateShim) WatchForModelConfigChanges() state.NotifyWatcher {
    35  	return s.st.WatchForModelConfigChanges()
    36  }