use teams api client interface instead of pointer

This commit is contained in:
Murat Kabilov 2017-07-17 17:28:05 +02:00
parent 4f36e447c3
commit dbfee26d47
3 changed files with 7 additions and 3 deletions

View File

@ -39,7 +39,7 @@ type Config struct {
KubeClient *kubernetes.Clientset //TODO: move clients to the better place?
RestClient *rest.RESTClient
RestConfig *rest.Config
TeamsAPIClient *teams.API
TeamsAPIClient teams.Client
OpConfig config.Config
InfrastructureRoles map[string]spec.PgUser // inherited from the controller
}

View File

@ -20,8 +20,8 @@ import (
type Config struct {
RestConfig *rest.Config
KubeClient *kubernetes.Clientset
RestClient *rest.RESTClient
TeamsAPIClient *teams.API
RestClient rest.Interface
TeamsAPIClient teams.Client
InfrastructureRoles map[string]spec.PgUser
}

View File

@ -39,6 +39,10 @@ type team struct {
InfrastructureAccounts []infrastructureAccount `json:"infrastructure-accounts"`
}
type Client interface {
TeamInfo(string, string) (*team, error)
}
type httpClient interface {
Do(req *http.Request) (*http.Response, error)
}