80 lines
2.0 KiB
Protocol Buffer
80 lines
2.0 KiB
Protocol Buffer
syntax = "proto3";
|
||
|
||
package conf;
|
||
|
||
option go_package = "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1;conf";
|
||
|
||
import "google/protobuf/duration.proto";
|
||
|
||
// 数据
|
||
message Data {
|
||
// 数据库
|
||
message Database {
|
||
string driver = 1; // 驱动名:mysql、postgresql、mongodb、sqlite……
|
||
string source = 2; // 数据源(DSN字符串)
|
||
bool migrate = 3; // 数据迁移开关
|
||
bool debug = 4; // 调试开关
|
||
int32 max_idle_connections = 5; // 连接池最大空闲连接数
|
||
int32 max_open_connections = 6; // 连接池最大打开连接数
|
||
google.protobuf.Duration connection_max_lifetime = 7; // 连接可重用的最大时间长度
|
||
}
|
||
|
||
// redis
|
||
message Redis {
|
||
string network = 1; // 网络
|
||
string addr = 2; // 服务端地址
|
||
string password = 3; // 密码
|
||
int32 db = 4; // 数据库索引
|
||
google.protobuf.Duration dial_timeout = 5; // 连接超时时间
|
||
google.protobuf.Duration read_timeout = 6; // 读取超时时间
|
||
google.protobuf.Duration write_timeout = 7; // 写入超时时间
|
||
|
||
bool enable_tracing = 8;
|
||
bool enable_metrics = 9;
|
||
}
|
||
|
||
// MongoDB
|
||
message MongoDB {
|
||
string address = 1;
|
||
}
|
||
|
||
// ClickHouse
|
||
message ClickHouse {
|
||
string address = 1;
|
||
}
|
||
|
||
// InfluxDB
|
||
message InfluxDB {
|
||
string address = 1;
|
||
string token = 2;
|
||
string orgnization = 3;
|
||
string bucket = 4;
|
||
}
|
||
|
||
// Kafka
|
||
message Kafka {
|
||
repeated string addrs = 1; // 对端网络地址
|
||
string codec = 2; // 编解码器
|
||
}
|
||
|
||
message Doris {
|
||
string address = 1;
|
||
}
|
||
|
||
message ElasticSearch {
|
||
string address = 1;
|
||
}
|
||
|
||
Database database = 1; // 数据库DSN
|
||
|
||
Redis redis = 10; // Redis
|
||
MongoDB mongodb = 11; // MongoDB数据库
|
||
ElasticSearch elastic_search = 12; // ElasticSearch数据库
|
||
|
||
ClickHouse clickhouse = 20; // ClickHouse数据库
|
||
InfluxDB influxdb = 21; // InfluxDB数据库
|
||
Doris doris = 22; // Doris数据库
|
||
|
||
Kafka kafka = 30; // Kafka服务
|
||
}
|