81 lines
2.2 KiB
Protocol Buffer
81 lines
2.2 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";
|
||
import "conf/v1/kratos_conf_middleware.proto";
|
||
|
||
// 服务器
|
||
message Server {
|
||
// REST
|
||
message REST {
|
||
message CORS {
|
||
repeated string headers = 1; //
|
||
repeated string methods = 2; //
|
||
repeated string origins = 3; //
|
||
}
|
||
|
||
string network = 1; // 网络
|
||
string addr = 2; // 服务监听地址
|
||
google.protobuf.Duration timeout = 3; // 超时时间
|
||
CORS cors = 4; // 服务监听地址
|
||
Middleware middleware = 5; // 中间件
|
||
bool enable_swagger = 6; // 启用SwaggerUI
|
||
}
|
||
|
||
// gPRC
|
||
message GRPC {
|
||
string network = 1; // 网络
|
||
string addr = 2; // 服务监听地址
|
||
google.protobuf.Duration timeout = 3; // 超时时间
|
||
Middleware middleware = 4;
|
||
}
|
||
|
||
// Websocket
|
||
message Websocket {
|
||
string network = 1; // 网络样式:http、https
|
||
string addr = 2; // 服务监听地址
|
||
string path = 3; // 路径
|
||
google.protobuf.Duration timeout = 4; // 超时时间
|
||
}
|
||
|
||
// MQTT
|
||
message Mqtt {
|
||
string addr = 1; // 对端网络地址
|
||
}
|
||
|
||
// Kafka
|
||
message Kafka {
|
||
repeated string addrs = 1; // 对端网络地址
|
||
}
|
||
|
||
// RabbitMQ
|
||
message RabbitMQ {
|
||
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服务
|
||
}
|