-
Notifications
You must be signed in to change notification settings - Fork 67
/
cf_service.go
27 lines (20 loc) · 1007 Bytes
/
cf_service.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
package validate
import "github.com/armory/spinnaker-operator/pkg/util"
type CloudFoundryService interface {
RequestToken(api string, appsManagerUri string, user string, password string, skipHttps bool, httpService util.HttpService) (string, error)
GetOrganizations(token string, api string, appsManagerUri string, skipHttps bool) (bool, error)
}
type service struct{}
func (*service) RequestToken(api string, appsManagerUri string, user string, password string, skipHttps bool, httpService util.HttpService) (string, error) {
return cloudFoundryClient.RequestToken(api,appsManagerUri,user,password,skipHttps,httpService)
}
func (*service) GetOrganizations(token string, api string, appsManagerUri string, skipHttps bool) (bool, error) {
return cloudFoundryClient.GetOrganizations(token, api, appsManagerUri, skipHttps)
}
var (
cloudFoundryClient CloudFoundryClient
)
func NewCloudFoundryService(client CloudFoundryClient) CloudFoundryService {
cloudFoundryClient = client
return &service{}
}