make newFake* functions unexported

This commit is contained in:
Jingtao Ren 2017-11-16 13:23:45 -08:00
parent 1bf1c0d4d5
commit c3050e3ab4
2 changed files with 12 additions and 12 deletions

View File

@ -36,7 +36,7 @@ type fakeAzureLBClient struct {
FakeStore map[string]map[string]network.LoadBalancer FakeStore map[string]map[string]network.LoadBalancer
} }
func NewFakeAzureLBClient() fakeAzureLBClient { func newFakeAzureLBClient() fakeAzureLBClient {
fLBC := fakeAzureLBClient{} fLBC := fakeAzureLBClient{}
fLBC.FakeStore = make(map[string]map[string]network.LoadBalancer) fLBC.FakeStore = make(map[string]map[string]network.LoadBalancer)
fLBC.mutex = &sync.Mutex{} fLBC.mutex = &sync.Mutex{}
@ -166,7 +166,7 @@ func getpublicIPAddressID(subscriptionID string, resourceGroupName, pipName stri
pipName) pipName)
} }
func NewFakeAzurePIPClient(subscriptionID string) fakeAzurePIPClient { func newFakeAzurePIPClient(subscriptionID string) fakeAzurePIPClient {
fAPC := fakeAzurePIPClient{} fAPC := fakeAzurePIPClient{}
fAPC.FakeStore = make(map[string]map[string]network.PublicIPAddress) fAPC.FakeStore = make(map[string]map[string]network.PublicIPAddress)
fAPC.SubscriptionID = subscriptionID fAPC.SubscriptionID = subscriptionID
@ -285,7 +285,7 @@ type fakeAzureInterfacesClient struct {
FakeStore map[string]map[string]network.Interface FakeStore map[string]map[string]network.Interface
} }
func NewFakeAzureInterfacesClient() fakeAzureInterfacesClient { func newFakeAzureInterfacesClient() fakeAzureInterfacesClient {
fIC := fakeAzureInterfacesClient{} fIC := fakeAzureInterfacesClient{}
fIC.FakeStore = make(map[string]map[string]network.Interface) fIC.FakeStore = make(map[string]map[string]network.Interface)
fIC.mutex = &sync.Mutex{} fIC.mutex = &sync.Mutex{}
@ -335,7 +335,7 @@ type fakeAzureVirtualMachinesClient struct {
FakeStore map[string]map[string]compute.VirtualMachine FakeStore map[string]map[string]compute.VirtualMachine
} }
func NewFakeAzureVirtualMachinesClient() fakeAzureVirtualMachinesClient { func newFakeAzureVirtualMachinesClient() fakeAzureVirtualMachinesClient {
fVMC := fakeAzureVirtualMachinesClient{} fVMC := fakeAzureVirtualMachinesClient{}
fVMC.FakeStore = make(map[string]map[string]compute.VirtualMachine) fVMC.FakeStore = make(map[string]map[string]compute.VirtualMachine)
fVMC.mutex = &sync.Mutex{} fVMC.mutex = &sync.Mutex{}
@ -405,7 +405,7 @@ type fakeAzureSubnetsClient struct {
FakeStore map[string]map[string]network.Subnet FakeStore map[string]map[string]network.Subnet
} }
func NewFakeAzureSubnetsClient() fakeAzureSubnetsClient { func newFakeAzureSubnetsClient() fakeAzureSubnetsClient {
fASC := fakeAzureSubnetsClient{} fASC := fakeAzureSubnetsClient{}
fASC.FakeStore = make(map[string]map[string]network.Subnet) fASC.FakeStore = make(map[string]map[string]network.Subnet)
fASC.mutex = &sync.Mutex{} fASC.mutex = &sync.Mutex{}
@ -506,7 +506,7 @@ type fakeAzureNSGClient struct {
FakeStore map[string]map[string]network.SecurityGroup FakeStore map[string]map[string]network.SecurityGroup
} }
func NewFakeAzureNSGClient() fakeAzureNSGClient { func newFakeAzureNSGClient() fakeAzureNSGClient {
fNSG := fakeAzureNSGClient{} fNSG := fakeAzureNSGClient{}
fNSG.FakeStore = make(map[string]map[string]network.SecurityGroup) fNSG.FakeStore = make(map[string]map[string]network.SecurityGroup)
fNSG.mutex = &sync.Mutex{} fNSG.mutex = &sync.Mutex{}

View File

@ -818,12 +818,12 @@ func getTestCloud() (az *Cloud) {
}, },
} }
az.operationPollRateLimiter = flowcontrol.NewTokenBucketRateLimiter(100, 100) az.operationPollRateLimiter = flowcontrol.NewTokenBucketRateLimiter(100, 100)
az.LoadBalancerClient = NewFakeAzureLBClient() az.LoadBalancerClient = newFakeAzureLBClient()
az.PublicIPAddressesClient = NewFakeAzurePIPClient(az.Config.SubscriptionID) az.PublicIPAddressesClient = newFakeAzurePIPClient(az.Config.SubscriptionID)
az.SubnetsClient = NewFakeAzureSubnetsClient() az.SubnetsClient = newFakeAzureSubnetsClient()
az.SecurityGroupsClient = NewFakeAzureNSGClient() az.SecurityGroupsClient = newFakeAzureNSGClient()
az.VirtualMachinesClient = NewFakeAzureVirtualMachinesClient() az.VirtualMachinesClient = newFakeAzureVirtualMachinesClient()
az.InterfacesClient = NewFakeAzureInterfacesClient() az.InterfacesClient = newFakeAzureInterfacesClient()
return az return az
} }