Compare commits

...

12 Commits

Author SHA1 Message Date
tx7do
fe52212ed3 feat: data config. 2023-10-28 15:41:42 +08:00
tx7do
7884cc05c6 feat: jaeger exporter not support. 2023-10-28 08:55:51 +08:00
tx7do
05b8fbc90c feat: jaeger exporter not support. 2023-10-27 20:18:28 +08:00
tx7do
da6a64f306 feat: tracer 2023-10-27 20:11:30 +08:00
tx7do
6451e0fd06 feat: tracer 2023-10-27 20:09:56 +08:00
tx7do
670e33498a feat: tracer 2023-10-27 19:55:44 +08:00
tx7do
83924b6740 feat: enable_swagger config 2023-10-27 18:44:04 +08:00
tx7do
4cc1bb658a feat: enable_swagger config 2023-10-27 18:43:52 +08:00
tx7do
d1dd6af5d3 feat: kafka data config 2023-10-26 21:40:11 +08:00
tx7do
4ffb6d77ea feat: kafka data config 2023-10-26 21:38:42 +08:00
tx7do
1f708cdf67 fix: stupid bug. 2023-10-26 18:47:25 +08:00
tx7do
4bf4e02919 fix: stupid bug. 2023-10-26 18:42:42 +08:00
12 changed files with 956 additions and 190 deletions

View File

@@ -30,6 +30,28 @@ message Data {
google.protobuf.Duration write_timeout = 7; // 写入超时时间
}
// Kafka
message Kafka {
repeated string addrs = 1; // 对端网络地址
string codec = 2; // 编解码器
}
// MongoDB
message MongoDB {
}
// ClickHouse
message ClickHouse {
}
// InfluxDB
message InfluxDB {
}
Database database = 1; // 数据库
Redis redis = 2; // Redis
Kafka kafka = 3; // Kafka服务
MongoDB mongodb = 4; // MongoDB服务
ClickHouse clickhouse = 5; // ClickHouse服务
InfluxDB influxdb = 6; // InfluxDB服务
}

View File

@@ -22,6 +22,7 @@ message Server {
google.protobuf.Duration timeout = 3; // 超时时间
CORS cors = 4; // 服务监听地址
Middleware middleware = 5; // 中间件
bool enable_swagger = 6; // 启用SwaggerUI
}
// gPRC
@@ -68,6 +69,35 @@ message Server {
repeated string backends = 2; // backend配置用来指定存放结果的介质的配置。可以根据需求分别指定为Redis、memcached或mongodb等
}
// SSE
message SSE {
string network = 1; // 网络
string addr = 2; // 服务监听地址
google.protobuf.Duration timeout = 3; // 超时时间
string path = 4; // 路径
string codec = 5; // 编解码器
}
// SocketIO
message SocketIO {
}
// SignalR
message SignalR {
}
// GraphQL
message GraphQL {
}
// Thrift
message Thrift {
}
REST rest = 1; // REST服务
GRPC grpc = 2; // gRPC服务
Websocket websocket = 3; // Websocket服务
@@ -76,4 +106,9 @@ message Server {
RabbitMQ rabbitmq = 6; // RabbitMQ服务
Asynq asynq = 7; // Asynq服务
Machinery machinery = 8; // Machinery服务
SSE sse = 9; // SSE服务
SocketIO socketio = 10; // SocketIO服务
SignalR signalr = 11; // SignalR服务
GraphQL graphql = 12; // GraphQL服务
Thrift thrift = 13; // Thrift服务
}

View File

@@ -10,4 +10,5 @@ message Tracer {
string endpoint = 2; // 端口
double sampler = 3; // 采样率默认1.0
string env = 4; // 运行环境dev、debug、product
bool insecure = 5;
}

View File

