This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
storage.go
63 lines (53 loc) · 1.59 KB
/
storage.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package storage
import (
storageSDK "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage" // nolint: lll
"github.com/Azure/open-service-broker-azure/pkg/azure/arm"
"github.com/Azure/open-service-broker-azure/pkg/service"
)
type module struct {
generalPurposeV1Manager *generalPurposeV1Manager
generalPurposeV2Manager *generalPurposeV2Manager
blobAccountManager *blobAccountManager
blobContainerManager *blobContainerManager
blobAllInOneManager *blobAllInOneManager
}
type storageManager struct {
armDeployer arm.Deployer
accountsClient storageSDK.AccountsClient
}
type generalPurposeV1Manager struct {
storageManager
}
type generalPurposeV2Manager struct {
storageManager
}
type blobAccountManager struct {
storageManager
}
type blobContainerManager struct {
storageManager
}
type blobAllInOneManager struct {
storageManager
}
// New returns a new instance of a type that fulfills the service.Module
// interface and is capable of provisioning Storage using "Azure Storage"
func New(
armDeployer arm.Deployer,
accountsClient storageSDK.AccountsClient,
) service.Module {
storageMgr := storageManager{
armDeployer: armDeployer,
accountsClient: accountsClient,
}
return &module{
generalPurposeV1Manager: &generalPurposeV1Manager{storageMgr},
generalPurposeV2Manager: &generalPurposeV2Manager{storageMgr},
blobAccountManager: &blobAccountManager{storageMgr},
blobContainerManager: &blobContainerManager{storageMgr},
blobAllInOneManager: &blobAllInOneManager{storageMgr},
}
}
func (m *module) GetName() string {
return "storage"
}