当前位置: 首页>>代码示例>>Golang>>正文


Golang envcmd.WrapSystem函数代码示例

本文整理汇总了Golang中github.com/juju/juju/cmd/envcmd.WrapSystem函数的典型用法代码示例。如果您正苦于以下问题:Golang WrapSystem函数的具体用法?Golang WrapSystem怎么用?Golang WrapSystem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WrapSystem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewEnvironmentsCommand

// NewEnvironmentsCommand returns a EnvironmentsCommand with the API and userCreds
// provided as specified.
func NewEnvironmentsCommand(envAPI EnvironmentsEnvAPI, sysAPI EnvironmentsSysAPI, userCreds *configstore.APICredentials) cmd.Command {
	return envcmd.WrapSystem(&environmentsCommand{
		envAPI:    envAPI,
		sysAPI:    sysAPI,
		userCreds: userCreds,
	})
}
开发者ID:snailwalker,项目名称:juju,代码行数:9,代码来源:export_test.go

示例2: NewCreateEnvironmentCommand

// NewCreateEnvironmentCommand returns a CreateEnvironmentCommand with the api provided as specified.
func NewCreateEnvironmentCommand(api CreateEnvironmentAPI, parser func(interface{}) (interface{}, error)) (cmd.Command, *CreateEnvironmentCommand) {
	c := &createEnvironmentCommand{
		api:          api,
		configParser: parser,
	}
	return envcmd.WrapSystem(c), &CreateEnvironmentCommand{c}
}
开发者ID:snailwalker,项目名称:juju,代码行数:8,代码来源:export_test.go

示例3: NewChangePasswordCommand

// NewChangePasswordCommand returns a ChangePasswordCommand with the api
// and writer provided as specified.
func NewChangePasswordCommand(api ChangePasswordAPI, writer EnvironInfoCredsWriter) (cmd.Command, *ChangePasswordCommand) {
	c := &changePasswordCommand{
		api:    api,
		writer: writer,
	}
	return envcmd.WrapSystem(c), &ChangePasswordCommand{c}
}
开发者ID:snailwalker,项目名称:juju,代码行数:9,代码来源:export_test.go

示例4: NewUseEnvironmentCommand

// NewUseEnvironmentCommand returns a UseEnvironmentCommand with the API and
// userCreds provided as specified.
func NewUseEnvironmentCommand(api UseEnvironmentAPI, userCreds *configstore.APICredentials, endpoint *configstore.APIEndpoint) (cmd.Command, *UseEnvironmentCommand) {
	c := &useEnvironmentCommand{
		api:       api,
		userCreds: userCreds,
		endpoint:  endpoint,
	}
	return envcmd.WrapSystem(c), &UseEnvironmentCommand{c}
}
开发者ID:snailwalker,项目名称:juju,代码行数:10,代码来源:export_test.go

示例5: NewEnableCommand

// NewEnableCommand returns a EnableCommand with the api provided as
// specified.
func NewEnableCommand(api disenableUserAPI) (cmd.Command, *DisenableUserBase) {
	c := &enableCommand{
		disenableUserBase{
			api: api,
		},
	}
	return envcmd.WrapSystem(c), &DisenableUserBase{&c.disenableUserBase}
}
开发者ID:snailwalker,项目名称:juju,代码行数:10,代码来源:export_test.go

示例6: NewListCommand

// NewListCommand returns a ListCommand with the api provided as specified.
func NewListCommand(api UserInfoAPI) cmd.Command {
	c := &listCommand{
		infoCommandBase: infoCommandBase{
			api: api,
		},
	}
	return envcmd.WrapSystem(c)
}
开发者ID:snailwalker,项目名称:juju,代码行数:9,代码来源:export_test.go

示例7: NewSuperCommand

