feat: notify config, refactor config load.

This commit is contained in:
tx7do
2023-10-26 16:46:14 +08:00
parent 6d18bc0ffe
commit e7883775ed
24 changed files with 1907 additions and 1177 deletions

View File

@@ -12,6 +12,7 @@ import "conf/v1/logger.proto";
import "conf/v1/registry.proto";
import "conf/v1/oss.proto";
import "conf/v1/config.proto";
import "conf/v1/notify.proto";
// 引导信息
message Bootstrap {
@@ -23,4 +24,5 @@ message Bootstrap {
Registry registry = 6;
RemoteConfig config = 7;
OSS oss = 8;
Notification notify = 9;
}

View File

@@ -13,6 +13,10 @@ message Data {
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

18
api/conf/v1/notify.proto Normal file
View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package conf;
option go_package = "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1;conf";
// 通知消息
message Notification {
// 短信
message SMS {
string endpoint = 1; // 公网接入地址
string region_id = 2; // 地域ID
string access_key_id = 3; // 访问密钥ID
string access_key_secret = 4; // 访问密钥
}
SMS sms = 1;
}

View File

@@ -55,10 +55,25 @@ message Server {
repeated string addrs = 1; // 对端网络地址
}
// Asynq
message Asynq {
string endpoint = 1; // 对端网络地址
string password = 2; // redis登录密码
int32 db = 3; // 数据库索引
}
// Machinery
message Machinery {
repeated string brokers = 1; // broker的地址可以根据实际使用的存储介质分别指定Redis、AMQP或AWS SQS
repeated string backends = 2; // backend配置用来指定存放结果的介质的配置。可以根据需求分别指定为Redis、memcached或mongodb等
}
REST rest = 1; // REST服务
GRPC grpc = 2; // gRPC服务
Websocket websocket = 3; // Websocket服务
Mqtt mqtt = 4; // MQTT服务
Kafka kafka = 5; // Kafka服务
RabbitMQ rabbitmq = 6; // RabbitMQ服务
Asynq asynq = 7; // Asynq服务
Machinery machinery = 8; // Machinery服务
}