forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metaclient.go
37 lines (33 loc) · 1.06 KB
/
metaclient.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
package kapacitor
import (
"errors"
"time"
"github.com/influxdata/influxdb/services/meta"
)
type NoopMetaClient struct{}
func (m *NoopMetaClient) WaitForLeader(d time.Duration) error {
return nil
}
func (m *NoopMetaClient) CreateDatabase(name string) (*meta.DatabaseInfo, error) {
return nil, nil
}
func (m *NoopMetaClient) CreateDatabaseWithRetentionPolicy(name string, rpi *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) {
return nil, nil
}
func (m *NoopMetaClient) CreateRetentionPolicy(database string, rpi *meta.RetentionPolicySpec) (*meta.RetentionPolicyInfo, error) {
return nil, nil
}
func (m *NoopMetaClient) Database(name string) *meta.DatabaseInfo {
return &meta.DatabaseInfo{
Name: name,
}
}
func (m *NoopMetaClient) RetentionPolicy(database, name string) (*meta.RetentionPolicyInfo, error) {
return nil, nil
}
func (m *NoopMetaClient) Authenticate(username, password string) (ui *meta.UserInfo, err error) {
return nil, errors.New("not authenticated")
}
func (m *NoopMetaClient) Users() ([]meta.UserInfo, error) {
return nil, errors.New("no user")
}