-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_app_binder.go
42 lines (33 loc) · 1.25 KB
/
fake_app_binder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package servicefakes
import (
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/cf/flags"
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/requirements"
)
type OldFakeAppBinder struct {
AppsToBind []models.Application
InstancesToBindTo []models.ServiceInstance
Params map[string]interface{}
BindApplicationReturns struct {
Error error
}
}
func (binder *OldFakeAppBinder) BindApplication(app models.Application, service models.ServiceInstance, paramsMap map[string]interface{}) error {
binder.AppsToBind = append(binder.AppsToBind, app)
binder.InstancesToBindTo = append(binder.InstancesToBindTo, service)
binder.Params = paramsMap
return binder.BindApplicationReturns.Error
}
func (binder *OldFakeAppBinder) MetaData() commandregistry.CommandMetadata {
return commandregistry.CommandMetadata{Name: "bind-service"}
}
func (binder *OldFakeAppBinder) SetDependency(_ commandregistry.Dependency, _ bool) commandregistry.Command {
return binder
}
func (binder *OldFakeAppBinder) Requirements(_ requirements.Factory, _ flags.FlagContext) ([]requirements.Requirement, error) {
return []requirements.Requirement{}, nil
}
func (binder *OldFakeAppBinder) Execute(_ flags.FlagContext) error {
return nil
}