本文整理汇总了Golang中github.com/juju/juju/cmd/modelcmd.WrapController函数的典型用法代码示例。如果您正苦于以下问题:Golang WrapController函数的具体用法?Golang WrapController怎么用?Golang WrapController使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WrapController函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go
示例2: NewListCommand
func NewListCommand() cmd.Command {
return modelcmd.WrapController(&listCommand{
infoCommandBase: infoCommandBase{
clock: clock.WallClock,
},
})
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:list.go
示例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}
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go
示例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)
}
开发者ID:kat-co,项目名称:juju,代码行数:7,代码来源:export_test.go
示例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)
}
开发者ID:bac,项目名称:juju,代码行数:9,代码来源:export_test.go
示例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}
}
开发者ID:kat-co,项目名称:juju,代码行数:8,代码来源:export_test.go
示例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,
})
}
开发者ID:pmatulis,项目名称:juju,代码行数:9,代码来源:export_test.go
示例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}
}
开发者ID:pmatulis,项目名称:juju,代码行数:9,代码来源:export_test.go
示例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}
}
开发者ID:exekias,项目名称:juju,代码行数:9,代码来源:export_test.go
示例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...)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:7,代码来源:migrate_test.go
示例11: NewUpdateCredentialCommandForTest
func NewUpdateCredentialCommandForTest(testStore jujuclient.ClientStore, api credentialAPI) cmd.Command {
c := &updateCredentialCommand{
api: api,
}
c.SetClientStore(testStore)
return modelcmd.WrapController(c)
}
开发者ID:bac,项目名称:juju,代码行数:7,代码来源:export_test.go
示例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)
}
开发者ID:exekias,项目名称:juju,代码行数:9,代码来源:export_test.go
示例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}
}
开发者ID:exekias,项目名称:juju,代码行数:10,代码来源:export_test.go
示例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}
}
开发者ID:pmatulis,项目名称:juju,代码行数:10,代码来源:export_test.go
示例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)
}
开发者ID:bac,项目名称:juju,代码行数:10,代码来源:export_test.go
示例16: NewLoginCommandForTest
// NewLoginCommand returns a LoginCommand with the api
// and writer provided as specified.
func NewLoginCommandForTest(
newLoginAPI func(juju.NewAPIConnectionParams) (LoginAPI, error),
store jujuclient.ClientStore,
) (cmd.Command, *LoginCommand) {
c := &loginCommand{newLoginAPI: newLoginAPI}
c.SetClientStore(store)
return modelcmd.WrapController(c), &LoginCommand{c}
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:10,代码来源:export_test.go
示例17: initTestControllerCommand
func initTestControllerCommand(c *gc.C, store jujuclient.ClientStore, args ...string) (cmd.Command, *testControllerCommand, error) {
cmd := new(testControllerCommand)
cmd.SetClientStore(store)
wrapped := modelcmd.WrapController(cmd)
if err := cmdtesting.InitCommand(wrapped, args); err != nil {
return nil, nil, err
}
return wrapped, cmd, nil
}
开发者ID:kat-co,项目名称:juju,代码行数:9,代码来源:controller_test.go
示例18: NewDefaultsCommandForTest
// NewDefaultsCommandForTest returns a defaultsCommand with the api provided as specified.
func NewDefaultsCommandForTest(apiRoot api.Connection, dAPI defaultsCommandAPI, cAPI cloudAPI, store jujuclient.ClientStore) cmd.Command {
cmd := &defaultsCommand{
newAPIRoot: func() (api.Connection, error) { return apiRoot, nil },
newDefaultsAPI: func(caller base.APICallCloser) defaultsCommandAPI { return dAPI },
newCloudAPI: func(caller base.APICallCloser) cloudAPI { return cAPI },
}
cmd.SetClientStore(store)
return modelcmd.WrapController(cmd)
}
开发者ID:bac,项目名称:juju,代码行数:10,代码来源:export_test.go
示例19: NewAddModelCommand
// NewAddModelCommand returns a command to add a model.
func NewAddModelCommand() cmd.Command {
return modelcmd.WrapController(&addModelCommand{
newAddModelAPI: func(caller base.APICallCloser) AddModelAPI {
return modelmanager.NewClient(caller)
},
newCloudAPI: func(caller base.APICallCloser) CloudAPI {
return cloudapi.NewClient(caller)
},
})
}
开发者ID:kat-co,项目名称:juju,代码行数:11,代码来源:addmodel.go
示例20: NewListCommandForTest
// NewListCommand returns a ListCommand with the api provided as specified.
func NewListCommandForTest(api UserInfoAPI, modelAPI modelUsersAPI, store jujuclient.ClientStore, clock clock.Clock) cmd.Command {
c := &listCommand{
infoCommandBase: infoCommandBase{
clock: clock,
api: api,
},
modelUserAPI: modelAPI,
}
c.SetClientStore(store)
return modelcmd.WrapController(c)
}
开发者ID:kat-co,项目名称:juju,代码行数:12,代码来源:export_test.go
注:本文中的github.com/juju/juju/cmd/modelcmd.WrapController函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论