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配置 } // Kafka message Kafka { repeated string endpoints = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } // RabbitMQ message RabbitMQ { repeated string endpoints = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message ActiveMQ { string endpoint = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message NATS { string endpoint = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message NSQ { string endpoint = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message Pulsar { string endpoint = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message Redis { string endpoint = 1; // 对端网络地址 string codec = 2; // 编解码器: json,xml,yaml... TLS tls = 3; // TLS配置 } message RocketMQ { string version = 1; // 驱动版本:aliyun、v2、v5 string codec = 2; // 编解码器: json,xml,yaml... bool enable_trace = 3; repeated string name_servers = 4; string name_server_domain = 5; string access_key = 6; string secret_key = 7; string security_token = 8; string namespace = 9; string instance_name = 10; string group_name = 11; TLS tls = 12; // TLS配置 } // Asynq message Asynq { string endpoint = 1; // 对端网络地址 string password = 2; // redis登录密码 int32 db = 3; // 数据库索引 string location = 4; // 时区 TLS tls = 5; // TLS配置 } // Machinery message Machinery { repeated string brokers = 1; // broker的地址,可以根据实际使用的存储介质,分别指定Redis、AMQP或AWS SQS; repeated string backends = 2; // backend配置,用来指定存放结果的介质的配置。可以根据需求,分别指定为:Redis、memcached或mongodb等; TLS tls = 3; // TLS配置 } // 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服务 }