-
Notifications
You must be signed in to change notification settings - Fork 15
/
dummy.go
130 lines (105 loc) · 3.85 KB
/
dummy.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Copyright 2022 StreamNative
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package admin
import (
"github.com/streamnative/pulsar-resources-operator/api/v1alpha1"
)
// NewDummyPulsarAdmin is a dummy initialization function
func NewDummyPulsarAdmin(config PulsarAdminConfig) (PulsarAdmin, error) {
return &DummyPulsarAdmin{}, nil
}
// DummyPulsarAdmin is a dummy struct of PulsarAdmin
type DummyPulsarAdmin struct {
}
var _ PulsarAdmin = &DummyPulsarAdmin{}
// ApplyTenant is a fake implements of ApplyTenant
func (d *DummyPulsarAdmin) ApplyTenant(name string, params *TenantParams) error {
return nil
}
// DeleteTenant is a fake implements of DeleteTenant
func (d *DummyPulsarAdmin) DeleteTenant(name string) error {
return nil
}
// ApplyNamespace is a fake implements of ApplyNamespace
func (d *DummyPulsarAdmin) ApplyNamespace(name string, params *NamespaceParams) error {
return nil
}
// DeleteNamespace is a fake implements of DeleteNamespace
func (d *DummyPulsarAdmin) DeleteNamespace(name string) error {
return nil
}
// GetNamespaceClusters is a fake implements of GetNamespaceClusters
func (d *DummyPulsarAdmin) GetNamespaceClusters(name string) ([]string, error) {
return []string{}, nil
}
// SetNamespaceClusters is a fake implements of SetNamespaceClusters
func (d *DummyPulsarAdmin) SetNamespaceClusters(name string, clusters []string) error {
return nil
}
// ApplyTopic is a fake implements of ApplyTopic
func (d *DummyPulsarAdmin) ApplyTopic(name string, params *TopicParams) error {
return nil
}
// DeleteTopic is a fake implements of DeleteTopic
func (d *DummyPulsarAdmin) DeleteTopic(name string) error {
return nil
}
// GetTopicClusters is a fake implements of GetTopicClusters
func (d *DummyPulsarAdmin) GetTopicClusters(name string, persistent *bool) ([]string, error) {
return []string{}, nil
}
// SetTopicClusters is a fake implements of SetTopicClusters
func (d *DummyPulsarAdmin) SetTopicClusters(name string, persistent *bool, clusters []string) error {
return nil
}
// Close is a fake implements of Close
func (d *DummyPulsarAdmin) Close() error {
return nil
}
// GrantPermissions is a fake implements of GrantPermissions
func (d *DummyPulsarAdmin) GrantPermissions(p Permissioner) error {
return nil
}
// RevokePermissions is a fake implements of RevokePermissions
func (d *DummyPulsarAdmin) RevokePermissions(p Permissioner) error {
return nil
}
// GetSchema is a fake implements of GetSchema
func (d *DummyPulsarAdmin) GetSchema(topic string) (*v1alpha1.SchemaInfo, error) {
return nil, nil
}
// UploadSchema is a fake implements of UploadSchema
func (d *DummyPulsarAdmin) UploadSchema(topic string, params *SchemaParams) error {
return nil
}
// DeleteSchema is a fake implements of DeleteSchema
func (d *DummyPulsarAdmin) DeleteSchema(topic string) error {
return nil
}
// CreateCluster is a fake implements of CreateCluster
func (d *DummyPulsarAdmin) CreateCluster(name string, param *ClusterParams) error {
return nil
}
// UpdateCluster is a fake implements of UpdateCluster
func (d *DummyPulsarAdmin) UpdateCluster(name string, param *ClusterParams) error {
return nil
}
// DeleteCluster is a fake implements of DeleteCluster
func (d *DummyPulsarAdmin) DeleteCluster(name string) error {
return nil
}
// CheckClusterExist checks whether the cluster exists
func (d *DummyPulsarAdmin) CheckClusterExist(name string) (bool, error) {
return true, nil
}