Compare commits

..

25 Commits

Author SHA1 Message Date
tx7do
22382d11e0 feat: edit. 2024-04-18 13:47:24 +08:00
tx7do
f428916cd1 feat: edit. 2023-11-18 13:30:18 +08:00
tx7do
3fc082fef5 feat: edit. 2023-11-17 22:48:39 +08:00
tx7do
094a996690 feat: upgrade go-redis version. 2023-11-13 19:52:57 +08:00
tx7do
ce00339301 feat: pprof support. 2023-11-06 19:29:13 +08:00
tx7do
52d7c62d98 feat: pprof support. 2023-11-06 19:18:36 +08:00
tx7do
0c75b390be feat: pagination comment. 2023-11-06 18:08:56 +08:00
tx7do
34547d6ff9 feat: conf. 2023-11-05 19:50:16 +08:00
tx7do
9e31da73be feat: pagination. 2023-11-04 13:25:25 +08:00
tx7do
1c54fc7554 feat: pagination. 2023-11-04 13:24:42 +08:00
tx7do
efbbf420c3 feat: fix error. 2023-11-02 20:25:11 +08:00
tx7do
76ac31b836 feat: add pagination proto. 2023-11-02 18:53:17 +08:00
tx7do
cfea51ec49 feat: server config. 2023-10-28 15:50:09 +08:00
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
35 changed files with 4630 additions and 713 deletions

26
.gitignore vendored
View File

@@ -1,6 +1,4 @@
# If you prefer the allow list template instead of the deny list, see community template: # Reference https://github.com/github/gitignore/blob/master/Go.gitignore
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins # Binaries for programs and plugins
*.exe *.exe
*.exe~ *.exe~
@@ -15,7 +13,23 @@
*.out *.out
# Dependency directories (remove the comment below to include it) # Dependency directories (remove the comment below to include it)
# vendor/ vendor/
# Go workspace file # Compiled Object files, Static and Dynamic libs (Shared Objects)
go.work *.o
*.a
# OS General
Thumbs.db
.DS_Store
# project
*.cert
*.key
*.log
bin/
# Develop tools
.vscode/
.idea/
*.swp

28
api/buf.lock Normal file
View File

@@ -0,0 +1,28 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: envoyproxy
repository: protoc-gen-validate
commit: eac44469a7af47e7839a7f1f3d7ac004
digest: shake256:0feabcde01b6b11e3c75a5e3f807968d5995626546f39c37e5d4205892b3a59cced0ed83b35a2eb9e6dddd3309660ad46b737c9dcd224b425de0a6654ce04417
- remote: buf.build
owner: gnostic
repository: gnostic
commit: 087bc8072ce44e339f213209e4d57bf0
digest: shake256:4689c26f0460fea84c4c277c1b9c7e7d657388c5b4116d1065f907a92100ffbea87de05bbd138a0166411361e1f6ce063b4c0c6002358d39710f3c4a8de788d5
- remote: buf.build
owner: gogo
repository: protobuf
commit: 5461a3dfa9d941da82028ab185dc2a0e
digest: shake256:37c7c75224982038cb1abf45b481ef06716c1f806ffaa162018d0df092bd11a2a9b62c2d0dc0a2ae43beff86b6014fc0eb8c594ffd84d52ade4b08fca901eadc
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
- remote: buf.build
owner: kratos
repository: apis
commit: c2de25f14fa445a79a054214f31d17a8
digest: shake256:91c024935d46f7966667c29e4fc933435959f93c3f0e675e1227c99db09905d44f8ec275b770da7659df5a6b18f4710da157b6d8ad760a4a95f60365b231e637

19
api/buf.yaml Normal file
View File

@@ -0,0 +1,19 @@
version: v1
build:
excludes: [third_party]
deps:
- 'buf.build/googleapis/googleapis'
- 'buf.build/envoyproxy/protoc-gen-validate'
- 'buf.build/kratos/apis'
- 'buf.build/gnostic/gnostic'
- 'buf.build/gogo/protobuf'
breaking:
use:
- FILE
lint:
use:
- DEFAULT

View File

