本文整理汇总了Golang中github.com/juju/juju/cmd/modelcmd.WrapController函数的典型用法代码示例。如果您正苦于以下问题:Golang WrapController函数的具体用法?Golang WrapController怎么用?Golang WrapController使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WrapController函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewDefaultsCommandForTest
// NewDefaultsCommandForTest returns a defaultsCommand with the api provided as specified.
func NewDefaultsCommandForTest(api defaultsCommandAPI, store jujuclient.ClientStore) cmd.Command {
cmd := &defaultsCommand{
api: api,
}
cmd.SetClientStore(store)
return modelcmd.WrapController(cmd)
}
示例2: NewListCommand
func NewListCommand() cmd.Command {
return modelcmd.WrapController(&listCommand{
infoCommandBase: infoCommandBase{
clock: clock.WallClock,
},
})
}
示例3: NewGrantCommandForTest
// NewGrantCommandForTest returns a GrantCommand with the api provided as specified.
func NewGrantCommandForTest(api GrantModelAPI, store jujuclient.ClientStore) (cmd.Command, *GrantCommand) {
cmd := &grantCommand{
api: api,
}
cmd.SetClientStore(store)
return modelcmd.WrapController(cmd), &GrantCommand{cmd}
}
示例4: NewShowUserCommandForTest
func NewShowUserCommandForTest(api UserInfoAPI, store jujuclient.ClientStore) cmd.Command {
cmd := &infoCommand{infoCommandBase: infoCommandBase{
clock: clock.WallClock,
api: api}}
cmd.SetClientStore(store)
return modelcmd.WrapController(cmd)
}
示例5: NewEnableDestroyControllerCommandForTest
// NewEnableDestroyControllerCommandForTest returns a enableDestroyController with the
// function used to open the API connection mocked out.
func NewEnableDestroyControllerCommandForTest(api removeBlocksAPI, store jujuclient.ClientStore) cmd.Command {
c := &enableDestroyController{
api: api,
}
c.SetClientStore(store)
return modelcmd.WrapController(c)
}
示例6: NewRevokeCommandForTest
// NewRevokeCommandForTest returns an revokeCommand with the api provided as specified.
func NewRevokeCommandForTest(api RevokeModelAPI, store jujuclient.ClientStore) (cmd.Command, *RevokeCommand) {
cmd := &revokeCommand{
api: api,
}
cmd.SetClientStore(store)
return modelcmd.WrapController(cmd), &RevokeCommand{cmd}
}
示例7: NewModelsCommandForTest
// NewModelsCommandForTest returns a EnvironmentsCommand with the API
// and userCreds provided as specified.
func NewModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, userCreds *configstore.APICredentials) cmd.Command {
return modelcmd.WrapController(&environmentsCommand{
modelAPI: modelAPI,
sysAPI: sysAPI,
userCreds: userCreds,
})
}
示例8: NewCreateModelCommandForTest
// NewCreateModelCommandForTest returns a CreateModelCommand with
// the api provided as specified.
func NewCreateModelCommandForTest(api CreateEnvironmentAPI, parser func(interface{}) (interface{}, error)) (cmd.Command, *CreateModelCommand) {
c := &createModelCommand{
api: api,
configParser: parser,
}
return modelcmd.WrapController(c), &CreateModelCommand{c}
}
示例9: NewChangePasswordCommandForTest
// NewChangePasswordCommand returns a ChangePasswordCommand with the api
// and writer provided as specified.
func NewChangePasswordCommandForTest(api ChangePasswordAPI, writer EnvironInfoCredsWriter) (cmd.Command, *ChangePasswordCommand) {
c := &changePasswordCommand{
api: api,
writer: writer,
}
return modelcmd.WrapController(c), &ChangePasswordCommand{c}
}
示例10: runCommand
func (s *MigrateSuite) runCommand(c *gc.C, args ...string) (*cmd.Context, error) {
cmd := &migrateCommand{
api: s.api,
}
cmd.SetClientStore(s.store)
return testing.RunCommand(c, modelcmd.WrapController(cmd), args...)
}
示例11: NewUpdateCredentialCommandForTest
func NewUpdateCredentialCommandForTest(testStore jujuclient.ClientStore, api credentialAPI) cmd.Command {
c := &updateCredentialCommand{
api: api,
}
c.SetClientStore(testStore)
return modelcmd.WrapController(c)
}
示例12: NewListCommandForTest
// NewListCommand returns a ListCommand with the api provided as specified.
func NewListCommandForTest(api UserInfoAPI) cmd.Command {
c := &listCommand{
infoCommandBase: infoCommandBase{
api: api,
},
}
return modelcmd.WrapController(c)
}
示例13: NewEnableCommandForTest
// NewEnableCommand returns a EnableCommand with the api provided as
// specified.
func NewEnableCommandForTest(api disenableUserAPI) (cmd.Command, *DisenableUserBase) {
c := &enableCommand{
disenableUserBase{
api: api,
},
}
return modelcmd.WrapController(c), &DisenableUserBase{&c.disenableUserBase}
}
示例14: NewUseModelCommandForTest
// NewUseModelCommandForTest returns a UseModelCommand with the
// API and userCreds provided as specified.
func NewUseModelCommandForTest(api UseModelAPI, userCreds *configstore.APICredentials, endpoint *configstore.APIEndpoint) (cmd.Command, *UseModelCommand) {
c := &useModelCommand{
api: api,
userCreds: userCreds,
endpoint: endpoint,
}
return modelcmd.WrapController(c), &UseModelCommand{c}
}
示例15: NewListModelsCommandForTest
// NewListModelsCommandForTest returns a ListModelsCommand with the API
// and userCreds provided as specified.
func NewListModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, store jujuclient.ClientStore) cmd.Command {
c := &modelsCommand{
modelAPI: modelAPI,
sysAPI: sysAPI,
}
c.SetClientStore(store)
return modelcmd.WrapController(c)
}