/
servicebus.go
63 lines (55 loc) · 1.65 KB
/
servicebus.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 servicebus
import (
servicebusSDK "github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus" // nolint: lll
"github.com/Azure/open-service-broker-azure/pkg/azure/arm"
"github.com/Azure/open-service-broker-azure/pkg/service"
)
type module struct {
namespaceManager *namespaceManager
queueManager *queueManager
topicManager *topicManager
}
type namespaceManager struct {
armDeployer arm.Deployer
namespacesClient servicebusSDK.NamespacesClient
}
type queueManager struct {
armDeployer arm.Deployer
queuesClient servicebusSDK.QueuesClient
}
type topicManager struct {
armDeployer arm.Deployer
topicsClient servicebusSDK.TopicsClient
subscriptionsClient servicebusSDK.SubscriptionsClient
}
// New returns a new instance of a type that fulfills the service.Module
// interface and is capable of provisioning Azure Service Bus
func New(
armDeployer arm.Deployer,
namespacesClient servicebusSDK.NamespacesClient,
queuesClient servicebusSDK.QueuesClient,
topicsClient servicebusSDK.TopicsClient,
subscriptionsClient servicebusSDK.SubscriptionsClient,
) service.Module {
return &module{
namespaceManager: &namespaceManager{
armDeployer: armDeployer,
namespacesClient: namespacesClient,
},
queueManager: &queueManager{
armDeployer: armDeployer,
queuesClient: queuesClient,
},
topicManager: &topicManager{
armDeployer: armDeployer,
topicsClient: topicsClient,
subscriptionsClient: subscriptionsClient,
},
}
}
func (m *module) GetName() string {
return "servicebus"
}
func (m *module) GetStability() service.Stability {
return service.StabilityExperimental
}