示例#1
0
文件: state.go 项目: bac/juju
// NewState returns a version of the state that provides functionality
// required by agent code.
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, "Agent")
	return &State{
		facade:              facadeCaller,
		ModelWatcher:        common.NewModelWatcher(facadeCaller),
		CloudSpecAPI:        cloudspec.NewCloudSpecAPI(facadeCaller),
		ControllerConfigAPI: common.NewControllerConfig(facadeCaller),
	}
}
示例#2
0
文件: provisioner.go 项目: bac/juju
// NewState creates a new client-side Machiner facade.
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, provisionerFacade)
	return &State{
		ModelWatcher:        common.NewModelWatcher(facadeCaller),
		APIAddresser:        common.NewAPIAddresser(facadeCaller),
		ControllerConfigAPI: common.NewControllerConfig(facadeCaller),
		facade:              facadeCaller,
	}
}
示例#3
0
文件: controller.go 项目: kat-co/juju
// NewClient creates a new `Client` based on an existing authenticated API
// connection.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "Controller")
	return &Client{
		ClientFacade:        frontend,
		facade:              backend,
		ControllerConfigAPI: common.NewControllerConfig(backend),
		CloudSpecAPI:        cloudspec.NewCloudSpecAPI(backend),
	}
}