func (s *serviceStatusGetterSuite) SetUpTest(c *gc.C) { s.statusBaseSuite.SetUpTest(c) s.getter = common.NewServiceStatusGetter(s.State, func() (common.AuthFunc, error) { return s.authFunc, nil }) }
// NewStatusAPI creates a new server-side Status setter API facade. func NewStatusAPI(st *state.State, getCanModify common.GetAuthFunc) *StatusAPI { unitSetter := common.NewStatusSetter(st, getCanModify) unitGetter := common.NewStatusGetter(st, getCanModify) serviceSetter := common.NewServiceStatusSetter(st, getCanModify) serviceGetter := common.NewServiceStatusGetter(st, getCanModify) agentSetter := common.NewStatusSetter(&unitAgentFinder{st}, getCanModify) return &StatusAPI{ agentSetter: agentSetter, unitSetter: unitSetter, unitGetter: unitGetter, serviceSetter: serviceSetter, serviceGetter: serviceGetter, getCanModify: getCanModify, } }
// NewStatusAPI creates a new server-side Status setter API facade. func NewStatusAPI(st *state.State, getCanModify common.GetAuthFunc) *StatusAPI { // TODO(fwereade): so *all* of these have exactly the same auth // characteristics? I think not. unitSetter := common.NewStatusSetter(st, getCanModify) unitGetter := common.NewStatusGetter(st, getCanModify) serviceSetter := common.NewServiceStatusSetter(st, getCanModify) serviceGetter := common.NewServiceStatusGetter(st, getCanModify) agentSetter := common.NewStatusSetter(&common.UnitAgentFinder{st}, getCanModify) return &StatusAPI{ agentSetter: agentSetter, unitSetter: unitSetter, unitGetter: unitGetter, serviceSetter: serviceSetter, serviceGetter: serviceGetter, getCanModify: getCanModify, } }