@@ -1,6 +1,7 @@
package bootstrap
import (
"fmt"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
@@ -16,8 +17,8 @@ func Bootstrap(serviceInfo *ServiceInfo) (*conf.Bootstrap, log.Logger, registry.
var err error
// load configs
if err = LoadBootstrapConfig(Flags.Conf); err == nil {
panic("load config failed")
if err = LoadBootstrapConfig(Flags.Conf); err != nil {
panic(fmt.Sprintf("load config failed: %v", err))
}
// init logger
@@ -28,7 +29,7 @@ func Bootstrap(serviceInfo *ServiceInfo) (*conf.Bootstrap, log.Logger, registry.
// init tracer
if err = NewTracerProvider(commonConfig.Trace, serviceInfo); err != nil {
panic(err)
panic(fmt.Sprintf("init tracer failed: %v", err))
}
return commonConfig, ll, reg

View File

@@ -122,18 +122,29 @@ func NewConfigProvider(configPath string) config.Config {
func LoadBootstrapConfig(configPath string) error {
cfg := NewConfigProvider(configPath)
if err := cfg.Load(); err != nil {
panic(err)
var err error
if err = cfg.Load(); err != nil {
return err
}
initBootstrapConfig()
if err = scanConfigs(cfg); err != nil {
return err
}
return nil
}
func scanConfigs(cfg config.Config) error {
initBootstrapConfig()
for _, c := range configList {
if err := cfg.Scan(c); err != nil {
return err
}
}
return nil
}
@@ -161,8 +172,7 @@ func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig
),
)
defer func(cfg config.Config) {
err := cfg.Close()
if err != nil {
if err := cfg.Close(); err != nil {
panic(err)
}
}(cfg)
@@ -173,12 +183,8 @@ func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig
return err, nil
}
initBootstrapConfig()
for _, c := range configList {
if err = cfg.Scan(c); err != nil {
return err, nil
}
if err = scanConfigs(cfg); err != nil {
return err, nil
}
return nil, commonConfig.Config

View File

@@ -27,8 +27,12 @@ type Data struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` // 数据库
Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` // Redis
Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` // 数据库
Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` // Redis
Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` // Kafka服务
Mongodb *Data_MongoDB `protobuf:"bytes,4,opt,name=mongodb,proto3" json:"mongodb,omitempty"` // MongoDB服务
Clickhouse *Data_ClickHouse `protobuf:"bytes,5,opt,name=clickhouse,proto3" json:"clickhouse,omitempty"` // ClickHouse服务
Influxdb *Data_InfluxDB `protobuf:"bytes,6,opt,name=influxdb,proto3" json:"influxdb,omitempty"` // InfluxDB服务
}
func (x *Data) Reset() {
@@ -77,6 +81,34 @@ func (x *Data) GetRedis() *Data_Redis {
return nil
}
func (x *Data) GetKafka() *Data_Kafka {
if x != nil {
return x.Kafka
}
return nil
}
func (x *Data) GetMongodb() *Data_MongoDB {
if x != nil {
return x.Mongodb
}
return nil
}
func (x *Data) GetClickhouse() *Data_ClickHouse {
if x != nil {
return x.Clickhouse
}
return nil
}
func (x *Data) GetInfluxdb() *Data_InfluxDB {
if x != nil {
return x.Influxdb
}
return nil
}
// 数据库
type Data_Database struct {
state protoimpl.MessageState
@@ -269,6 +301,179 @@ func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration {
return nil
}
// Kafka
type Data_Kafka struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` // 对端网络地址
Codec string `protobuf:"bytes,2,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器
}
func (x *Data_Kafka) Reset() {
*x = Data_Kafka{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Data_Kafka) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_Kafka) ProtoMessage() {}
func (x *Data_Kafka) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_Kafka.ProtoReflect.Descriptor instead.
func (*Data_Kafka) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_data_proto_rawDescGZIP(), []int{0, 2}
}
func (x *Data_Kafka) GetAddrs() []string {
if x != nil {
return x.Addrs
}
return nil
}
func (x *Data_Kafka) GetCodec() string {
if x != nil {
return x.Codec
}
return ""
}
// MongoDB
type Data_MongoDB struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Data_MongoDB) Reset() {
*x = Data_MongoDB{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Data_MongoDB) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_MongoDB) ProtoMessage() {}
func (x *Data_MongoDB) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_MongoDB.ProtoReflect.Descriptor instead.
func (*Data_MongoDB) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_data_proto_rawDescGZIP(), []int{0, 3}
}
// ClickHouse
type Data_ClickHouse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Data_ClickHouse) Reset() {
*x = Data_ClickHouse{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Data_ClickHouse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_ClickHouse) ProtoMessage() {}
func (x *Data_ClickHouse) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_ClickHouse.ProtoReflect.Descriptor instead.
func (*Data_ClickHouse) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_data_proto_rawDescGZIP(), []int{0, 4}
}
// InfluxDB
type Data_InfluxDB struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Data_InfluxDB) Reset() {
*x = Data_InfluxDB{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Data_InfluxDB) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_InfluxDB) ProtoMessage() {}
func (x *Data_InfluxDB) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_data_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_InfluxDB.ProtoReflect.Descriptor instead.
func (*Data_InfluxDB) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_data_proto_rawDescGZIP(), []int{0, 5}
}
var File_conf_v1_kratos_conf_data_proto protoreflect.FileDescriptor
var file_conf_v1_kratos_conf_data_proto_rawDesc = []byte{
@@ -276,54 +481,71 @@ var file_conf_v1_kratos_conf_data_proto_rawDesc = []byte{
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x07, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12,
0x2f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61,
0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
0x12, 0x26, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x10, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69,
0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0xa1, 0x02, 0x0a, 0x08, 0x44, 0x61, 0x74,
0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x64, 0x65, 0x62, 0x75, 0x67, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x64, 0x6c,
0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20,
0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x6f,
0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6f,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x51, 0x0a, 0x17, 0x63, 0x6f, 0x6e,
0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x69, 0x66, 0x65,
0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x9d, 0x02, 0x0a,
0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62,
0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c,
0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06,
0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x26, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b,
0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44,
0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61,
0x12, 0x2c, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x6f,
0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x12, 0x35,
0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43,
0x6c, 0x69, 0x63, 0x6b, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x63, 0x6b,
0x68, 0x6f, 0x75, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64,
0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44,
0x61, 0x74, 0x61, 0x2e, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x44, 0x42, 0x52, 0x08, 0x69, 0x6e,
0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x1a, 0xa1, 0x02, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62,
0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65,
0x62, 0x75, 0x67, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f,
0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x70, 0x65,
0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x51, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d,
0x61, 0x78, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52,
0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12,
0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64,
0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c,
0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d,
0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c,
0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x3b, 0x5a, 0x39,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f,
0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e,
0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c,
0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72,
0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72,
0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72,
0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x33, 0x0a, 0x05, 0x4b, 0x61,
0x66, 0x6b, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x1a,
0x09, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x1a, 0x0c, 0x0a, 0x0a, 0x43, 0x6c,
0x69, 0x63, 0x6b, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6c,
0x75, 0x78, 0x44, 0x42, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e,
0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -338,25 +560,33 @@ func file_conf_v1_kratos_conf_data_proto_rawDescGZIP() []byte {
return file_conf_v1_kratos_conf_data_proto_rawDescData
}
var file_conf_v1_kratos_conf_data_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_conf_v1_kratos_conf_data_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_conf_v1_kratos_conf_data_proto_goTypes = []interface{}{
(*Data)(nil), // 0: conf.Data
(*Data_Database)(nil), // 1: conf.Data.Database
(*Data_Redis)(nil), // 2: conf.Data.Redis
(*durationpb.Duration)(nil), // 3: google.protobuf.Duration
(*Data_Kafka)(nil), // 3: conf.Data.Kafka
(*Data_MongoDB)(nil), // 4: conf.Data.MongoDB
(*Data_ClickHouse)(nil), // 5: conf.Data.ClickHouse
(*Data_InfluxDB)(nil), // 6: conf.Data.InfluxDB
(*durationpb.Duration)(nil), // 7: google.protobuf.Duration
}
var file_conf_v1_kratos_conf_data_proto_depIdxs = []int32{
1, // 0: conf.Data.database:type_name -> conf.Data.Database
2, // 1: conf.Data.redis:type_name -> conf.Data.Redis
3, // 2: conf.Data.Database.connection_max_lifetime:type_name -> google.protobuf.Duration
3, // 3: conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration
3, // 4: conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration
3, // 5: conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
1, // 0: conf.Data.database:type_name -> conf.Data.Database
2, // 1: conf.Data.redis:type_name -> conf.Data.Redis
3, // 2: conf.Data.kafka:type_name -> conf.Data.Kafka
4, // 3: conf.Data.mongodb:type_name -> conf.Data.MongoDB
5, // 4: conf.Data.clickhouse:type_name -> conf.Data.ClickHouse
6, // 5: conf.Data.influxdb:type_name -> conf.Data.InfluxDB
7, // 6: conf.Data.Database.connection_max_lifetime:type_name -> google.protobuf.Duration
7, // 7: conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration
7, // 8: conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration
7, // 9: conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
}
func init() { file_conf_v1_kratos_conf_data_proto_init() }
@@ -401,6 +631,54 @@ func file_conf_v1_kratos_conf_data_proto_init() {
return nil
}
}
file_conf_v1_kratos_conf_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Data_Kafka); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Data_MongoDB); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Data_ClickHouse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Data_InfluxDB); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -408,7 +686,7 @@ func file_conf_v1_kratos_conf_data_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_conf_v1_kratos_conf_data_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -35,6 +35,11 @@ type Server struct {
Rabbitmq *Server_RabbitMQ `protobuf:"bytes,6,opt,name=rabbitmq,proto3" json:"rabbitmq,omitempty"` // RabbitMQ服务
Asynq *Server_Asynq `protobuf:"bytes,7,opt,name=asynq,proto3" json:"asynq,omitempty"` // Asynq服务
Machinery *Server_Machinery `protobuf:"bytes,8,opt,name=machinery,proto3" json:"machinery,omitempty"` // Machinery服务
Sse *Server_SSE `protobuf:"bytes,9,opt,name=sse,proto3" json:"sse,omitempty"` // SSE服务
Socketio *Server_SocketIO `protobuf:"bytes,10,opt,name=socketio,proto3" json:"socketio,omitempty"` // SocketIO服务
Signalr *Server_SignalR `protobuf:"bytes,11,opt,name=signalr,proto3" json:"signalr,omitempty"` // SignalR服务
Graphql *Server_GraphQL `protobuf:"bytes,12,opt,name=graphql,proto3" json:"graphql,omitempty"` // GraphQL服务
Thrift *Server_Thrift `protobuf:"bytes,13,opt,name=thrift,proto3" json:"thrift,omitempty"` // Thrift服务
}
func (x *Server) Reset() {
@@ -125,17 +130,53 @@ func (x *Server) GetMachinery() *Server_Machinery {
return nil
}
func (x *Server) GetSse() *Server_SSE {
if x != nil {
return x.Sse
}
return nil
}
func (x *Server) GetSocketio() *Server_SocketIO {
if x != nil {
return x.Socketio
}
return nil
}
func (x *Server) GetSignalr() *Server_SignalR {
if x != nil {
return x.Signalr
}
return nil
}
func (x *Server) GetGraphql() *Server_GraphQL {
if x != nil {
return x.Graphql
}
return nil
}
func (x *Server) GetThrift() *Server_Thrift {
if x != nil {
return x.Thrift
}
return nil
}
// REST
type Server_REST struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址
Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
Cors *Server_REST_CORS `protobuf:"bytes,4,opt,name=cors,proto3" json:"cors,omitempty"` // 服务监听地址
Middleware *Middleware `protobuf:"bytes,5,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址
Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
Cors *Server_REST_CORS `protobuf:"bytes,4,opt,name=cors,proto3" json:"cors,omitempty"` // 服务监听地址
Middleware *Middleware `protobuf:"bytes,5,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
EnableSwagger bool `protobuf:"varint,6,opt,name=enable_swagger,json=enableSwagger,proto3" json:"enable_swagger,omitempty"` // 启用SwaggerUI
}
func (x *Server_REST) Reset() {
@@ -205,6 +246,13 @@ func (x *Server_REST) GetMiddleware() *Middleware {
return nil
}
func (x *Server_REST) GetEnableSwagger() bool {
if x != nil {
return x.EnableSwagger
}
return false
}
// gPRC
type Server_GRPC struct {
state protoimpl.MessageState
@@ -613,6 +661,242 @@ func (x *Server_Machinery) GetBackends() []string {
return nil
}
// SSE
type Server_SSE struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // 网络
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` // 服务监听地址
Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // 路径
Codec string `protobuf:"bytes,5,opt,name=codec,proto3" json:"codec,omitempty"` // 编解码器
}
func (x *Server_SSE) Reset() {
*x = Server_SSE{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server_SSE) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_SSE) ProtoMessage() {}
func (x *Server_SSE) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_SSE.ProtoReflect.Descriptor instead.
func (*Server_SSE) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_server_proto_rawDescGZIP(), []int{0, 8}
}
func (x *Server_SSE) GetNetwork() string {
if x != nil {
return x.Network
}
return ""
}
func (x *Server_SSE) GetAddr() string {
if x != nil {
return x.Addr
}
return ""
}
func (x *Server_SSE) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
func (x *Server_SSE) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
func (x *Server_SSE) GetCodec() string {
if x != nil {
return x.Codec
}
return ""
}
// SocketIO
type Server_SocketIO struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Server_SocketIO) Reset() {
*x = Server_SocketIO{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server_SocketIO) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_SocketIO) ProtoMessage() {}
func (x *Server_SocketIO) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_SocketIO.ProtoReflect.Descriptor instead.
func (*Server_SocketIO) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_server_proto_rawDescGZIP(), []int{0, 9}
}
// SignalR
type Server_SignalR struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Server_SignalR) Reset() {
*x = Server_SignalR{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server_SignalR) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_SignalR) ProtoMessage() {}
func (x *Server_SignalR) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_SignalR.ProtoReflect.Descriptor instead.
func (*Server_SignalR) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_server_proto_rawDescGZIP(), []int{0, 10}
}
// GraphQL
type Server_GraphQL struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Server_GraphQL) Reset() {
*x = Server_GraphQL{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server_GraphQL) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_GraphQL) ProtoMessage() {}
func (x *Server_GraphQL) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_GraphQL.ProtoReflect.Descriptor instead.
func (*Server_GraphQL) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_server_proto_rawDescGZIP(), []int{0, 11}
}
// Thrift
type Server_Thrift struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Server_Thrift) Reset() {
*x = Server_Thrift{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server_Thrift) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_Thrift) ProtoMessage() {}
func (x *Server_Thrift) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_Thrift.ProtoReflect.Descriptor instead.
func (*Server_Thrift) Descriptor() ([]byte, []int) {
return file_conf_v1_kratos_conf_server_proto_rawDescGZIP(), []int{0, 12}
}
type Server_REST_CORS struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -626,7 +910,7 @@ type Server_REST_CORS struct {
func (x *Server_REST_CORS) Reset() {
*x = Server_REST_CORS{}
if protoimpl.UnsafeEnabled {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[9]
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -639,7 +923,7 @@ func (x *Server_REST_CORS) String() string {
func (*Server_REST_CORS) ProtoMessage() {}
func (x *Server_REST_CORS) ProtoReflect() protoreflect.Message {
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[9]
mi := &file_conf_v1_kratos_conf_server_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -685,8 +969,8 @@ var file_conf_v1_kratos_conf_server_proto_rawDesc = []byte{
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76,
0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x6d, 0x69,
0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4,
0x09, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x65, 0x73,
0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0,
0x0c, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x65, 0x73,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74,
0x12, 0x25, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11,
@@ -709,62 +993,91 @@ var file_conf_v1_kratos_conf_server_proto_rawDesc = []byte{
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x63,
0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72,
0x79, 0x1a, 0x9d, 0x02, 0x0a, 0x04, 0x52, 0x45, 0x53, 0x54, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74,
0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65,
0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2a, 0x0a,
0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f,
0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45, 0x53, 0x54, 0x2e, 0x43,
0x4f, 0x52, 0x53, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x0a, 0x6d, 0x69, 0x64,
0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e,
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52,
0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x1a, 0x54, 0x0a, 0x04, 0x43,
0x4f, 0x52, 0x53, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a,
0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x73, 0x1a, 0x9b, 0x01, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74,
0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65,
0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a,
0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x79, 0x12, 0x22, 0x0a, 0x03, 0x73, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x53, 0x45,
0x52, 0x03, 0x73, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x69,
0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x4f, 0x52, 0x08,
0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x69, 0x6f, 0x12, 0x2e, 0x0a, 0x07, 0x73, 0x69, 0x67, 0x6e,
0x61, 0x6c, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x52,
0x07, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x72, 0x12, 0x2e, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x70,
0x68, 0x71, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x51, 0x4c, 0x52,
0x07, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x12, 0x2b, 0x0a, 0x06, 0x74, 0x68, 0x72, 0x69,
0x66, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x68, 0x72, 0x69, 0x66, 0x74, 0x52, 0x06, 0x74,
0x68, 0x72, 0x69, 0x66, 0x74, 0x1a, 0xc4, 0x02, 0x0a, 0x04, 0x52, 0x45, 0x53, 0x54, 0x12, 0x18,
0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07,
0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x74, 0x12, 0x2a, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x16, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x45,
0x53, 0x54, 0x2e, 0x43, 0x4f, 0x52, 0x53, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x30, 0x0a,
0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77,
0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x1a,
0x82, 0x01, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x18, 0x0a,
0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70,
0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12,
0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d,
0x65, 0x6f, 0x75, 0x74, 0x1a, 0x1a, 0x0a, 0x04, 0x4d, 0x71, 0x74, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72,
0x1a, 0x1d, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64,
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a,
0x20, 0x0a, 0x08, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x12, 0x14, 0x0a, 0x05, 0x61,
0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72,
0x73, 0x1a, 0x4f, 0x0a, 0x05, 0x41, 0x73, 0x79, 0x6e, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e,
0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e,
0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x64, 0x62, 0x1a, 0x41, 0x0a, 0x09, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x12,
0x18, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
0x52, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x73, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f,
0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12,
0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65,
0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53,
0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x1a, 0x54, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x53, 0x12, 0x18,
0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68,
0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f,
0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x1a, 0x9b, 0x01, 0x0a,
0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12,
0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61,
0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64,
0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63,
0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a,
0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x1a, 0x82, 0x01, 0x0a, 0x09, 0x57,
0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77,
0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f,
0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69,
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a,
0x1a, 0x0a, 0x04, 0x4d, 0x71, 0x74, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x1a, 0x1d, 0x0a, 0x05, 0x4b,
0x61, 0x66, 0x6b, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x20, 0x0a, 0x08, 0x52, 0x61,
0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x4f, 0x0a, 0x05,
0x41, 0x73, 0x79, 0x6e, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,
0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a,
0x02, 0x64, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x1a, 0x41, 0x0a,
0x09, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x62, 0x72, 0x6f,
0x6b, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73,
0x1a, 0x92, 0x01, 0x0a, 0x03, 0x53, 0x53, 0x45, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77,
0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f,
0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70,
0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12,
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x63, 0x6f, 0x64, 0x65, 0x63, 0x1a, 0x0a, 0x0a, 0x08, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x49,
0x4f, 0x1a, 0x09, 0x0a, 0x07, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x1a, 0x09, 0x0a, 0x07,
0x47, 0x72, 0x61, 0x70, 0x68, 0x51, 0x4c, 0x1a, 0x08, 0x0a, 0x06, 0x54, 0x68, 0x72, 0x69, 0x66,
0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f,
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -779,7 +1092,7 @@ func file_conf_v1_kratos_conf_server_proto_rawDescGZIP() []byte {
return file_conf_v1_kratos_conf_server_proto_rawDescData
}
var file_conf_v1_kratos_conf_server_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_conf_v1_kratos_conf_server_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_conf_v1_kratos_conf_server_proto_goTypes = []interface{}{
(*Server)(nil), // 0: conf.Server
(*Server_REST)(nil), // 1: conf.Server.REST
@@ -790,9 +1103,14 @@ var file_conf_v1_kratos_conf_server_proto_goTypes = []interface{}{
(*Server_RabbitMQ)(nil), // 6: conf.Server.RabbitMQ
(*Server_Asynq)(nil), // 7: conf.Server.Asynq
(*Server_Machinery)(nil), // 8: conf.Server.Machinery
(*Server_REST_CORS)(nil), // 9: conf.Server.REST.CORS
(*durationpb.Duration)(nil), // 10: google.protobuf.Duration
(*Middleware)(nil), // 11: conf.Middleware
(*Server_SSE)(nil), // 9: conf.Server.SSE
(*Server_SocketIO)(nil), // 10: conf.Server.SocketIO
(*Server_SignalR)(nil), // 11: conf.Server.SignalR
(*Server_GraphQL)(nil), // 12: conf.Server.GraphQL
(*Server_Thrift)(nil), // 13: conf.Server.Thrift
(*Server_REST_CORS)(nil), // 14: conf.Server.REST.CORS
(*durationpb.Duration)(nil), // 15: google.protobuf.Duration
(*Middleware)(nil), // 16: conf.Middleware
}
var file_conf_v1_kratos_conf_server_proto_depIdxs = []int32{
1, // 0: conf.Server.rest:type_name -> conf.Server.REST
@@ -803,17 +1121,23 @@ var file_conf_v1_kratos_conf_server_proto_depIdxs = []int32{
6, // 5: conf.Server.rabbitmq:type_name -> conf.Server.RabbitMQ
7, // 6: conf.Server.asynq:type_name -> conf.Server.Asynq
8, // 7: conf.Server.machinery:type_name -> conf.Server.Machinery
10, // 8: conf.Server.REST.timeout:type_name -> google.protobuf.Duration
9, // 9: conf.Server.REST.cors:type_name -> conf.Server.REST.CORS
11, // 10: conf.Server.REST.middleware:type_name -> conf.Middleware
10, // 11: conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration
11, // 12: conf.Server.GRPC.middleware:type_name -> conf.Middleware
10, // 13: conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
9, // 8: conf.Server.sse:type_name -> conf.Server.SSE
10, // 9: conf.Server.socketio:type_name -> conf.Server.SocketIO
11, // 10: conf.Server.signalr:type_name -> conf.Server.SignalR
12, // 11: conf.Server.graphql:type_name -> conf.Server.GraphQL
13, // 12: conf.Server.thrift:type_name -> conf.Server.Thrift
15, // 13: conf.Server.REST.timeout:type_name -> google.protobuf.Duration
14, // 14: conf.Server.REST.cors:type_name -> conf.Server.REST.CORS
16, // 15: conf.Server.REST.middleware:type_name -> conf.Middleware
15, // 16: conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration
16, // 17: conf.Server.GRPC.middleware:type_name -> conf.Middleware
15, // 18: conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration
15, // 19: conf.Server.SSE.timeout:type_name -> google.protobuf.Duration
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
20, // [20:20] is the sub-list for extension extendee
0, // [0:20] is the sub-list for field type_name
}
func init() { file_conf_v1_kratos_conf_server_proto_init() }
@@ -932,6 +1256,66 @@ func file_conf_v1_kratos_conf_server_proto_init() {
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_SSE); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_SocketIO); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_SignalR); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_GraphQL); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_Thrift); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conf_v1_kratos_conf_server_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server_REST_CORS); i {
case 0:
return &v.state
@@ -950,7 +1334,7 @@ func file_conf_v1_kratos_conf_server_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_conf_v1_kratos_conf_server_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumMessages: 15,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -30,6 +30,7 @@ type Tracer struct {
Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口
Sampler float64 `protobuf:"fixed64,3,opt,name=sampler,proto3" json:"sampler,omitempty"` // 采样率默认1.0
Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` // 运行环境dev、debug、product
Insecure bool `protobuf:"varint,5,opt,name=insecure,proto3" json:"insecure,omitempty"`
}
func (x *Tracer) Reset() {
@@ -92,23 +93,32 @@ func (x *Tracer) GetEnv() string {
return ""
}
func (x *Tracer) GetInsecure() bool {
if x != nil {
return x.Insecure
}
return false
}
var File_conf_v1_kratos_conf_tracer_proto protoreflect.FileDescriptor
var file_conf_v1_kratos_conf_tracer_proto_rawDesc = []byte{
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x6a, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x63,
0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x65, 0x6e, 0x76, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e,
0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x54, 0x72, 0x61,
0x63, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a,
0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72,
0x65, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f,
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

1
go.mod
View File

@@ -39,6 +39,7 @@ require (
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.19.0
go.opentelemetry.io/otel/exporters/zipkin v1.19.0
go.opentelemetry.io/otel/sdk v1.19.0
go.uber.org/zap v1.26.0

2
go.sum
View File

@@ -842,6 +842,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S2
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.19.0 h1:Nw7Dv4lwvGrI68+wULbcq7su9K2cebeCUrDjVrUJHxM=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.19.0/go.mod h1:1MsF6Y7gTqosgoZvHlzcaaM8DIMNZgJh87ykokoNH7Y=
go.opentelemetry.io/otel/exporters/zipkin v1.19.0 h1:EGY0h5mGliP9o/nIkVuLI0vRiQqmsYOcbwCuotksO1o=
go.opentelemetry.io/otel/exporters/zipkin v1.19.0/go.mod h1:JQgTGJP11yi3o4GHzIWYodhPisxANdqxF1eHwDSnJrI=
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=

View File

@@ -1,3 +1,3 @@
git tag v0.2.4
git tag v0.2.11
git push origin --tags

View File

@@ -4,8 +4,10 @@ import (
"context"
"errors"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
"go.opentelemetry.io/otel/exporters/zipkin"
"go.opentelemetry.io/otel"
@@ -17,23 +19,23 @@ import (
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
)
// NewTracerExporter 创建一个导出器,支持:jaeger和zipkin
func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, error) {
if exporterName == "" {
exporterName = "jaeger"
}
// NewTracerExporter 创建一个导出器,支持:zipkin、otlp-http、otlp-grpc
func NewTracerExporter(exporterName, endpoint string, insecure bool) (traceSdk.SpanExporter, error) {
ctx := context.Background()
switch exporterName {
case "zipkin":
return NewZipkinExporter(endpoint)
return NewZipkinExporter(ctx, endpoint)
case "jaeger":
fallthrough
case "otlptracehttp":
return NewOtlpHttpExporter(endpoint)
case "otlptracegrpc":
return NewOtlpGrpcExporter(endpoint)
return nil, errors.New("jaeger exporter is no longer supported, please use otlp-http or otlp-grpc replace it")
case "otlp-http":
return NewOtlpHttpExporter(ctx, endpoint, insecure)
case "otlp-grpc":
return NewOtlpGrpcExporter(ctx, endpoint, insecure)
default:
return nil, errors.New("exporter type not support")
fallthrough
case "stdout":
return stdouttrace.New()
}
}
@@ -52,17 +54,17 @@ func NewTracerProvider(cfg *conf.Tracer, serviceInfo *ServiceInfo) error {
}
opts := []traceSdk.TracerProviderOption{
traceSdk.WithSampler(traceSdk.ParentBased(traceSdk.TraceIDRatioBased(cfg.Sampler))),
traceSdk.WithSampler(traceSdk.ParentBased(traceSdk.TraceIDRatioBased(cfg.GetSampler()))),
traceSdk.WithResource(resource.NewSchemaless(
semConv.ServiceNameKey.String(serviceInfo.Name),
semConv.ServiceVersionKey.String(serviceInfo.Version),
semConv.ServiceInstanceIDKey.String(serviceInfo.Id),
attribute.String("env", cfg.Env),
attribute.String("env", cfg.GetEnv()),
)),
}
if len(cfg.Endpoint) > 0 {
exp, err := NewTracerExporter(cfg.Batcher, cfg.Endpoint)
if len(cfg.GetEndpoint()) > 0 {
exp, err := NewTracerExporter(cfg.GetBatcher(), cfg.GetEndpoint(), cfg.GetInsecure())
if err != nil {
panic(err)
}
@@ -80,22 +82,46 @@ func NewTracerProvider(cfg *conf.Tracer, serviceInfo *ServiceInfo) error {
return nil
}
// NewZipkinExporter 创建一个zipkin导出器
func NewZipkinExporter(endpoint string) (traceSdk.SpanExporter, error) {
// NewZipkinExporter 创建一个zipkin导出器默认对端地址http://localhost:9411/api/v2/spans
func NewZipkinExporter(_ context.Context, endpoint string) (traceSdk.SpanExporter, error) {
return zipkin.New(endpoint)
}
//// NewJaegerExporter 创建一个jaeger导出器
//func NewJaegerExporter(endpoint string) (traceSdk.SpanExporter, error) {
//// NewJaegerExporter 创建一个jaeger导出器默认对端地址http://localhost:14268/api/traces
//func NewJaegerExporter(_ context.Context, endpoint string) (traceSdk.SpanExporter, error) {
// return jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint)))
//}
// NewOtlpHttpExporter 创建一个OTLP HTTP导出器
func NewOtlpHttpExporter(endpoint string) (traceSdk.SpanExporter, error) {
return otlptracehttp.New(context.Background(), otlptracehttp.WithEndpoint(endpoint))
// NewOtlpHttpExporter 创建OTLP/HTTP导出器默认端口4318
func NewOtlpHttpExporter(ctx context.Context, endpoint string, insecure bool, options ...otlptracehttp.Option) (traceSdk.SpanExporter, error) {
var opts []otlptracehttp.Option
opts = append(opts, otlptracehttp.WithEndpoint(endpoint))
if insecure {
opts = append(opts, otlptracehttp.WithInsecure())
}
opts = append(opts, options...)
return otlptrace.New(
ctx,
otlptracehttp.NewClient(opts...),
)
}
// NewOtlpGrpcExporter 创建一个OTLP GRPC导出器
func NewOtlpGrpcExporter(endpoint string) (traceSdk.SpanExporter, error) {
return otlptracegrpc.New(context.Background(), otlptracegrpc.WithEndpoint(endpoint))
// NewOtlpGrpcExporter 创建OTLP/gRPC导出器默认端口4317
func NewOtlpGrpcExporter(ctx context.Context, endpoint string, insecure bool, options ...otlptracegrpc.Option) (traceSdk.SpanExporter, error) {
var opts []otlptracegrpc.Option
opts = append(opts, otlptracegrpc.WithEndpoint(endpoint))
if insecure {
opts = append(opts, otlptracegrpc.WithInsecure())
}
opts = append(opts, options...)
return otlptrace.New(
ctx,
otlptracegrpc.NewClient(opts...),
)
}