@@ -25,11 +25,100 @@ message Data {
string addr = 2; // 服务端地址 string addr = 2; // 服务端地址
string password = 3; // 密码 string password = 3; // 密码
int32 db = 4; // 数据库索引 int32 db = 4; // 数据库索引
google.protobuf.Duration dial_timeout = 5; // 连接超时时间 google.protobuf.Duration dial_timeout = 5; // 连接超时时间
google.protobuf.Duration read_timeout = 6; // 读取超时时间 google.protobuf.Duration read_timeout = 6; // 读取超时时间
google.protobuf.Duration write_timeout = 7; // 写入超时时间 google.protobuf.Duration write_timeout = 7; // 写入超时时间
bool enable_tracing = 8; // 打开链路追踪
bool enable_metrics = 9; // 打开性能度量
} }
Database database = 1; // 数据库 // MongoDB
Redis redis = 2; // Redis message MongoDB {
string address = 1;
string username = 2;
string password = 3;
}
// ClickHouse
message ClickHouse {
string address = 1;
string database = 2;
string username = 3;
string password = 4;
bool debug = 5;
string compression_method = 6;
google.protobuf.Duration dial_timeout = 7;
int32 max_execution_time = 8;
int32 max_open_conns = 9;
int32 max_idle_conns = 10;
google.protobuf.Duration conn_max_life_time = 11;
int32 block_buffer_size = 12;
int32 max_compression_buffer = 13;
string conn_open_strategy = 14;
int32 max_idle_connections = 15; // 连接池最大空闲连接数
int32 max_open_connections = 16; // 连接池最大打开连接数
google.protobuf.Duration connection_max_lifetime = 17; // 连接可重用的最大时间长度
string protocol = 18;
}
// InfluxDB
message InfluxDB {
string address = 1;
string token = 2;
string organization = 3;
string bucket = 4;
}
// Kafka
message Kafka {
repeated string addrs = 1; // 对端网络地址
string codec = 2; // 编解码器
bool async = 3; // 异步发送
bool allow_auto_topic_creation = 4; // 允许发送的时候自动创建主题
int32 batch_size = 5; // 批量发送量
google.protobuf.Duration batch_timeout = 6; // 批量发送超时时间
google.protobuf.Duration read_timeout = 7; // 读取超时时间
google.protobuf.Duration write_timeout = 8; // 发送超时时间
int64 batch_bytes = 9;// 批量发送字节数
}
message Doris {
string address = 1;
}
message ElasticSearch {
repeated string addresses = 1;
string username = 2;
string password = 3;
bool enable_sniffer = 4;
bool enable_gzip = 5;
google.protobuf.Duration health_check_interval = 6;
}
message Cassandra {
string address = 1;
string username = 2;
string password = 3;
string keyspace = 5;
google.protobuf.Duration connect_timeout = 6;
google.protobuf.Duration timeout = 7;
uint32 consistency = 8;
bool disable_initial_host_lookup = 9;
bool ignore_peer_addr = 10;
}
Database database = 1; // 数据库DSN
Redis redis = 10; // Redis
MongoDB mongodb = 11; // MongoDB数据库
ElasticSearch elastic_search = 12; // ElasticSearch数据库
Cassandra cassandra = 13; // Cassandra数据库
ClickHouse clickhouse = 20; // ClickHouse数据库
InfluxDB influxdb = 21; // InfluxDB数据库
Doris doris = 22; // Doris数据库
Kafka kafka = 30; // Kafka服务
} }

View File

@@ -22,6 +22,8 @@ message Server {
google.protobuf.Duration timeout = 3; // 超时时间 google.protobuf.Duration timeout = 3; // 超时时间
CORS cors = 4; // 服务监听地址 CORS cors = 4; // 服务监听地址
Middleware middleware = 5; // 中间件 Middleware middleware = 5; // 中间件
bool enable_swagger = 6; // 启用SwaggerUI
bool enable_pprof = 7; // 启用pprof
} }
// gPRC // gPRC
@@ -37,7 +39,8 @@ message Server {
string network = 1; // 网络样式http、https string network = 1; // 网络样式http、https
string addr = 2; // 服务监听地址 string addr = 2; // 服务监听地址
string path = 3; // 路径 string path = 3; // 路径
google.protobuf.Duration timeout = 4; // 超时时间 string codec = 4; // 编解码器: json,xml,yaml...
google.protobuf.Duration timeout = 5; // 超时时间
} }
// MQTT // MQTT
@@ -55,11 +58,54 @@ message Server {
repeated string addrs = 1; // 对端网络地址 repeated string addrs = 1; // 对端网络地址
} }
message ActiveMQ {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
}
message NATS {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
}
message NSQ {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
}
message Pulsar {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
}
message Redis {
string endpoint = 1; // 对端网络地址
string codec = 2; // 编解码器: json,xml,yaml...
}
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;
}
// Asynq // Asynq
message Asynq { message Asynq {
string endpoint = 1; // 对端网络地址 string endpoint = 1; // 对端网络地址
string password = 2; // redis登录密码 string password = 2; // redis登录密码
int32 db = 3; // 数据库索引 int32 db = 3; // 数据库索引
string location = 4; // 时区
} }
// Machinery // Machinery
@@ -68,12 +114,90 @@ message Server {
repeated string backends = 2; // backend配置用来指定存放结果的介质的配置。可以根据需求分别指定为Redis、memcached或mongodb等 repeated string backends = 2; // backend配置用来指定存放结果的介质的配置。可以根据需求分别指定为Redis、memcached或mongodb等
} }
// SSE
message SSE {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器
google.protobuf.Duration timeout = 5; // 超时时间
google.protobuf.Duration event_ttl = 6; // 超时时间
bool auto_stream = 7; //
bool auto_reply = 8; //
bool split_data = 9; //
bool encode_base64 = 10; // 进行BASE64编码
}
// SocketIO
message SocketIO {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string path = 3; // 路径
string codec = 4; // 编解码器
}
// SignalR
message SignalR {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string codec = 3; // 编解码器
google.protobuf.Duration keep_alive_interval = 4; // 超时时间
google.protobuf.Duration chan_receive_timeout = 5; // 超时时间
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;
}
// Thrift
message Thrift {
string network = 1; // 网络
string addr = 2; // 服务监听地址
string protocol = 3;
bool buffered = 4;
bool framed = 5;
bool buffer_size = 6;
}
// RPC
REST rest = 1; // REST服务 REST rest = 1; // REST服务
GRPC grpc = 2; // gRPC服务 GRPC grpc = 2; // gRPC服务
Websocket websocket = 3; // Websocket服务 GraphQL graphql = 3; // GraphQL服务
Mqtt mqtt = 4; // MQTT服务 Thrift thrift = 4; // Thrift服务
Kafka kafka = 5; // Kafka服务
RabbitMQ rabbitmq = 6; // RabbitMQ服务 // Message Queue
Asynq asynq = 7; // Asynq服务
Machinery machinery = 8; // Machinery服务 Mqtt mqtt = 10; // MQTT服务
Kafka kafka = 11; // Kafka服务
RabbitMQ rabbitmq = 12; // RabbitMQ服务
ActiveMQ activemq = 13; // ActiveMQ
NATS nats = 14; // NATS
NSQ nsq = 15; // NATS
Pulsar pulsar = 16; // Pulsar
Redis redis = 17; // Redis
RocketMQ rocketmq = 18; // RocketMQ
// RealTime
Websocket websocket = 20; // Websocket服务
SSE sse = 21; // SSE服务
SocketIO socketio = 22; // SocketIO服务
SignalR signalr = 23; // SignalR服务
// Task Queue
Asynq asynq = 30; // Asynq服务
Machinery machinery = 31; // Machinery服务
} }

