forked from cloudfoundry-community/cloudfoundry-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_route_creator.go
37 lines (30 loc) · 1.15 KB
/
fake_route_creator.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
package commands
import (
"github.com/cloudfoundry/cli/cf/command_registry"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/simonleung8/flags"
)
type FakeRouteCreator struct {
CreateRouteHostname string
CreateRouteDomainFields models.DomainFields
CreateRouteSpaceFields models.SpaceFields
ReservedRoute models.Route
}
func (cmd *FakeRouteCreator) CreateRoute(hostName string, domain models.DomainFields, space models.SpaceFields) (reservedRoute models.Route, apiErr error) {
cmd.CreateRouteHostname = hostName
cmd.CreateRouteDomainFields = domain
cmd.CreateRouteSpaceFields = space
reservedRoute = cmd.ReservedRoute
return
}
func (cmd *FakeRouteCreator) MetaData() command_registry.CommandMetadata {
return command_registry.CommandMetadata{Name: "create-route"}
}
func (cmd *FakeRouteCreator) SetDependency(_ command_registry.Dependency, _ bool) command_registry.Command {
return cmd
}
func (cmd *FakeRouteCreator) Requirements(_ requirements.Factory, _ flags.FlagContext) (reqs []requirements.Requirement, err error) {
return
}
func (cmd *FakeRouteCreator) Execute(_ flags.FlagContext) {}