// NewSuperCommand creates the system supercommand and registers the
// subcommands that it supports.
func NewSuperCommand() cmd.Command {
	systemCmd := cmd.NewSuperCommand(cmd.SuperCommandParams{
		Name:        "system",
		Doc:         commandDoc,
		UsagePrefix: "juju",
		Purpose:     "manage systems",
	})

	systemCmd.Register(&ListCommand{})
	systemCmd.Register(&LoginCommand{})
	systemCmd.Register(&DestroyCommand{})
	systemCmd.Register(&KillCommand{apiDialerFunc: juju.NewAPIFromName})
	systemCmd.Register(envcmd.WrapSystem(&EnvironmentsCommand{}))
	systemCmd.Register(envcmd.WrapSystem(&CreateEnvironmentCommand{}))
	systemCmd.Register(envcmd.WrapSystem(&RemoveBlocksCommand{}))
	systemCmd.Register(envcmd.WrapSystem(&UseEnvironmentCommand{}))

	return systemCmd
}
开发者ID:frankban,项目名称:juju-tmp,代码行数:21,代码来源:system.go

示例8: NewSuperCommand

// NewSuperCommand creates the user supercommand and registers the subcommands
// that it supports.
func NewSuperCommand() cmd.Command {
	usercmd := cmd.NewSuperCommand(cmd.SuperCommandParams{
		Name:        "user",
		Doc:         userCommandDoc,
		UsagePrefix: "juju",
		Purpose:     userCommandPurpose,
	})
	usercmd.Register(envcmd.WrapSystem(&AddCommand{}))
	usercmd.Register(envcmd.WrapSystem(&ChangePasswordCommand{}))
	usercmd.Register(envcmd.WrapSystem(&CredentialsCommand{}))
	usercmd.Register(envcmd.WrapSystem(&InfoCommand{}))
	usercmd.Register(envcmd.WrapSystem(&DisableCommand{}))
	usercmd.Register(envcmd.WrapSystem(&EnableCommand{}))
	usercmd.Register(envcmd.WrapSystem(&ListCommand{}))
	return usercmd
}
开发者ID:claudiu-coblis,项目名称:juju,代码行数:18,代码来源:user.go

示例9: newEnableCommand

func newEnableCommand() cmd.Command {
	return envcmd.WrapSystem(&enableCommand{})
}
开发者ID:snailwalker,项目名称:juju,代码行数:3,代码来源:disenable.go

示例10: newUseEnvironmentCommand

func newUseEnvironmentCommand() cmd.Command {
	return envcmd.WrapSystem(&useEnvironmentCommand{})
}
开发者ID:snailwalker,项目名称:juju,代码行数:3,代码来源:useenvironment.go

示例11: newDisableCommand

func newDisableCommand() cmd.Command {
	return envcmd.WrapSystem(&disableCommand{})
}
开发者ID:snailwalker,项目名称:juju,代码行数:3,代码来源:disenable.go

示例12: TestWrapWithoutFlags

func (s *SystemCommandSuite) TestWrapWithoutFlags(c *gc.C) {
	cmd := new(testSystemCommand)
	wrapped := envcmd.WrapSystem(cmd, envcmd.SystemSkipFlags)
	err := cmdtesting.InitCommand(wrapped, []string{"-s", "testsys"})
	c.Assert(err, gc.ErrorMatches, "flag provided but not defined: -s")
}
开发者ID:snailwalker,项目名称:juju,代码行数:6,代码来源:systemcommand_test.go

示例13: run

func (s *createSuite) run(c *gc.C, args ...string) (*cmd.Context, error) {
	command := system.NewCreateEnvironmentCommand(s.fake)
	return testing.RunCommand(c, envcmd.WrapSystem(command), args...)
}
开发者ID:claudiu-coblis,项目名称:juju,代码行数:4,代码来源:createenvironment_test.go

示例14: newCreateEnvironmentCommand

func newCreateEnvironmentCommand() cmd.Command {
	return envcmd.WrapSystem(&createEnvironmentCommand{})
}
开发者ID:snailwalker,项目名称:juju,代码行数:3,代码来源:createenvironment.go

示例15: run

func (s *CredentialsCommandSuite) run(c *gc.C, args ...string) (*cmd.Context, error) {
	command := envcmd.WrapSystem(&user.CredentialsCommand{})
	return testing.RunCommand(c, command, args...)
}
开发者ID:claudiu-coblis,项目名称:juju,代码行数:4,代码来源:credentials_test.go


注:本文中的github.com/juju/juju/cmd/envcmd.WrapSystem函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。