View File

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

View File

@@ -0,0 +1,81 @@
syntax = "proto3";
package pagination;
option go_package = "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1;pagination";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "gnostic/openapi/v3/annotations.proto";
// 分页通用请求
message PagingRequest {
// 当前页码
optional int32 page = 1 [
json_name = "page",
(gnostic.openapi.v3.property) = {
description: "当前页码",
default: {number: 1}
}
];
// 每页的行数
optional int32 page_size = 2 [
json_name = "pageSize",
(gnostic.openapi.v3.property) = {
description: "每一页的行数",
default: {number: 10}
}
];
// 与过滤参数
optional string query = 3 [
json_name = "query",
(gnostic.openapi.v3.property) = {
description: "与过滤参数",
example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"}
}
];
// 或过滤参数
optional string or_query = 4 [
json_name = "or",
(gnostic.openapi.v3.property) = {
description: "或过滤参数",
example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"}
}
];
// 排序条件
repeated string order_by = 5 [
json_name = "orderBy",
(gnostic.openapi.v3.property) = {
description: "排序条件,字段名前加'-'为降序,否则为升序。"
example: {yaml: "{\"val1\", \"-val2\"}"}
}
];
// 是否不分页
optional bool no_paging = 6 [
json_name = "nopaging",
(gnostic.openapi.v3.property) = {description: "是否不分页"}
];
// 字段掩码
google.protobuf.FieldMask field_mask = 7 [
json_name = "fieldMask",
(gnostic.openapi.v3.property) = {
description: "字段掩码,如果为空则选中所有字段。",
example: {yaml : "id,realName,userName"}
}
];
}
// 分页通用结果
message PagingResponse {
// 总数
int32 total = 1;
// 分页数据
repeated google.protobuf.Any items = 2;
}

View File

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

View File

@@ -1,7 +1,19 @@
# 配置protoc生成规则 # 配置protoc生成规则
version: v1 version: v1
managed: managed:
enabled: false enabled: true
optimize_for: SPEED
go_package_prefix:
default: github.com/tx7do/kratos-bootstrap/gen/api/go
except:
- 'buf.build/googleapis/googleapis'
- 'buf.build/envoyproxy/protoc-gen-validate'
- 'buf.build/kratos/apis'
- 'buf.build/gnostic/gnostic'
- 'buf.build/gogo/protobuf'
plugins: plugins:
# generate go struct code # generate go struct code
#- plugin: buf.build/protocolbuffers/go #- plugin: buf.build/protocolbuffers/go

View File

@@ -1,3 +1,4 @@
version: v1 version: v1
directories: directories:
- api - api

View File

@@ -1,7 +1,9 @@
version: v1 version: v1
breaking: breaking:
use: use:
- FILE - FILE
lint: lint:
use: use:
- DEFAULT - DEFAULT

View File

