當前位置: 首頁>>代碼示例>>Golang>>正文


Golang requirements.Factory類代碼示例

本文整理匯總了Golang中cf/requirements.Factory的典型用法代碼示例。如果您正苦於以下問題:Golang Factory類的具體用法?Golang Factory怎麽用?Golang Factory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Factory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetRequirements

func (cmd ListServices) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	reqs = append(reqs,
		reqFactory.NewLoginRequirement(),
		reqFactory.NewTargetedSpaceRequirement(),
	)
	return
}
開發者ID:knolleary,項目名稱:cli,代碼行數:7,代碼來源:list_services.go

示例2: GetRequirements

func (cmd ListSpaces) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	reqs = []requirements.Requirement{
		reqFactory.NewLoginRequirement(),
		reqFactory.NewTargetedOrgRequirement(),
	}
	return
}
開發者ID:jalateras,項目名稱:cli,代碼行數:7,代碼來源:list_spaces.go

示例3: GetRequirements

func (cmd Push) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	reqs = []requirements.Requirement{
		reqFactory.NewLoginRequirement(),
		reqFactory.NewSpaceRequirement(),
	}
	return
}
開發者ID:KaiYoung,項目名稱:cli,代碼行數:7,代碼來源:push.go

示例4: GetRequirements

func (cmd PurgeServiceOffering) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 1 {
		err = errors.New("incorrect usage")
		cmd.ui.FailWithUsage(c, "purge-service-offering")
	}

	reqs = []requirements.Requirement{reqFactory.NewLoginRequirement()}
	return
}
開發者ID:julz,項目名稱:cli,代碼行數:9,代碼來源:purge_service_offering.go

示例5: GetRequirements

func (cmd CreateQuota) GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) ([]requirements.Requirement, error) {
	if len(context.Args()) != 1 {
		cmd.ui.FailWithUsage(context, "create-quota")
	}

	return []requirements.Requirement{
		requirementsFactory.NewLoginRequirement(),
	}, nil
}
開發者ID:nota-ja,項目名稱:cli,代碼行數:9,代碼來源:create_quota.go

示例6: GetRequirements

func (cmd CreateUserProvidedService) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 1 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "create-user-provided-service")
		return
	}

	reqs = append(reqs, requirementsFactory.NewLoginRequirement())
	return
}
開發者ID:nota-ja,項目名稱:cli,代碼行數:10,代碼來源:create_user_provided_service.go

示例7: GetRequirements

func (cmd CreateUserFields) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 2 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "create-user")
	}

	reqs = append(reqs, reqFactory.NewLoginRequirement())

	return
}
開發者ID:knolleary,項目名稱:cli,代碼行數:10,代碼來源:create_user.go

示例8: GetRequirements

func (cmd DeleteServiceBroker) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 1 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "delete-service-broker")
		return
	}

	reqs = append(reqs, requirementsFactory.NewLoginRequirement())
	return
}
開發者ID:nota-ja,項目名稱:cli,代碼行數:10,代碼來源:delete_service_broker.go

示例9: GetRequirements

func (cmd *DeleteOrg) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 1 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "delete-org")
		return
	}

	reqs = []requirements.Requirement{requirementsFactory.NewLoginRequirement()}
	return
}
開發者ID:julz,項目名稱:cli,代碼行數:10,代碼來源:delete_org.go

示例10: GetRequirements

func (cmd *RenameBuildpack) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 2 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "rename-buildpack")
		return
	}

	reqs = []requirements.Requirement{requirementsFactory.NewLoginRequirement()}
	return
}
開發者ID:nota-ja,項目名稱:cli,代碼行數:10,代碼來源:rename_buildpack.go

示例11: GetRequirements

func (cmd DeleteServiceAuthToken) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 2 {
		err = errors.New("Incorrect usage")
		cmd.ui.FailWithUsage(c, "delete-service-auth-token")
		return
	}

	reqs = append(reqs, reqFactory.NewLoginRequirement())
	return
}
開發者ID:jalateras,項目名稱:cli,代碼行數:10,代碼來源:delete_service_auth_token.go

示例12: GetRequirements

func (cmd Authenticate) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 2 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "auth")
		return
	}

	reqs = append(reqs, reqFactory.NewApiEndpointRequirement())
	return
}
開發者ID:normalnorman,項目名稱:cli,代碼行數:10,代碼來源:authenticate.go

示例13: GetRequirements

func (l *RecentLogs) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) == 0 {
		err = errors.New("Incorrect Usage")
		l.ui.FailWithUsage(c, "logs")
		return
	}

	l.appReq = reqFactory.NewApplicationRequirement(c.Args()[0])
	reqs = []requirements.Requirement{l.appReq}
	return
}
開發者ID:jbayer,項目名稱:cli,代碼行數:11,代碼來源:recent_logs.go

示例14: GetRequirements

func (cmd DeleteUser) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) != 1 {
		err = errors.New("Invalid usage")
		cmd.ui.FailWithUsage(c, "delete-user")
		return
	}

	reqs = append(reqs, reqFactory.NewLoginRequirement())

	return
}
開發者ID:jalateras,項目名稱:cli,代碼行數:11,代碼來源:delete_user.go

示例15: GetRequirements

func (cmd *Delete) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
	if len(c.Args()) == 0 {
		err = errors.New("Incorrect Usage")
		cmd.ui.FailWithUsage(c, "delete")
		return
	}
	cmd.appReq = reqFactory.NewApplicationRequirement(c.Args()[0])

	reqs = []requirements.Requirement{cmd.appReq}
	return
}
開發者ID:KaiYoung,項目名稱:cli,代碼行數:11,代碼來源:delete.go


注:本文中的cf/requirements.Factory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。