-
Notifications
You must be signed in to change notification settings - Fork 15
/
mdb.go
74 lines (60 loc) · 2.33 KB
/
mdb.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
// Copyright (c) 2018 Yandex LLC. All rights reserved.
// Author: Dmitry Novikov <[email protected]>
package ycsdk
import (
"github.com/yandex-cloud/go-sdk/gen/mdb/clickhouse"
"github.com/yandex-cloud/go-sdk/gen/mdb/elasticsearch"
"github.com/yandex-cloud/go-sdk/gen/mdb/greenplum"
"github.com/yandex-cloud/go-sdk/gen/mdb/kafka"
"github.com/yandex-cloud/go-sdk/gen/mdb/mongodb"
"github.com/yandex-cloud/go-sdk/gen/mdb/mysql"
"github.com/yandex-cloud/go-sdk/gen/mdb/opensearch"
"github.com/yandex-cloud/go-sdk/gen/mdb/postgresql"
"github.com/yandex-cloud/go-sdk/gen/mdb/redis"
"github.com/yandex-cloud/go-sdk/gen/mdb/sqlserver"
)
const (
MDBMongoDBServiceID Endpoint = "managed-mongodb"
MDBClickhouseServiceID Endpoint = "managed-clickhouse"
MDBPostgreSQLServiceID Endpoint = "managed-postgresql"
MDBRedisServiceID Endpoint = "managed-redis"
MDBMySQLServiceID Endpoint = "managed-mysql"
MDBKafkaServiceID Endpoint = "managed-kafka"
MDBSQLServerServiceID Endpoint = "managed-sqlserver"
MDBGreenplumServiceID Endpoint = "managed-greenplum"
MDBElasticSearchID Endpoint = "managed-elasticsearch"
MDBOpenSearchID Endpoint = "managed-opensearch"
)
type MDB struct {
sdk *SDK
}
func (m *MDB) PostgreSQL() *postgresql.PostgreSQL {
return postgresql.NewPostgreSQL(m.sdk.getConn(MDBPostgreSQLServiceID))
}
func (m *MDB) MongoDB() *mongodb.MongoDB {
return mongodb.NewMongoDB(m.sdk.getConn(MDBMongoDBServiceID))
}
func (m *MDB) Clickhouse() *clickhouse.Clickhouse {
return clickhouse.NewClickhouse(m.sdk.getConn(MDBClickhouseServiceID))
}
func (m *MDB) Redis() *redis.Redis {
return redis.NewRedis(m.sdk.getConn(MDBRedisServiceID))
}
func (m *MDB) Kafka() *kafka.Kafka {
return kafka.NewKafka(m.sdk.getConn(MDBKafkaServiceID))
}
func (m *MDB) MySQL() *mysql.MySQL {
return mysql.NewMySQL(m.sdk.getConn(MDBMySQLServiceID))
}
func (m *MDB) SQLServer() *sqlserver.SQLServer {
return sqlserver.NewSQLServer(m.sdk.getConn(MDBSQLServerServiceID))
}
func (m *MDB) Greenplum() *greenplum.Greenplum {
return greenplum.NewGreenplum(m.sdk.getConn(MDBGreenplumServiceID))
}
func (m *MDB) ElasticSearch() *elasticsearch.ElasticSearch {
return elasticsearch.NewElasticSearch(m.sdk.getConn(MDBElasticSearchID))
}
func (m *MDB) OpenSearch() *opensearch.OpenSearch {
return opensearch.NewOpenSearch(m.sdk.getConn(MDBOpenSearchID))
}