@@ -34,7 +34,7 @@ import (
k8sKratos "github.com/go-kratos/kratos/contrib/config/kubernetes/v2" k8sKratos "github.com/go-kratos/kratos/contrib/config/kubernetes/v2"
k8sUtil "k8s.io/client-go/util/homedir" k8sUtil "k8s.io/client-go/util/homedir"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
var commonConfig = &conf.Bootstrap{} var commonConfig = &conf.Bootstrap{}
@@ -122,18 +122,29 @@ func NewConfigProvider(configPath string) config.Config {
func LoadBootstrapConfig(configPath string) error { func LoadBootstrapConfig(configPath string) error {
cfg := NewConfigProvider(configPath) cfg := NewConfigProvider(configPath)
if err := cfg.Load(); err != nil { var err error
panic(err)
if err = cfg.Load(); err != nil {
return err
} }
initBootstrapConfig() initBootstrapConfig()
if err = scanConfigs(cfg); err != nil {
return err
}
return nil
}
func scanConfigs(cfg config.Config) error {
initBootstrapConfig()
for _, c := range configList { for _, c := range configList {
if err := cfg.Scan(c); err != nil { if err := cfg.Scan(c); err != nil {
return err return err
} }
} }
return nil return nil
} }
@@ -161,8 +172,7 @@ func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig
), ),
) )
defer func(cfg config.Config) { defer func(cfg config.Config) {
err := cfg.Close() if err := cfg.Close(); err != nil {
if err != nil {
panic(err) panic(err)
} }
}(cfg) }(cfg)
@@ -173,12 +183,8 @@ func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig
return err, nil return err, nil
} }
initBootstrapConfig() if err = scanConfigs(cfg); err != nil {
return err, nil
for _, c := range configList {
if err = cfg.Scan(c); err != nil {
return err, nil
}
} }
return nil, commonConfig.Config return nil, commonConfig.Config

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_bootstrap.proto // source: conf/v1/kratos_conf_bootstrap.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -179,10 +179,15 @@ var file_conf_v1_kratos_conf_bootstrap_proto_rawDesc = []byte{
0x6f, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x09, 0x20, 0x6f, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x09, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42,
0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x8a, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x18, 0x4b, 0x72,
0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 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, 0xa2, 0x02,
0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f,
0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33, 0x6f, 0x74, 0x6f, 0x33,
} }

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_client.proto // source: conf/v1/kratos_conf_client.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -218,11 +218,16 @@ var file_conf_v1_kratos_conf_client_proto_rawDesc = []byte{
0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x65, 0x18, 0x02, 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, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c,
0x65, 0x77, 0x61, 0x72, 0x65, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x65, 0x77, 0x61, 0x72, 0x65, 0x42, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f,
0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x6e, 0x66, 0x42, 0x15, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x6c,
0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74,
0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72,
0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02,
0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_config.proto // source: conf/v1/kratos_conf_config.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -527,12 +527,16 @@ var file_conf_v1_kratos_conf_config_proto_rawDesc = []byte{
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x2a, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x2a, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72,
0x6e, 0x65, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x42, 0x3b, 0x61, 0x63, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x42, 0x87,
0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x15, 0x4b, 0x72, 0x61,
0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f,
0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f,
0x74, 0x6f, 0x33, 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, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58,
0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02,
0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_logger.proto // source: conf/v1/kratos_conf_logger.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -521,11 +521,16 @@ var file_conf_v1_kratos_conf_logger_proto_rawDesc = []byte{
0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65,
0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x42, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x15,
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72,
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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, 0xa2, 0x02, 0x03,
0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e,
0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_middleware.proto // source: conf/v1/kratos_conf_middleware.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -344,11 +344,16 @@ var file_conf_v1_kratos_conf_middleware_proto_rawDesc = []byte{
0x12, 0x14, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72,
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x42, 0x8b, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x19, 0x4b,
0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77,
0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61,
0x72, 0x6f, 0x74, 0x6f, 0x33, 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,
0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04,
0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_notify.proto // source: conf/v1/kratos_conf_notify.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -158,11 +158,16 @@ var file_conf_v1_kratos_conf_notify_proto_rawDesc = []byte{
0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65,
0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65,
0x63, 0x72, 0x65, 0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x63, 0x72, 0x65, 0x74, 0x42, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e,
0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x66, 0x42, 0x15, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4e, 0x6f, 0x74,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x66, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61,
0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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,
0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04,
0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_oss.proto // source: conf/v1/kratos_conf_oss.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -184,12 +184,16 @@ var file_conf_v1_kratos_conf_oss_proto_rawDesc = []byte{
0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70,
0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e,
0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x3b, 0x5a, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x84, 0x01,
0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x12, 0x4b, 0x72, 0x61, 0x74,
0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4f, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37,
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
0x6f, 0x33, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63,
0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43,
0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e,
0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04,
0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_registry.proto // source: conf/v1/kratos_conf_registry.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -780,11 +780,16 @@ var file_conf_v1_kratos_conf_registry_proto_rawDesc = []byte{
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x2b, 0x0a, 0x0b, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x2b, 0x0a, 0x0b,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x65,
0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x89, 0x01, 0x0a, 0x08, 0x63, 0x6f,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x17, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f,
0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x6e, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78,
0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04,
0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f,
0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
// protoc (unknown) // protoc (unknown)
// source: conf/v1/kratos_conf_tracer.proto // source: conf/v1/kratos_conf_tracer.proto
package conf package v1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -30,6 +30,7 @@ type Tracer struct {
Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口 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 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 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() { func (x *Tracer) Reset() {
@@ -92,23 +93,37 @@ func (x *Tracer) GetEnv() string {
return "" 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 protoreflect.FileDescriptor
var file_conf_v1_kratos_conf_tracer_proto_rawDesc = []byte{ 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, 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, 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, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x54, 0x72, 0x61,
0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x63, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01,
0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1a, 0x0a,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d,
0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x70, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70,
0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x6c, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x03, 0x65, 0x6e, 0x76, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72,
0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x65, 0x42, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x15,
0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72,
0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 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, 0xa2, 0x02, 0x03,
0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e,
0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -0,0 +1,340 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: pagination/v1/pagination.proto
package v1
import (
_ "github.com/google/gnostic/openapiv3"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// 分页通用请求
type PagingRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 当前页码
Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
// 每页的行数
PageSize *int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3,oneof" json:"page_size,omitempty"`
// 与过滤参数
Query *string `protobuf:"bytes,3,opt,name=query,proto3,oneof" json:"query,omitempty"`
// 或过滤参数
OrQuery *string `protobuf:"bytes,4,opt,name=or_query,json=or,proto3,oneof" json:"or_query,omitempty"`
// 排序条件
OrderBy []string `protobuf:"bytes,5,rep,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
// 是否不分页
NoPaging *bool `protobuf:"varint,6,opt,name=no_paging,json=nopaging,proto3,oneof" json:"no_paging,omitempty"`
// 字段掩码
FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"`
}
func (x *PagingRequest) Reset() {
*x = PagingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pagination_v1_pagination_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PagingRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PagingRequest) ProtoMessage() {}
func (x *PagingRequest) ProtoReflect() protoreflect.Message {
mi := &file_pagination_v1_pagination_proto_msgTypes[0]
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 PagingRequest.ProtoReflect.Descriptor instead.
func (*PagingRequest) Descriptor() ([]byte, []int) {
return file_pagination_v1_pagination_proto_rawDescGZIP(), []int{0}
}
func (x *PagingRequest) GetPage() int32 {
if x != nil && x.Page != nil {
return *x.Page
}
return 0
}
func (x *PagingRequest) GetPageSize() int32 {
if x != nil && x.PageSize != nil {
return *x.PageSize
}
return 0
}
func (x *PagingRequest) GetQuery() string {
if x != nil && x.Query != nil {
return *x.Query
}
return ""
}
func (x *PagingRequest) GetOrQuery() string {
if x != nil && x.OrQuery != nil {
return *x.OrQuery
}
return ""
}
func (x *PagingRequest) GetOrderBy() []string {
if x != nil {
return x.OrderBy
}
return nil
}
func (x *PagingRequest) GetNoPaging() bool {
if x != nil && x.NoPaging != nil {
return *x.NoPaging
}
return false
}
func (x *PagingRequest) GetFieldMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.FieldMask
}
return nil
}
// 分页通用结果
type PagingResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 总数
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
// 分页数据
Items []*anypb.Any `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *PagingResponse) Reset() {
*x = PagingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pagination_v1_pagination_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PagingResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PagingResponse) ProtoMessage() {}
func (x *PagingResponse) ProtoReflect() protoreflect.Message {
mi := &file_pagination_v1_pagination_proto_msgTypes[1]
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 PagingResponse.ProtoReflect.Descriptor instead.
func (*PagingResponse) Descriptor() ([]byte, []int) {
return file_pagination_v1_pagination_proto_rawDescGZIP(), []int{1}
}
func (x *PagingResponse) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
func (x *PagingResponse) GetItems() []*anypb.Any {
if x != nil {
return x.Items
}
return nil
}
var File_pagination_v1_pagination_proto protoreflect.FileDescriptor
var file_pagination_v1_pagination_proto_rawDesc = []byte{
0x0a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f,
0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e,
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,
0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74,
0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xb1, 0x05, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42,
0x1e, 0xba, 0x47, 0x1b, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f,
0x92, 0x02, 0x0c, 0xe5, 0xbd, 0x93, 0xe5, 0x89, 0x8d, 0xe9, 0xa1, 0xb5, 0xe7, 0xa0, 0x81, 0x48,
0x00, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x70, 0x61,
0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x24, 0xba,
0x47, 0x21, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x92, 0x02,
0x12, 0xe6, 0xaf, 0x8f, 0xe4, 0xb8, 0x80, 0xe9, 0xa1, 0xb5, 0xe7, 0x9a, 0x84, 0xe8, 0xa1, 0x8c,
0xe6, 0x95, 0xb0, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88,
0x01, 0x01, 0x12, 0x51, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x42, 0x36, 0xba, 0x47, 0x33, 0x3a, 0x1f, 0x12, 0x1d, 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31,
0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22, 0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a,
0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0f, 0xe4, 0xb8, 0x8e, 0xe8, 0xbf, 0x87,
0xe6, 0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0x48, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65,
0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x08, 0x6f, 0x72, 0x5f, 0x71, 0x75, 0x65, 0x72,
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xba, 0x47, 0x33, 0x3a, 0x1f, 0x12, 0x1d,
0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22,
0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0f,
0xe6, 0x88, 0x96, 0xe8, 0xbf, 0x87, 0xe6, 0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0x48,
0x03, 0x52, 0x02, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x75, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x5a, 0xba, 0x47, 0x57, 0x3a,
0x13, 0x12, 0x11, 0x7b, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x2d, 0x76, 0x61,
0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x3f, 0xe6, 0x8e, 0x92, 0xe5, 0xba, 0x8f, 0xe6, 0x9d, 0xa1,
0xe4, 0xbb, 0xb6, 0xef, 0xbc, 0x8c, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe5, 0x90, 0x8d, 0xe5,
0x89, 0x8d, 0xe5, 0x8a, 0xa0, 0x27, 0x2d, 0x27, 0xe4, 0xb8, 0xba, 0xe9, 0x99, 0x8d, 0xe5, 0xba,
0x8f, 0xef, 0xbc, 0x8c, 0xe5, 0x90, 0xa6, 0xe5, 0x88, 0x99, 0xe4, 0xb8, 0xba, 0xe5, 0x8d, 0x87,
0xe5, 0xba, 0x8f, 0xe3, 0x80, 0x82, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12,
0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01,
0x28, 0x08, 0x42, 0x15, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe6, 0x98, 0xaf, 0xe5, 0x90, 0xa6,
0xe4, 0xb8, 0x8d, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0x48, 0x04, 0x52, 0x08, 0x6e, 0x6f, 0x70,
0x61, 0x67, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x8c, 0x01, 0x0a, 0x0a, 0x66, 0x69, 0x65,
0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x51, 0xba, 0x47, 0x4e, 0x3a, 0x16,
0x12, 0x14, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x75, 0x73,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x92, 0x02, 0x33, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe6,
0x8e, 0xa9, 0xe7, 0xa0, 0x81, 0xef, 0xbc, 0x8c, 0xe5, 0xa6, 0x82, 0xe6, 0x9e, 0x9c, 0xe4, 0xb8,
0xba, 0xe7, 0xa9, 0xba, 0xe5, 0x88, 0x99, 0xe9, 0x80, 0x89, 0xe4, 0xb8, 0xad, 0xe6, 0x89, 0x80,
0xe6, 0x9c, 0x89, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe3, 0x80, 0x82, 0x52, 0x09, 0x66, 0x69,
0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x67, 0x65,
0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x08,
0x0a, 0x06, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6f, 0x72, 0x5f,
0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67,
0x69, 0x6e, 0x67, 0x22, 0x52, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x69,
0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79,
0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x42, 0xa5, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e,
0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x50, 0x61, 0x67, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 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, 0x70, 0x61, 0x67, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa,
0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0a, 0x50,
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x16, 0x50, 0x61, 0x67, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0xea, 0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_pagination_v1_pagination_proto_rawDescOnce sync.Once
file_pagination_v1_pagination_proto_rawDescData = file_pagination_v1_pagination_proto_rawDesc
)
func file_pagination_v1_pagination_proto_rawDescGZIP() []byte {
file_pagination_v1_pagination_proto_rawDescOnce.Do(func() {
file_pagination_v1_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagination_v1_pagination_proto_rawDescData)
})
return file_pagination_v1_pagination_proto_rawDescData
}
var file_pagination_v1_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_pagination_v1_pagination_proto_goTypes = []interface{}{
(*PagingRequest)(nil), // 0: pagination.PagingRequest
(*PagingResponse)(nil), // 1: pagination.PagingResponse
(*fieldmaskpb.FieldMask)(nil), // 2: google.protobuf.FieldMask
(*anypb.Any)(nil), // 3: google.protobuf.Any
}
var file_pagination_v1_pagination_proto_depIdxs = []int32{
2, // 0: pagination.PagingRequest.field_mask:type_name -> google.protobuf.FieldMask
3, // 1: pagination.PagingResponse.items:type_name -> google.protobuf.Any
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_pagination_v1_pagination_proto_init() }
func file_pagination_v1_pagination_proto_init() {
if File_pagination_v1_pagination_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pagination_v1_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PagingRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pagination_v1_pagination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PagingResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_pagination_v1_pagination_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pagination_v1_pagination_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_pagination_v1_pagination_proto_goTypes,
DependencyIndexes: file_pagination_v1_pagination_proto_depIdxs,
MessageInfos: file_pagination_v1_pagination_proto_msgTypes,
}.Build()
File_pagination_v1_pagination_proto = out.File
file_pagination_v1_pagination_proto_rawDesc = nil
file_pagination_v1_pagination_proto_goTypes = nil
file_pagination_v1_pagination_proto_depIdxs = nil
}

212
go.mod
View File

@@ -1,105 +1,109 @@
module github.com/tx7do/kratos-bootstrap module github.com/tx7do/kratos-bootstrap
go 1.20 go 1.22.0
toolchain go1.22.1
require ( require (
github.com/go-chassis/sc-client v0.7.0 github.com/go-chassis/sc-client v0.7.0
github.com/go-kratos/aegis v0.2.0 github.com/go-kratos/aegis v0.2.0
github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20231023125239-6cdd81811e10 github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20240416123913-75711092ab26
github.com/go-kratos/kratos/v2 v2.7.1 github.com/go-kratos/kratos/v2 v2.7.3
github.com/go-redis/redis/extra/redisotel/v8 v8.11.5
github.com/go-redis/redis/v8 v8.11.5
github.com/go-zookeeper/zk v1.0.3 github.com/go-zookeeper/zk v1.0.3
github.com/google/gnostic v0.7.0
github.com/google/subcommands v1.2.0 github.com/google/subcommands v1.2.0
github.com/gorilla/handlers v1.5.1 github.com/gorilla/handlers v1.5.2
github.com/hashicorp/consul/api v1.25.1 github.com/hashicorp/consul/api v1.28.2
github.com/minio/minio-go/v7 v7.0.63 github.com/minio/minio-go/v7 v7.0.69
github.com/nacos-group/nacos-sdk-go v1.1.4 github.com/nacos-group/nacos-sdk-go v1.1.4
github.com/olekukonko/tablewriter v0.0.5 github.com/olekukonko/tablewriter v0.0.5
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5
github.com/redis/go-redis/v9 v9.5.1
github.com/sirupsen/logrus v1.9.3 github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0 github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4 github.com/stretchr/testify v1.9.0
go.etcd.io/etcd/client/v3 v3.5.9 go.etcd.io/etcd/client/v3 v3.5.13
go.opentelemetry.io/otel v1.19.0 go.opentelemetry.io/otel v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0
go.opentelemetry.io/otel/exporters/zipkin v1.19.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.25.0
go.opentelemetry.io/otel/sdk v1.19.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.25.0
go.uber.org/zap v1.26.0 go.opentelemetry.io/otel/exporters/zipkin v1.25.0
golang.org/x/tools v0.14.0 go.opentelemetry.io/otel/sdk v1.25.0
google.golang.org/grpc v1.59.0 go.uber.org/zap v1.27.0
google.golang.org/protobuf v1.31.0 golang.org/x/tools v0.20.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/natefinch/lumberjack.v2 v2.2.1
k8s.io/client-go v0.28.3 k8s.io/client-go v0.30.0
) )
require ( require (
github.com/aliyun/alibaba-cloud-sdk-go v1.62.589 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
github.com/aliyun/aliyun-log-go-sdk v0.1.64 // indirect github.com/aliyun/aliyun-log-go-sdk v0.1.67 // indirect
github.com/apolloconfig/agollo/v4 v4.3.1 // indirect github.com/apolloconfig/agollo/v4 v4.3.1 // indirect
github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.7.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fatih/color v1.15.0 // indirect github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fluent/fluent-logger-golang v1.9.0 // indirect github.com/fluent/fluent-logger-golang v1.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-chassis/cari v0.9.0 // indirect github.com/go-chassis/cari v0.6.0 // indirect
github.com/go-chassis/foundation v0.4.0 // indirect github.com/go-chassis/foundation v0.4.0 // indirect
github.com/go-chassis/openlog v1.1.3 // indirect github.com/go-chassis/openlog v1.1.3 // indirect
github.com/go-errors/errors v1.5.1 // indirect github.com/go-errors/errors v1.0.1 // indirect
github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/kit v0.10.0 // indirect
github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-playground/form/v4 v4.2.1 // indirect github.com/go-playground/form/v4 v4.2.0 // indirect
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/serf v0.10.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect github.com/imdario/mergo v0.3.16 // indirect
@@ -108,14 +112,14 @@ require (
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/karlseguin/ccache/v2 v2.0.8 // indirect github.com/karlseguin/ccache/v2 v2.0.8 // indirect
github.com/klauspost/compress v1.17.2 // indirect github.com/klauspost/compress v1.17.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
github.com/magiconair/properties v1.8.7 // indirect github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
@@ -123,65 +127,61 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pelletier/go-toml v1.9.4 // indirect
github.com/philhofer/fwd v1.1.2 // indirect github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/rivo/uniseg v0.4.4 // indirect github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
github.com/rs/xid v1.5.0 // indirect github.com/rs/xid v1.5.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.6 // indirect github.com/shirou/gopsutil/v3 v3.23.6 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.17.0 // indirect github.com/spf13/viper v1.11.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect github.com/subosito/gotenv v1.2.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 // indirect
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.6 // indirect github.com/tinylib/msgp v1.1.6 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect go.etcd.io/etcd/api/v3 v3.5.13 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.9.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/mod v0.13.0 // indirect golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.13.0 // indirect golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.13.0 // indirect golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.13.0 // indirect golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.8 // indirect google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.28.3 // indirect k8s.io/api v0.30.0 // indirect
k8s.io/apimachinery v0.28.3 // indirect k8s.io/apimachinery v0.30.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect
) )

1445
go.sum

File diff suppressed because it is too large Load Diff

11
grpc.go
View File

@@ -8,16 +8,19 @@ import (
"github.com/go-kratos/aegis/ratelimit" "github.com/go-kratos/aegis/ratelimit"
"github.com/go-kratos/aegis/ratelimit/bbr" "github.com/go-kratos/aegis/ratelimit/bbr"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/middleware"
midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit" midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit"
"github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/recovery"
"github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/middleware/tracing"
"github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/middleware/validate"
"github.com/go-kratos/kratos/v2/registry"
kratosGrpc "github.com/go-kratos/kratos/v2/transport/grpc" kratosGrpc "github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
const defaultTimeout = 5 * time.Second const defaultTimeout = 5 * time.Second
@@ -100,5 +103,7 @@ func CreateGrpcServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosGr
opts = append(opts, kratosGrpc.Timeout(cfg.Server.Grpc.Timeout.AsDuration())) opts = append(opts, kratosGrpc.Timeout(cfg.Server.Grpc.Timeout.AsDuration()))
} }
return kratosGrpc.NewServer(opts...) srv := kratosGrpc.NewServer(opts...)
return srv
} }

View File

@@ -17,7 +17,7 @@ import (
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/middleware/tracing"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
type LoggerType string type LoggerType string

2
oss.go
View File

@@ -6,7 +6,7 @@ import (
"github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/credentials"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
func NewMinIoClient(conf *conf.OSS) *minio.Client { func NewMinIoClient(conf *conf.OSS) *minio.Client {

View File

@@ -3,27 +3,41 @@ package bootstrap
import ( import (
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/go-redis/redis/extra/redisotel/v8" "github.com/redis/go-redis/extra/redisotel/v9"
"github.com/go-redis/redis/v8" "github.com/redis/go-redis/v9"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
// NewRedisClient 创建Redis客户端 // NewRedisClient create go-redis client
func NewRedisClient(conf *conf.Data) *redis.Client { func NewRedisClient(conf *conf.Data) (rdb *redis.Client) {
rdb := redis.NewClient(&redis.Options{ if rdb = redis.NewClient(&redis.Options{
Addr: conf.Redis.Addr, Addr: conf.GetRedis().GetAddr(),
Password: conf.Redis.Password, Password: conf.GetRedis().GetPassword(),
DB: int(conf.Redis.Db), DB: int(conf.GetRedis().GetDb()),
DialTimeout: conf.Redis.DialTimeout.AsDuration(), DialTimeout: conf.GetRedis().GetDialTimeout().AsDuration(),
WriteTimeout: conf.Redis.WriteTimeout.AsDuration(), WriteTimeout: conf.GetRedis().GetWriteTimeout().AsDuration(),
ReadTimeout: conf.Redis.ReadTimeout.AsDuration(), ReadTimeout: conf.GetRedis().GetReadTimeout().AsDuration(),
}) }); rdb == nil {
if rdb == nil {
log.Fatalf("failed opening connection to redis") log.Fatalf("failed opening connection to redis")
return nil return nil
} }
rdb.AddHook(redisotel.NewTracingHook())
// open tracing instrumentation.
if conf.GetRedis().GetEnableTracing() {
if err := redisotel.InstrumentTracing(rdb); err != nil {
log.Fatalf("failed open tracing: %s", err.Error())
panic(err)
}
}
// open metrics instrumentation.
if conf.GetRedis().GetEnableMetrics() {
if err := redisotel.InstrumentMetrics(rdb); err != nil {
log.Fatalf("failed open metrics: %s", err.Error())
panic(err)
}
}
return rdb return rdb
} }

View File

@@ -1,9 +1,10 @@
package bootstrap package bootstrap
import ( import (
"path/filepath"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/registry"
"path/filepath"
// etcd // etcd
etcdKratos "github.com/go-kratos/kratos/contrib/registry/etcd/v2" etcdKratos "github.com/go-kratos/kratos/contrib/registry/etcd/v2"
@@ -40,7 +41,7 @@ import (
servicecombClient "github.com/go-chassis/sc-client" servicecombClient "github.com/go-chassis/sc-client"
servicecombKratos "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2" servicecombKratos "github.com/go-kratos/kratos/contrib/registry/servicecomb/v2"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
type RegistryType string type RegistryType string

View File

@@ -1,9 +1,11 @@
package bootstrap package bootstrap
import ( import (
"github.com/stretchr/testify/assert"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
"testing" "testing"
"github.com/stretchr/testify/assert"
conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
func TestNewConsulRegistry(t *testing.T) { func TestNewConsulRegistry(t *testing.T) {
@@ -56,16 +58,16 @@ func TestNewEurekaRegistry(t *testing.T) {
} }
func TestNewPolarisRegistry(t *testing.T) { func TestNewPolarisRegistry(t *testing.T) {
var cfg conf.Registry //var cfg conf.Registry
cfg.Polaris.Address = "127.0.0.1" //cfg.Polaris.Address = "127.0.0.1"
cfg.Polaris.Port = 8091 //cfg.Polaris.Port = 8091
cfg.Polaris.InstanceCount = 5 //cfg.Polaris.InstanceCount = 5
cfg.Polaris.Namespace = "default" //cfg.Polaris.Namespace = "default"
cfg.Polaris.Service = "DiscoverEchoServer" //cfg.Polaris.Service = "DiscoverEchoServer"
cfg.Polaris.Token = "" //cfg.Polaris.Token = ""
//
reg := NewPolarisRegistry(&cfg) //reg := NewPolarisRegistry(&cfg)
assert.Nil(t, reg) //assert.Nil(t, reg)
} }
func TestNewServicecombRegistry(t *testing.T) { func TestNewServicecombRegistry(t *testing.T) {

29
rest.go
View File

@@ -1,18 +1,22 @@
package bootstrap package bootstrap
import ( import (
"net/http/pprof"
"github.com/go-kratos/aegis/ratelimit" "github.com/go-kratos/aegis/ratelimit"
"github.com/go-kratos/aegis/ratelimit/bbr" "github.com/go-kratos/aegis/ratelimit/bbr"
"github.com/go-kratos/kratos/v2/middleware" "github.com/go-kratos/kratos/v2/middleware"
midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit" midRateLimit "github.com/go-kratos/kratos/v2/middleware/ratelimit"
"github.com/go-kratos/kratos/v2/middleware/recovery" "github.com/go-kratos/kratos/v2/middleware/recovery"
"github.com/go-kratos/kratos/v2/middleware/tracing" "github.com/go-kratos/kratos/v2/middleware/tracing"
"github.com/go-kratos/kratos/v2/middleware/validate" "github.com/go-kratos/kratos/v2/middleware/validate"
kratosRest "github.com/go-kratos/kratos/v2/transport/http" kratosRest "github.com/go-kratos/kratos/v2/transport/http"
"github.com/gorilla/handlers" "github.com/gorilla/handlers"
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1" conf "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
) )
// CreateRestServer 创建REST服务端 // CreateRestServer 创建REST服务端
@@ -60,5 +64,26 @@ func CreateRestServer(cfg *conf.Bootstrap, m ...middleware.Middleware) *kratosRe
opts = append(opts, kratosRest.Timeout(cfg.Server.Rest.Timeout.AsDuration())) opts = append(opts, kratosRest.Timeout(cfg.Server.Rest.Timeout.AsDuration()))
} }
return kratosRest.NewServer(opts...) srv := kratosRest.NewServer(opts...)
if cfg.Server.Rest.GetEnablePprof() {
registerHttpPprof(srv)
}
return srv
}
func registerHttpPprof(s *kratosRest.Server) {
s.HandleFunc("/debug/pprof", pprof.Index)
s.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
s.HandleFunc("/debug/pprof/profile", pprof.Profile)
s.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
s.HandleFunc("/debug/pprof/trace", pprof.Trace)
s.HandleFunc("/debug/pprof/allocs", pprof.Handler("allocs").ServeHTTP)
s.HandleFunc("/debug/pprof/block", pprof.Handler("block").ServeHTTP)
s.HandleFunc("/debug/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
s.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP)
s.HandleFunc("/debug/pprof/mutex", pprof.Handler("mutex").ServeHTTP)
s.HandleFunc("/debug/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
} }

View File

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

View File

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