Files
kratos-bootstrap/api/protos/conf/v1/kratos_conf_server.proto
2025-05-06 16:47:23 +08:00

251 lines
7.1 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package conf;
option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
import "google/protobuf/duration.proto";
import "conf/v1/kratos_conf_middleware.proto";
import "conf/v1/kratos_conf_tls.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 = 10; // 服务监听地址
Middleware middleware = 11; // 中间件
TLS tls = 12; // TLS配置
bool enable_swagger = 20; // 启用SwaggerUI
bool enable_pprof = 21; // 启用pprof
}
// gPRC
message GRPC {
string network = 1; // 网络
string addr = 2; // 服务监听地址
google.protobuf.Duration timeout = 3; // 超时时间
Middleware middleware = 4;
TLS tls = 5; // TLS配置
}
// Websocket
message Websocket {
string network = 1; // 网络样式http、https
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器: json,xml,yaml...
google.protobuf.Duration timeout = 5; // 超时时间
TLS tls = 6; // TLS配置
}
// MQTT
message Mqtt {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
string username = 4; // 用户名
string password = 5; // 密码
string client_id = 6; // 客户端ID
bool clean_session = 7; // 清除会话
bool enable_keep_alive = 8; // 启用心跳
}
// Kafka
message Kafka {
repeated string endpoints = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
// RabbitMQ
message RabbitMQ {
repeated string endpoints = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message ActiveMQ {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message NATS {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message NSQ {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message Pulsar {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message Redis {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
message RocketMQ {
string version = 1; // 驱动版本aliyun、v2、v5
string codec = 2; // 编解码器: json,xml,yaml...
repeated string name_servers = 3;
string name_server_domain = 4;
string access_key = 5;
string secret_key = 6;
string security_token = 7;
string namespace = 8;
string instance_name = 9;
string group_name = 10;
TLS tls = 11; // TLS配置
bool enable_trace = 100;
bool enable_keep_alive = 101; // 启用心跳
}
// Asynq
message Asynq {
string endpoint = 1; // 对端网络地址
string password = 2; // redis登录密码
int32 db = 3; // 数据库索引
string location = 4; // 时区
TLS tls = 5; // TLS配置
bool enable_keep_alive = 6; // 启用心跳
}
// Machinery
message Machinery {
repeated string brokers = 1; // broker的地址可以根据实际使用的存储介质分别指定Redis、AMQP或AWS SQS
repeated string backends = 2; // backend配置用来指定存放结果的介质的配置。可以根据需求分别指定为Redis、memcached或mongodb等
TLS tls = 3; // TLS配置
bool enable_keep_alive = 4; // 启用心跳
}
// SSE
message SSE {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器
TLS tls = 5; // TLS配置
google.protobuf.Duration timeout = 10; // 超时时间
google.protobuf.Duration event_ttl = 11; //
bool auto_stream = 20; //
bool auto_reply = 21; //
bool split_data = 22; //
bool encode_base64 = 23; // 进行BASE64编码
}
// SocketIO
message SocketIO {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器
TLS tls = 5; // TLS配置
}
// SignalR
message SignalR {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string codec = 3; // 编解码器
TLS tls = 4; // TLS配置
google.protobuf.Duration keep_alive_interval = 10; // 超时时间
google.protobuf.Duration chan_receive_timeout = 11; // 超时时间
bool debug = 6; // 调试开关
uint32 stream_buffer_capacity = 7; //
}
// GraphQL
message GraphQL {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器
google.protobuf.Duration timeout = 5; // 超时时间
bool strict_slash = 6;
TLS tls = 7; // TLS配置
}
// Thrift
message Thrift {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string protocol = 3;
bool buffered = 4;
bool framed = 5;
bool buffer_size = 6;
TLS tls = 7; // TLS配置
}
// RPC
optional REST rest = 1; // REST服务
optional GRPC grpc = 2; // gRPC服务
optional GraphQL graphql = 3; // GraphQL服务
optional Thrift thrift = 4; // Thrift服务
// Message Queue
optional Mqtt mqtt = 10; // MQTT服务
optional Kafka kafka = 11; // Kafka服务
optional RabbitMQ rabbitmq = 12; // RabbitMQ服务
optional ActiveMQ activemq = 13; // ActiveMQ
optional NATS nats = 14; // NATS
optional NSQ nsq = 15; // NATS
optional Pulsar pulsar = 16; // Pulsar
optional Redis redis = 17; // Redis
optional RocketMQ rocketmq = 18; // RocketMQ
// RealTime
optional Websocket websocket = 20; // Websocket服务
optional SSE sse = 21; // SSE服务
optional SocketIO socketio = 22; // SocketIO服务
optional SignalR signalr = 23; // SignalR服务
// Task Queue
optional Asynq asynq = 30; // Asynq服务
optional Machinery machinery = 31; // Machinery服务
}