本文整理匯總了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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}