當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。