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; // 写入超时时间 } // Kafka message Kafka { repeated string addrs = 1; // 对端网络地址 string codec = 2; // 编解码器 } Database database = 1; // 数据库 Redis redis = 2; // Redis Kafka kafka = 3; // Kafka服务 }