feat: notify config, refactor config load.
This commit is contained in:
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Not Support Windows
|
||||||
|
|
||||||
|
.PHONY: help wire conf ent build api openapi init all
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
IS_WINDOWS:=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
|
||||||
|
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
|
SRCS_MK := $(foreach dir, app, $(wildcard $(dir)/*/*/Makefile))
|
||||||
|
|
||||||
|
# generate protobuf api go code
|
||||||
|
api:
|
||||||
|
buf generate
|
||||||
|
|
||||||
|
# show help
|
||||||
|
help:
|
||||||
|
@echo ""
|
||||||
|
@echo "Usage:"
|
||||||
|
@echo " make [target]"
|
||||||
|
@echo ""
|
||||||
|
@echo 'Targets:'
|
||||||
|
@awk '/^[a-zA-Z\-_0-9]+:/ { \
|
||||||
|
helpMessage = match(lastLine, /^# (.*)/); \
|
||||||
|
if (helpMessage) { \
|
||||||
|
helpCommand = substr($$1, 0, index($$1, ":")-1); \
|
||||||
|
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
|
||||||
|
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
{ lastLine = $$0 }' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
@@ -12,6 +12,7 @@ import "conf/v1/logger.proto";
|
|||||||
import "conf/v1/registry.proto";
|
import "conf/v1/registry.proto";
|
||||||
import "conf/v1/oss.proto";
|
import "conf/v1/oss.proto";
|
||||||
import "conf/v1/config.proto";
|
import "conf/v1/config.proto";
|
||||||
|
import "conf/v1/notify.proto";
|
||||||
|
|
||||||
// 引导信息
|
// 引导信息
|
||||||
message Bootstrap {
|
message Bootstrap {
|
||||||
@@ -23,4 +24,5 @@ message Bootstrap {
|
|||||||
Registry registry = 6;
|
Registry registry = 6;
|
||||||
RemoteConfig config = 7;
|
RemoteConfig config = 7;
|
||||||
OSS oss = 8;
|
OSS oss = 8;
|
||||||
|
Notification notify = 9;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ message Data {
|
|||||||
string driver = 1; // 驱动名:mysql、postgresql、mongodb、sqlite……
|
string driver = 1; // 驱动名:mysql、postgresql、mongodb、sqlite……
|
||||||
string source = 2; // 数据源(DSN字符串)
|
string source = 2; // 数据源(DSN字符串)
|
||||||
bool migrate = 3; // 数据迁移开关
|
bool migrate = 3; // 数据迁移开关
|
||||||
|
bool debug = 4; // 调试开关
|
||||||
|
int32 max_idle_connections = 5; // 连接池最大空闲连接数
|
||||||
|
int32 max_open_connections = 6; // 连接池最大打开连接数
|
||||||
|
google.protobuf.Duration connection_max_lifetime = 7; // 连接可重用的最大时间长度
|
||||||
}
|
}
|
||||||
|
|
||||||
// redis
|
// redis
|
||||||
|
|||||||
18
api/conf/v1/notify.proto
Normal file
18
api/conf/v1/notify.proto
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package conf;
|
||||||
|
|
||||||
|
option go_package = "github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1;conf";
|
||||||
|
|
||||||
|
// 通知消息
|
||||||
|
message Notification {
|
||||||
|
// 短信
|
||||||
|
message SMS {
|
||||||
|
string endpoint = 1; // 公网接入地址
|
||||||
|
string region_id = 2; // 地域ID
|
||||||
|
string access_key_id = 3; // 访问密钥ID
|
||||||
|
string access_key_secret = 4; // 访问密钥
|
||||||
|
}
|
||||||
|
|
||||||
|
SMS sms = 1;
|
||||||
|
}
|
||||||
@@ -55,10 +55,25 @@ message Server {
|
|||||||
repeated string addrs = 1; // 对端网络地址
|
repeated string addrs = 1; // 对端网络地址
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Asynq
|
||||||
|
message Asynq {
|
||||||
|
string endpoint = 1; // 对端网络地址
|
||||||
|
string password = 2; // redis登录密码
|
||||||
|
int32 db = 3; // 数据库索引
|
||||||
|
}
|
||||||
|
|
||||||
|
// Machinery
|
||||||
|
message Machinery {
|
||||||
|
repeated string brokers = 1; // broker的地址,可以根据实际使用的存储介质,分别指定Redis、AMQP或AWS SQS;
|
||||||
|
repeated string backends = 2; // backend配置,用来指定存放结果的介质的配置。可以根据需求,分别指定为:Redis、memcached或mongodb等;
|
||||||
|
}
|
||||||
|
|
||||||
REST rest = 1; // REST服务
|
REST rest = 1; // REST服务
|
||||||
GRPC grpc = 2; // gRPC服务
|
GRPC grpc = 2; // gRPC服务
|
||||||
Websocket websocket = 3; // Websocket服务
|
Websocket websocket = 3; // Websocket服务
|
||||||
Mqtt mqtt = 4; // MQTT服务
|
Mqtt mqtt = 4; // MQTT服务
|
||||||
Kafka kafka = 5; // Kafka服务
|
Kafka kafka = 5; // Kafka服务
|
||||||
RabbitMQ rabbitmq = 6; // RabbitMQ服务
|
RabbitMQ rabbitmq = 6; // RabbitMQ服务
|
||||||
|
Asynq asynq = 7; // Asynq服务
|
||||||
|
Machinery machinery = 8; // Machinery服务
|
||||||
}
|
}
|
||||||
|
|||||||
117
config.go
117
config.go
@@ -41,8 +41,65 @@ import (
|
|||||||
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
|
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var commonConfig = &conf.Bootstrap{}
|
||||||
|
var configList []interface{}
|
||||||
|
|
||||||
const remoteConfigSourceConfigFile = "remote.yaml"
|
const remoteConfigSourceConfigFile = "remote.yaml"
|
||||||
|
|
||||||
|
// RegisterConfig 注册配置
|
||||||
|
func RegisterConfig(c interface{}) {
|
||||||
|
initBootstrapConfig()
|
||||||
|
configList = append(configList, c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func initBootstrapConfig() {
|
||||||
|
if len(configList) > 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
configList = append(configList, commonConfig)
|
||||||
|
|
||||||
|
if commonConfig.Server == nil {
|
||||||
|
commonConfig.Server = &conf.Server{}
|
||||||
|
configList = append(configList, commonConfig.Server)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Client == nil {
|
||||||
|
commonConfig.Client = &conf.Client{}
|
||||||
|
configList = append(configList, commonConfig.Client)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Data == nil {
|
||||||
|
commonConfig.Data = &conf.Data{}
|
||||||
|
configList = append(configList, commonConfig.Data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Trace == nil {
|
||||||
|
commonConfig.Trace = &conf.Tracer{}
|
||||||
|
configList = append(configList, commonConfig.Trace)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Logger == nil {
|
||||||
|
commonConfig.Logger = &conf.Logger{}
|
||||||
|
configList = append(configList, commonConfig.Logger)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Registry == nil {
|
||||||
|
commonConfig.Registry = &conf.Registry{}
|
||||||
|
configList = append(configList, commonConfig.Registry)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Oss == nil {
|
||||||
|
commonConfig.Oss = &conf.OSS{}
|
||||||
|
configList = append(configList, commonConfig.Oss)
|
||||||
|
}
|
||||||
|
|
||||||
|
if commonConfig.Notify == nil {
|
||||||
|
commonConfig.Notify = &conf.Notification{}
|
||||||
|
configList = append(configList, commonConfig.Notify)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NewConfigProvider 创建一个配置
|
// NewConfigProvider 创建一个配置
|
||||||
func NewConfigProvider(configPath string) config.Config {
|
func NewConfigProvider(configPath string) config.Config {
|
||||||
err, rc := LoadRemoteConfigSourceConfigs(configPath)
|
err, rc := LoadRemoteConfigSourceConfigs(configPath)
|
||||||
@@ -66,53 +123,22 @@ func NewConfigProvider(configPath string) config.Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LoadBootstrapConfig 加载程序引导配置
|
// LoadBootstrapConfig 加载程序引导配置
|
||||||
func LoadBootstrapConfig(configPath string) *conf.Bootstrap {
|
func LoadBootstrapConfig(configPath string) error {
|
||||||
cfg := NewConfigProvider(configPath)
|
cfg := NewConfigProvider(configPath)
|
||||||
|
|
||||||
if err := cfg.Load(); err != nil {
|
if err := cfg.Load(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bc conf.Bootstrap
|
initBootstrapConfig()
|
||||||
if err := cfg.Scan(&bc); err != nil {
|
|
||||||
panic(err)
|
for c := range configList {
|
||||||
|
if err := cfg.Scan(c); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if bc.Server == nil {
|
return nil
|
||||||
bc.Server = &conf.Server{}
|
|
||||||
_ = cfg.Scan(&bc.Server)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Client == nil {
|
|
||||||
bc.Client = &conf.Client{}
|
|
||||||
_ = cfg.Scan(&bc.Client)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Data == nil {
|
|
||||||
bc.Data = &conf.Data{}
|
|
||||||
_ = cfg.Scan(&bc.Data)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Trace == nil {
|
|
||||||
bc.Trace = &conf.Tracer{}
|
|
||||||
_ = cfg.Scan(&bc.Trace)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Logger == nil {
|
|
||||||
bc.Logger = &conf.Logger{}
|
|
||||||
_ = cfg.Scan(&bc.Logger)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Registry == nil {
|
|
||||||
bc.Registry = &conf.Registry{}
|
|
||||||
_ = cfg.Scan(&bc.Registry)
|
|
||||||
}
|
|
||||||
|
|
||||||
if bc.Oss == nil {
|
|
||||||
bc.Oss = &conf.OSS{}
|
|
||||||
_ = cfg.Scan(&bc.Oss)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &bc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func pathExists(path string) bool {
|
func pathExists(path string) bool {
|
||||||
@@ -151,12 +177,15 @@ func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig
|
|||||||
return err, nil
|
return err, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var rc conf.Bootstrap
|
initBootstrapConfig()
|
||||||
if err = cfg.Scan(&rc); err != nil {
|
|
||||||
return err, nil
|
for c := range configList {
|
||||||
|
if err = cfg.Scan(c); err != nil {
|
||||||
|
return err, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, rc.Config
|
return nil, commonConfig.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigType string
|
type ConfigType string
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/bootstrap.proto
|
// source: conf/v1/bootstrap.proto
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ type Bootstrap struct {
|
|||||||
Registry *Registry `protobuf:"bytes,6,opt,name=registry,proto3" json:"registry,omitempty"`
|
Registry *Registry `protobuf:"bytes,6,opt,name=registry,proto3" json:"registry,omitempty"`
|
||||||
Config *RemoteConfig `protobuf:"bytes,7,opt,name=config,proto3" json:"config,omitempty"`
|
Config *RemoteConfig `protobuf:"bytes,7,opt,name=config,proto3" json:"config,omitempty"`
|
||||||
Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3" json:"oss,omitempty"`
|
Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3" json:"oss,omitempty"`
|
||||||
|
Notify *Notification `protobuf:"bytes,9,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Bootstrap) Reset() {
|
func (x *Bootstrap) Reset() {
|
||||||
@@ -124,6 +125,13 @@ func (x *Bootstrap) GetOss() *OSS {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Bootstrap) GetNotify() *Notification {
|
||||||
|
if x != nil {
|
||||||
|
return x.Notify
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_conf_v1_bootstrap_proto protoreflect.FileDescriptor
|
var File_conf_v1_bootstrap_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_conf_v1_bootstrap_proto_rawDesc = []byte{
|
var file_conf_v1_bootstrap_proto_rawDesc = []byte{
|
||||||
@@ -139,30 +147,35 @@ var file_conf_v1_bootstrap_proto_rawDesc = []byte{
|
|||||||
0x66, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
|
0x66, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
|
||||||
0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x73, 0x73,
|
0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x73, 0x73,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f,
|
||||||
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x02, 0x0a,
|
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x63, 0x6f,
|
||||||
0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x73, 0x65,
|
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e,
|
0x74, 0x6f, 0x22, 0xe2, 0x02, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70,
|
||||||
0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
0x12, 0x24, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x12, 0x24, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06,
|
||||||
0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06,
|
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
||||||
0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61,
|
0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x04,
|
||||||
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18,
|
0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x63, 0x6f, 0x6e,
|
||||||
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61,
|
0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x05,
|
||||||
0x63, 0x65, 0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x6c, 0x6f,
|
0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f,
|
||||||
0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e,
|
0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65,
|
||||||
0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72,
|
0x12, 0x24, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x12, 0x2a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01,
|
0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06,
|
||||||
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
|
0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
|
||||||
0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x06,
|
0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||||
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63,
|
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
|
||||||
0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
0x72, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01,
|
||||||
0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18,
|
0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65,
|
||||||
0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53,
|
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b,
|
||||||
0x52, 0x03, 0x6f, 0x73, 0x73, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d,
|
0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f,
|
||||||
0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f,
|
0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x6e,
|
||||||
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f,
|
||||||
0x6f, 0x33,
|
0x6e, 0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 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, 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 (
|
var (
|
||||||
@@ -188,6 +201,7 @@ var file_conf_v1_bootstrap_proto_goTypes = []interface{}{
|
|||||||
(*Registry)(nil), // 6: conf.Registry
|
(*Registry)(nil), // 6: conf.Registry
|
||||||
(*RemoteConfig)(nil), // 7: conf.RemoteConfig
|
(*RemoteConfig)(nil), // 7: conf.RemoteConfig
|
||||||
(*OSS)(nil), // 8: conf.OSS
|
(*OSS)(nil), // 8: conf.OSS
|
||||||
|
(*Notification)(nil), // 9: conf.Notification
|
||||||
}
|
}
|
||||||
var file_conf_v1_bootstrap_proto_depIdxs = []int32{
|
var file_conf_v1_bootstrap_proto_depIdxs = []int32{
|
||||||
1, // 0: conf.Bootstrap.server:type_name -> conf.Server
|
1, // 0: conf.Bootstrap.server:type_name -> conf.Server
|
||||||
@@ -198,11 +212,12 @@ var file_conf_v1_bootstrap_proto_depIdxs = []int32{
|
|||||||
6, // 5: conf.Bootstrap.registry:type_name -> conf.Registry
|
6, // 5: conf.Bootstrap.registry:type_name -> conf.Registry
|
||||||
7, // 6: conf.Bootstrap.config:type_name -> conf.RemoteConfig
|
7, // 6: conf.Bootstrap.config:type_name -> conf.RemoteConfig
|
||||||
8, // 7: conf.Bootstrap.oss:type_name -> conf.OSS
|
8, // 7: conf.Bootstrap.oss:type_name -> conf.OSS
|
||||||
8, // [8:8] is the sub-list for method output_type
|
9, // 8: conf.Bootstrap.notify:type_name -> conf.Notification
|
||||||
8, // [8:8] is the sub-list for method input_type
|
9, // [9:9] is the sub-list for method output_type
|
||||||
8, // [8:8] is the sub-list for extension type_name
|
9, // [9:9] is the sub-list for method input_type
|
||||||
8, // [8:8] is the sub-list for extension extendee
|
9, // [9:9] is the sub-list for extension type_name
|
||||||
0, // [0:8] is the sub-list for field type_name
|
9, // [9:9] is the sub-list for extension extendee
|
||||||
|
0, // [0:9] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_conf_v1_bootstrap_proto_init() }
|
func init() { file_conf_v1_bootstrap_proto_init() }
|
||||||
@@ -218,6 +233,7 @@ func file_conf_v1_bootstrap_proto_init() {
|
|||||||
file_conf_v1_registry_proto_init()
|
file_conf_v1_registry_proto_init()
|
||||||
file_conf_v1_oss_proto_init()
|
file_conf_v1_oss_proto_init()
|
||||||
file_conf_v1_config_proto_init()
|
file_conf_v1_config_proto_init()
|
||||||
|
file_conf_v1_notify_proto_init()
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_conf_v1_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_conf_v1_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Bootstrap); i {
|
switch v := v.(*Bootstrap); i {
|
||||||
|
|||||||
@@ -289,6 +289,35 @@ func (m *Bootstrap) validate(all bool) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if all {
|
||||||
|
switch v := interface{}(m.GetNotify()).(type) {
|
||||||
|
case interface{ ValidateAll() error }:
|
||||||
|
if err := v.ValidateAll(); err != nil {
|
||||||
|
errors = append(errors, BootstrapValidationError{
|
||||||
|
field: "Notify",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case interface{ Validate() error }:
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
errors = append(errors, BootstrapValidationError{
|
||||||
|
field: "Notify",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if v, ok := interface{}(m.GetNotify()).(interface{ Validate() error }); ok {
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
return BootstrapValidationError{
|
||||||
|
field: "Notify",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return BootstrapMultiError(errors)
|
return BootstrapMultiError(errors)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/client.proto
|
// source: conf/v1/client.proto
|
||||||
|
|
||||||
@@ -216,10 +216,12 @@ var file_conf_v1_client_proto_rawDesc = []byte{
|
|||||||
0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x6d,
|
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, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x10, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72,
|
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, 0x42, 0x23, 0x5a,
|
0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x42, 0x3b, 0x5a,
|
||||||
0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
|
0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64,
|
||||||
0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f,
|
0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72,
|
||||||
0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/config.proto
|
// source: conf/v1/config.proto
|
||||||
|
|
||||||
@@ -527,9 +527,11 @@ var file_conf_v1_config_proto_rawDesc = []byte{
|
|||||||
0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d,
|
0x75, 0x62, 0x65, 0x72, 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,
|
0x65, 0x73, 0x70, 0x61, 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,
|
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72,
|
||||||
0x69, 0x73, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f,
|
0x69, 0x73, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||||
0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f,
|
0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f,
|
||||||
0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 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, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/data.proto
|
// source: conf/v1/data.proto
|
||||||
|
|
||||||
@@ -83,9 +83,13 @@ type Data_Database struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` // 驱动名:mysql、postgresql、mongodb、sqlite……
|
Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` // 驱动名:mysql、postgresql、mongodb、sqlite……
|
||||||
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // 数据源(DSN字符串)
|
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // 数据源(DSN字符串)
|
||||||
Migrate bool `protobuf:"varint,3,opt,name=migrate,proto3" json:"migrate,omitempty"` // 数据迁移开关
|
Migrate bool `protobuf:"varint,3,opt,name=migrate,proto3" json:"migrate,omitempty"` // 数据迁移开关
|
||||||
|
Debug bool `protobuf:"varint,4,opt,name=debug,proto3" json:"debug,omitempty"` // 调试开关
|
||||||
|
MaxIdleConnections int32 `protobuf:"varint,5,opt,name=max_idle_connections,json=maxIdleConnections,proto3" json:"max_idle_connections,omitempty"` // 连接池最大空闲连接数
|
||||||
|
MaxOpenConnections int32 `protobuf:"varint,6,opt,name=max_open_connections,json=maxOpenConnections,proto3" json:"max_open_connections,omitempty"` // 连接池最大打开连接数
|
||||||
|
ConnectionMaxLifetime *durationpb.Duration `protobuf:"bytes,7,opt,name=connection_max_lifetime,json=connectionMaxLifetime,proto3" json:"connection_max_lifetime,omitempty"` // 连接可重用的最大时间长度
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Data_Database) Reset() {
|
func (x *Data_Database) Reset() {
|
||||||
@@ -141,6 +145,34 @@ func (x *Data_Database) GetMigrate() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Data_Database) GetDebug() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Debug
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Data_Database) GetMaxIdleConnections() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.MaxIdleConnections
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Data_Database) GetMaxOpenConnections() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.MaxOpenConnections
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Data_Database) GetConnectionMaxLifetime() *durationpb.Duration {
|
||||||
|
if x != nil {
|
||||||
|
return x.ConnectionMaxLifetime
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// redis
|
// redis
|
||||||
type Data_Redis struct {
|
type Data_Redis struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@@ -243,39 +275,54 @@ var file_conf_v1_data_proto_rawDesc = []byte{
|
|||||||
0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70,
|
0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67,
|
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,
|
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, 0xd5, 0x03, 0x0a, 0x04, 0x44,
|
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x05, 0x0a, 0x04, 0x44,
|
||||||
0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18,
|
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,
|
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,
|
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,
|
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,
|
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, 0x54, 0x0a, 0x08,
|
0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0xa1, 0x02, 0x0a,
|
||||||
0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76,
|
0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69,
|
||||||
0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65,
|
||||||
0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67, 0x72,
|
0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x67,
|
||||||
0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72, 0x61,
|
0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x67, 0x72,
|
||||||
0x74, 0x65, 0x1a, 0x9d, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07,
|
0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e,
|
0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78,
|
||||||
0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02,
|
0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61,
|
0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x6c, 0x65,
|
||||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61,
|
0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x6d,
|
||||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, 0x01,
|
0x61, 0x78, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
|
||||||
0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74,
|
0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x4f, 0x70,
|
||||||
0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
|
0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x51, 0x0a,
|
||||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
|
0x17, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x5f,
|
||||||
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d,
|
0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
|
||||||
0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d,
|
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||||
0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f,
|
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,
|
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,
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f,
|
||||||
0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f,
|
||||||
0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,
|
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f,
|
0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
|
||||||
0x75, 0x74, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f,
|
0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
|
||||||
0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f,
|
0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||||
0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -300,14 +347,15 @@ var file_conf_v1_data_proto_goTypes = []interface{}{
|
|||||||
var file_conf_v1_data_proto_depIdxs = []int32{
|
var file_conf_v1_data_proto_depIdxs = []int32{
|
||||||
1, // 0: conf.Data.database:type_name -> conf.Data.Database
|
1, // 0: conf.Data.database:type_name -> conf.Data.Database
|
||||||
2, // 1: conf.Data.redis:type_name -> conf.Data.Redis
|
2, // 1: conf.Data.redis:type_name -> conf.Data.Redis
|
||||||
3, // 2: conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration
|
3, // 2: conf.Data.Database.connection_max_lifetime:type_name -> google.protobuf.Duration
|
||||||
3, // 3: conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration
|
3, // 3: conf.Data.Redis.dial_timeout:type_name -> google.protobuf.Duration
|
||||||
3, // 4: conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration
|
3, // 4: conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration
|
||||||
5, // [5:5] is the sub-list for method output_type
|
3, // 5: conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration
|
||||||
5, // [5:5] is the sub-list for method input_type
|
6, // [6:6] is the sub-list for method output_type
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
6, // [6:6] is the sub-list for method input_type
|
||||||
5, // [5:5] is the sub-list for extension extendee
|
6, // [6:6] is the sub-list for extension type_name
|
||||||
0, // [0:5] is the sub-list for field type_name
|
6, // [6:6] is the sub-list for extension extendee
|
||||||
|
0, // [0:6] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_conf_v1_data_proto_init() }
|
func init() { file_conf_v1_data_proto_init() }
|
||||||
|
|||||||
@@ -219,6 +219,41 @@ func (m *Data_Database) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for Migrate
|
// no validation rules for Migrate
|
||||||
|
|
||||||
|
// no validation rules for Debug
|
||||||
|
|
||||||
|
// no validation rules for MaxIdleConnections
|
||||||
|
|
||||||
|
// no validation rules for MaxOpenConnections
|
||||||
|
|
||||||
|
if all {
|
||||||
|
switch v := interface{}(m.GetConnectionMaxLifetime()).(type) {
|
||||||
|
case interface{ ValidateAll() error }:
|
||||||
|
if err := v.ValidateAll(); err != nil {
|
||||||
|
errors = append(errors, Data_DatabaseValidationError{
|
||||||
|
field: "ConnectionMaxLifetime",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case interface{ Validate() error }:
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
errors = append(errors, Data_DatabaseValidationError{
|
||||||
|
field: "ConnectionMaxLifetime",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if v, ok := interface{}(m.GetConnectionMaxLifetime()).(interface{ Validate() error }); ok {
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
return Data_DatabaseValidationError{
|
||||||
|
field: "ConnectionMaxLifetime",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return Data_DatabaseMultiError(errors)
|
return Data_DatabaseMultiError(errors)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/logger.proto
|
// source: conf/v1/logger.proto
|
||||||
|
|
||||||
@@ -520,10 +520,11 @@ var file_conf_v1_logger_proto_rawDesc = []byte{
|
|||||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79,
|
0x03, 0x20, 0x01, 0x28, 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,
|
0x12, 0x23, 0x0a, 0x0d, 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,
|
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53,
|
||||||
0x65, 0x63, 0x72, 0x65, 0x74, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d,
|
0x65, 0x63, 0x72, 0x65, 0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||||
0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f,
|
0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||||
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
|
||||||
0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/middleware.proto
|
// source: conf/v1/middleware.proto
|
||||||
|
|
||||||
@@ -343,10 +343,11 @@ var file_conf_v1_middleware_proto_rawDesc = []byte{
|
|||||||
0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x03, 0x20,
|
0x6e, 0x74, 0x65, 0x72, 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,
|
0x01, 0x28, 0x08, 0x52, 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, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d,
|
||||||
0x6d, 0x61, 0x72, 0x79, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62,
|
0x6d, 0x61, 0x72, 0x79, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e,
|
0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d,
|
||||||
0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70,
|
||||||
0x33,
|
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 (
|
var (
|
||||||
|
|||||||
242
gen/api/go/conf/v1/notify.pb.go
Normal file
242
gen/api/go/conf/v1/notify.pb.go
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.31.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: conf/v1/notify.proto
|
||||||
|
|
||||||
|
package conf
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
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 Notification struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Sms *Notification_SMS `protobuf:"bytes,1,opt,name=sms,proto3" json:"sms,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification) Reset() {
|
||||||
|
*x = Notification{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_conf_v1_notify_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Notification) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Notification) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_conf_v1_notify_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 Notification.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Notification) Descriptor() ([]byte, []int) {
|
||||||
|
return file_conf_v1_notify_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification) GetSms() *Notification_SMS {
|
||||||
|
if x != nil {
|
||||||
|
return x.Sms
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短信
|
||||||
|
type Notification_SMS struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||||
|
RegionId string `protobuf:"bytes,2,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` // 地域ID
|
||||||
|
AccessKeyId string `protobuf:"bytes,3,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` // 访问密钥ID
|
||||||
|
AccessKeySecret string `protobuf:"bytes,4,opt,name=access_key_secret,json=accessKeySecret,proto3" json:"access_key_secret,omitempty"` // 访问密钥
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) Reset() {
|
||||||
|
*x = Notification_SMS{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_conf_v1_notify_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Notification_SMS) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_conf_v1_notify_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 Notification_SMS.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Notification_SMS) Descriptor() ([]byte, []int) {
|
||||||
|
return file_conf_v1_notify_proto_rawDescGZIP(), []int{0, 0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) GetEndpoint() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Endpoint
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) GetRegionId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.RegionId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) GetAccessKeyId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.AccessKeyId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Notification_SMS) GetAccessKeySecret() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.AccessKeySecret
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_conf_v1_notify_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_conf_v1_notify_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79,
|
||||||
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0xc9, 0x01, 0x0a,
|
||||||
|
0x0c, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a,
|
||||||
|
0x03, 0x73, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6e,
|
||||||
|
0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53,
|
||||||
|
0x4d, 0x53, 0x52, 0x03, 0x73, 0x6d, 0x73, 0x1a, 0x8e, 0x01, 0x0a, 0x03, 0x53, 0x4d, 0x53, 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, 0x1b, 0x0a, 0x09, 0x72,
|
||||||
|
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
||||||
|
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65,
|
||||||
|
0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x0b, 0x61, 0x63, 0x63, 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, 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, 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 (
|
||||||
|
file_conf_v1_notify_proto_rawDescOnce sync.Once
|
||||||
|
file_conf_v1_notify_proto_rawDescData = file_conf_v1_notify_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_conf_v1_notify_proto_rawDescGZIP() []byte {
|
||||||
|
file_conf_v1_notify_proto_rawDescOnce.Do(func() {
|
||||||
|
file_conf_v1_notify_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_notify_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_conf_v1_notify_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_conf_v1_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_conf_v1_notify_proto_goTypes = []interface{}{
|
||||||
|
(*Notification)(nil), // 0: conf.Notification
|
||||||
|
(*Notification_SMS)(nil), // 1: conf.Notification.SMS
|
||||||
|
}
|
||||||
|
var file_conf_v1_notify_proto_depIdxs = []int32{
|
||||||
|
1, // 0: conf.Notification.sms:type_name -> conf.Notification.SMS
|
||||||
|
1, // [1:1] is the sub-list for method output_type
|
||||||
|
1, // [1:1] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_conf_v1_notify_proto_init() }
|
||||||
|
func file_conf_v1_notify_proto_init() {
|
||||||
|
if File_conf_v1_notify_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_conf_v1_notify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Notification); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_conf_v1_notify_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Notification_SMS); 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{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_conf_v1_notify_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_conf_v1_notify_proto_goTypes,
|
||||||
|
DependencyIndexes: file_conf_v1_notify_proto_depIdxs,
|
||||||
|
MessageInfos: file_conf_v1_notify_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_conf_v1_notify_proto = out.File
|
||||||
|
file_conf_v1_notify_proto_rawDesc = nil
|
||||||
|
file_conf_v1_notify_proto_goTypes = nil
|
||||||
|
file_conf_v1_notify_proto_depIdxs = nil
|
||||||
|
}
|
||||||
272
gen/api/go/conf/v1/notify.pb.validate.go
Normal file
272
gen/api/go/conf/v1/notify.pb.validate.go
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||||
|
// source: conf/v1/notify.proto
|
||||||
|
|
||||||
|
package conf
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net"
|
||||||
|
"net/mail"
|
||||||
|
"net/url"
|
||||||
|
"regexp"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ensure the imports are used
|
||||||
|
var (
|
||||||
|
_ = bytes.MinRead
|
||||||
|
_ = errors.New("")
|
||||||
|
_ = fmt.Print
|
||||||
|
_ = utf8.UTFMax
|
||||||
|
_ = (*regexp.Regexp)(nil)
|
||||||
|
_ = (*strings.Reader)(nil)
|
||||||
|
_ = net.IPv4len
|
||||||
|
_ = time.Duration(0)
|
||||||
|
_ = (*url.URL)(nil)
|
||||||
|
_ = (*mail.Address)(nil)
|
||||||
|
_ = anypb.Any{}
|
||||||
|
_ = sort.Sort
|
||||||
|
)
|
||||||
|
|
||||||
|
// Validate checks the field values on Notification with the rules defined in
|
||||||
|
// the proto definition for this message. If any rules are violated, the first
|
||||||
|
// error encountered is returned, or nil if there are no violations.
|
||||||
|
func (m *Notification) Validate() error {
|
||||||
|
return m.validate(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateAll checks the field values on Notification with the rules defined
|
||||||
|
// in the proto definition for this message. If any rules are violated, the
|
||||||
|
// result is a list of violation errors wrapped in NotificationMultiError, or
|
||||||
|
// nil if none found.
|
||||||
|
func (m *Notification) ValidateAll() error {
|
||||||
|
return m.validate(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Notification) validate(all bool) error {
|
||||||
|
if m == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var errors []error
|
||||||
|
|
||||||
|
if all {
|
||||||
|
switch v := interface{}(m.GetSms()).(type) {
|
||||||
|
case interface{ ValidateAll() error }:
|
||||||
|
if err := v.ValidateAll(); err != nil {
|
||||||
|
errors = append(errors, NotificationValidationError{
|
||||||
|
field: "Sms",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case interface{ Validate() error }:
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
errors = append(errors, NotificationValidationError{
|
||||||
|
field: "Sms",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if v, ok := interface{}(m.GetSms()).(interface{ Validate() error }); ok {
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
return NotificationValidationError{
|
||||||
|
field: "Sms",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
return NotificationMultiError(errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NotificationMultiError is an error wrapping multiple validation errors
|
||||||
|
// returned by Notification.ValidateAll() if the designated constraints aren't met.
|
||||||
|
type NotificationMultiError []error
|
||||||
|
|
||||||
|
// Error returns a concatenation of all the error messages it wraps.
|
||||||
|
func (m NotificationMultiError) Error() string {
|
||||||
|
var msgs []string
|
||||||
|
for _, err := range m {
|
||||||
|
msgs = append(msgs, err.Error())
|
||||||
|
}
|
||||||
|
return strings.Join(msgs, "; ")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AllErrors returns a list of validation violation errors.
|
||||||
|
func (m NotificationMultiError) AllErrors() []error { return m }
|
||||||
|
|
||||||
|
// NotificationValidationError is the validation error returned by
|
||||||
|
// Notification.Validate if the designated constraints aren't met.
|
||||||
|
type NotificationValidationError struct {
|
||||||
|
field string
|
||||||
|
reason string
|
||||||
|
cause error
|
||||||
|
key bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field function returns field value.
|
||||||
|
func (e NotificationValidationError) Field() string { return e.field }
|
||||||
|
|
||||||
|
// Reason function returns reason value.
|
||||||
|
func (e NotificationValidationError) Reason() string { return e.reason }
|
||||||
|
|
||||||
|
// Cause function returns cause value.
|
||||||
|
func (e NotificationValidationError) Cause() error { return e.cause }
|
||||||
|
|
||||||
|
// Key function returns key value.
|
||||||
|
func (e NotificationValidationError) Key() bool { return e.key }
|
||||||
|
|
||||||
|
// ErrorName returns error name.
|
||||||
|
func (e NotificationValidationError) ErrorName() string { return "NotificationValidationError" }
|
||||||
|
|
||||||
|
// Error satisfies the builtin error interface
|
||||||
|
func (e NotificationValidationError) Error() string {
|
||||||
|
cause := ""
|
||||||
|
if e.cause != nil {
|
||||||
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
key := ""
|
||||||
|
if e.key {
|
||||||
|
key = "key for "
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"invalid %sNotification.%s: %s%s",
|
||||||
|
key,
|
||||||
|
e.field,
|
||||||
|
e.reason,
|
||||||
|
cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ error = NotificationValidationError{}
|
||||||
|
|
||||||
|
var _ interface {
|
||||||
|
Field() string
|
||||||
|
Reason() string
|
||||||
|
Key() bool
|
||||||
|
Cause() error
|
||||||
|
ErrorName() string
|
||||||
|
} = NotificationValidationError{}
|
||||||
|
|
||||||
|
// Validate checks the field values on Notification_SMS with the rules defined
|
||||||
|
// in the proto definition for this message. If any rules are violated, the
|
||||||
|
// first error encountered is returned, or nil if there are no violations.
|
||||||
|
func (m *Notification_SMS) Validate() error {
|
||||||
|
return m.validate(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateAll checks the field values on Notification_SMS with the rules
|
||||||
|
// defined in the proto definition for this message. If any rules are
|
||||||
|
// violated, the result is a list of violation errors wrapped in
|
||||||
|
// Notification_SMSMultiError, or nil if none found.
|
||||||
|
func (m *Notification_SMS) ValidateAll() error {
|
||||||
|
return m.validate(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Notification_SMS) validate(all bool) error {
|
||||||
|
if m == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var errors []error
|
||||||
|
|
||||||
|
// no validation rules for Endpoint
|
||||||
|
|
||||||
|
// no validation rules for RegionId
|
||||||
|
|
||||||
|
// no validation rules for AccessKeyId
|
||||||
|
|
||||||
|
// no validation rules for AccessKeySecret
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
return Notification_SMSMultiError(errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notification_SMSMultiError is an error wrapping multiple validation errors
|
||||||
|
// returned by Notification_SMS.ValidateAll() if the designated constraints
|
||||||
|
// aren't met.
|
||||||
|
type Notification_SMSMultiError []error
|
||||||
|
|
||||||
|
// Error returns a concatenation of all the error messages it wraps.
|
||||||
|
func (m Notification_SMSMultiError) Error() string {
|
||||||
|
var msgs []string
|
||||||
|
for _, err := range m {
|
||||||
|
msgs = append(msgs, err.Error())
|
||||||
|
}
|
||||||
|
return strings.Join(msgs, "; ")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AllErrors returns a list of validation violation errors.
|
||||||
|
func (m Notification_SMSMultiError) AllErrors() []error { return m }
|
||||||
|
|
||||||
|
// Notification_SMSValidationError is the validation error returned by
|
||||||
|
// Notification_SMS.Validate if the designated constraints aren't met.
|
||||||
|
type Notification_SMSValidationError struct {
|
||||||
|
field string
|
||||||
|
reason string
|
||||||
|
cause error
|
||||||
|
key bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field function returns field value.
|
||||||
|
func (e Notification_SMSValidationError) Field() string { return e.field }
|
||||||
|
|
||||||
|
// Reason function returns reason value.
|
||||||
|
func (e Notification_SMSValidationError) Reason() string { return e.reason }
|
||||||
|
|
||||||
|
// Cause function returns cause value.
|
||||||
|
func (e Notification_SMSValidationError) Cause() error { return e.cause }
|
||||||
|
|
||||||
|
// Key function returns key value.
|
||||||
|
func (e Notification_SMSValidationError) Key() bool { return e.key }
|
||||||
|
|
||||||
|
// ErrorName returns error name.
|
||||||
|
func (e Notification_SMSValidationError) ErrorName() string { return "Notification_SMSValidationError" }
|
||||||
|
|
||||||
|
// Error satisfies the builtin error interface
|
||||||
|
func (e Notification_SMSValidationError) Error() string {
|
||||||
|
cause := ""
|
||||||
|
if e.cause != nil {
|
||||||
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
key := ""
|
||||||
|
if e.key {
|
||||||
|
key = "key for "
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"invalid %sNotification_SMS.%s: %s%s",
|
||||||
|
key,
|
||||||
|
e.field,
|
||||||
|
e.reason,
|
||||||
|
cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ error = Notification_SMSValidationError{}
|
||||||
|
|
||||||
|
var _ interface {
|
||||||
|
Field() string
|
||||||
|
Reason() string
|
||||||
|
Key() bool
|
||||||
|
Cause() error
|
||||||
|
ErrorName() string
|
||||||
|
} = Notification_SMSValidationError{}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/oss.proto
|
// source: conf/v1/oss.proto
|
||||||
|
|
||||||
@@ -184,9 +184,11 @@ var file_conf_v1_oss_proto_rawDesc = []byte{
|
|||||||
0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d,
|
0x52, 0x0a, 0x75, 0x70, 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,
|
0x64, 0x6f, 0x77, 0x6e, 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,
|
0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73,
|
||||||
0x74, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f, 0x67,
|
0x74, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||||
0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76,
|
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f,
|
||||||
0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/registry.proto
|
// source: conf/v1/registry.proto
|
||||||
|
|
||||||
@@ -779,10 +779,12 @@ var file_conf_v1_registry_proto_rawDesc = []byte{
|
|||||||
0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
|
0x6b, 0x65, 0x6e, 0x18, 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,
|
0x1a, 0x2b, 0x0a, 0x0b, 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,
|
0x1c, 0x0a, 0x09, 0x65, 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, 0x23, 0x5a,
|
0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x3b, 0x5a,
|
||||||
0x21, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61,
|
0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64,
|
||||||
0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f,
|
0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72,
|
||||||
0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/server.proto
|
// source: conf/v1/server.proto
|
||||||
|
|
||||||
@@ -33,6 +33,8 @@ type Server struct {
|
|||||||
Mqtt *Server_Mqtt `protobuf:"bytes,4,opt,name=mqtt,proto3" json:"mqtt,omitempty"` // MQTT服务
|
Mqtt *Server_Mqtt `protobuf:"bytes,4,opt,name=mqtt,proto3" json:"mqtt,omitempty"` // MQTT服务
|
||||||
Kafka *Server_Kafka `protobuf:"bytes,5,opt,name=kafka,proto3" json:"kafka,omitempty"` // Kafka服务
|
Kafka *Server_Kafka `protobuf:"bytes,5,opt,name=kafka,proto3" json:"kafka,omitempty"` // Kafka服务
|
||||||
Rabbitmq *Server_RabbitMQ `protobuf:"bytes,6,opt,name=rabbitmq,proto3" json:"rabbitmq,omitempty"` // RabbitMQ服务
|
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服务
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Server) Reset() {
|
func (x *Server) Reset() {
|
||||||
@@ -109,6 +111,20 @@ func (x *Server) GetRabbitmq() *Server_RabbitMQ {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Server) GetAsynq() *Server_Asynq {
|
||||||
|
if x != nil {
|
||||||
|
return x.Asynq
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server) GetMachinery() *Server_Machinery {
|
||||||
|
if x != nil {
|
||||||
|
return x.Machinery
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// REST
|
// REST
|
||||||
type Server_REST struct {
|
type Server_REST struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@@ -477,6 +493,126 @@ func (x *Server_RabbitMQ) GetAddrs() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Asynq
|
||||||
|
type Server_Asynq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 对端网络地址
|
||||||
|
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // redis登录密码
|
||||||
|
Db int32 `protobuf:"varint,3,opt,name=db,proto3" json:"db,omitempty"` // 数据库索引
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) Reset() {
|
||||||
|
*x = Server_Asynq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_conf_v1_server_proto_msgTypes[7]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Server_Asynq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_conf_v1_server_proto_msgTypes[7]
|
||||||
|
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_Asynq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Server_Asynq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_conf_v1_server_proto_rawDescGZIP(), []int{0, 6}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) GetEndpoint() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Endpoint
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) GetPassword() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Password
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Asynq) GetDb() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Db
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Machinery
|
||||||
|
type Server_Machinery struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Brokers []string `protobuf:"bytes,1,rep,name=brokers,proto3" json:"brokers,omitempty"` // broker的地址,可以根据实际使用的存储介质,分别指定Redis、AMQP或AWS SQS;
|
||||||
|
Backends []string `protobuf:"bytes,2,rep,name=backends,proto3" json:"backends,omitempty"` // backend配置,用来指定存放结果的介质的配置。可以根据需求,分别指定为:Redis、memcached或mongodb等;
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Machinery) Reset() {
|
||||||
|
*x = Server_Machinery{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_conf_v1_server_proto_msgTypes[8]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Machinery) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Server_Machinery) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Server_Machinery) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_conf_v1_server_proto_msgTypes[8]
|
||||||
|
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_Machinery.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Server_Machinery) Descriptor() ([]byte, []int) {
|
||||||
|
return file_conf_v1_server_proto_rawDescGZIP(), []int{0, 7}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Machinery) GetBrokers() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Brokers
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Server_Machinery) GetBackends() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Backends
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type Server_REST_CORS struct {
|
type Server_REST_CORS struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -490,7 +626,7 @@ type Server_REST_CORS struct {
|
|||||||
func (x *Server_REST_CORS) Reset() {
|
func (x *Server_REST_CORS) Reset() {
|
||||||
*x = Server_REST_CORS{}
|
*x = Server_REST_CORS{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_conf_v1_server_proto_msgTypes[7]
|
mi := &file_conf_v1_server_proto_msgTypes[9]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -503,7 +639,7 @@ func (x *Server_REST_CORS) String() string {
|
|||||||
func (*Server_REST_CORS) ProtoMessage() {}
|
func (*Server_REST_CORS) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Server_REST_CORS) ProtoReflect() protoreflect.Message {
|
func (x *Server_REST_CORS) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_conf_v1_server_proto_msgTypes[7]
|
mi := &file_conf_v1_server_proto_msgTypes[9]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -548,7 +684,7 @@ var file_conf_v1_server_proto_rawDesc = []byte{
|
|||||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75,
|
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, 0x1a, 0x18, 0x63, 0x6f,
|
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f,
|
||||||
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,
|
0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x07, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 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, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
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,
|
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,
|
0x53, 0x54, 0x52, 0x04, 0x72, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63,
|
||||||
@@ -565,7 +701,13 @@ var file_conf_v1_server_proto_rawDesc = []byte{
|
|||||||
0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74,
|
0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74,
|
||||||
0x6d, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
0x6d, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||||
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x52,
|
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4d, 0x51, 0x52,
|
||||||
0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x6d, 0x71, 0x1a, 0x9d, 0x02, 0x0a, 0x04, 0x52, 0x45,
|
0x08, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x6d, 0x71, 0x12, 0x28, 0x0a, 0x05, 0x61, 0x73, 0x79,
|
||||||
|
0x6e, 0x71, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x73, 0x79, 0x6e, 0x71, 0x52, 0x05, 0x61, 0x73,
|
||||||
|
0x79, 0x6e, 0x71, 0x12, 0x34, 0x0a, 0x09, 0x6d, 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,
|
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,
|
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,
|
0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72,
|
||||||
@@ -607,10 +749,21 @@ var file_conf_v1_server_proto_rawDesc = []byte{
|
|||||||
0x61, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
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,
|
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,
|
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, 0x42, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61,
|
0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x1a, 0x4f, 0x0a, 0x05, 0x41, 0x73, 0x79,
|
||||||
0x74, 0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
|
0x6e, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01,
|
||||||
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -625,7 +778,7 @@ func file_conf_v1_server_proto_rawDescGZIP() []byte {
|
|||||||
return file_conf_v1_server_proto_rawDescData
|
return file_conf_v1_server_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_conf_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
var file_conf_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||||
var file_conf_v1_server_proto_goTypes = []interface{}{
|
var file_conf_v1_server_proto_goTypes = []interface{}{
|
||||||
(*Server)(nil), // 0: conf.Server
|
(*Server)(nil), // 0: conf.Server
|
||||||
(*Server_REST)(nil), // 1: conf.Server.REST
|
(*Server_REST)(nil), // 1: conf.Server.REST
|
||||||
@@ -634,9 +787,11 @@ var file_conf_v1_server_proto_goTypes = []interface{}{
|
|||||||
(*Server_Mqtt)(nil), // 4: conf.Server.Mqtt
|
(*Server_Mqtt)(nil), // 4: conf.Server.Mqtt
|
||||||
(*Server_Kafka)(nil), // 5: conf.Server.Kafka
|
(*Server_Kafka)(nil), // 5: conf.Server.Kafka
|
||||||
(*Server_RabbitMQ)(nil), // 6: conf.Server.RabbitMQ
|
(*Server_RabbitMQ)(nil), // 6: conf.Server.RabbitMQ
|
||||||
(*Server_REST_CORS)(nil), // 7: conf.Server.REST.CORS
|
(*Server_Asynq)(nil), // 7: conf.Server.Asynq
|
||||||
(*durationpb.Duration)(nil), // 8: google.protobuf.Duration
|
(*Server_Machinery)(nil), // 8: conf.Server.Machinery
|
||||||
(*Middleware)(nil), // 9: conf.Middleware
|
(*Server_REST_CORS)(nil), // 9: conf.Server.REST.CORS
|
||||||
|
(*durationpb.Duration)(nil), // 10: google.protobuf.Duration
|
||||||
|
(*Middleware)(nil), // 11: conf.Middleware
|
||||||
}
|
}
|
||||||
var file_conf_v1_server_proto_depIdxs = []int32{
|
var file_conf_v1_server_proto_depIdxs = []int32{
|
||||||
1, // 0: conf.Server.rest:type_name -> conf.Server.REST
|
1, // 0: conf.Server.rest:type_name -> conf.Server.REST
|
||||||
@@ -645,17 +800,19 @@ var file_conf_v1_server_proto_depIdxs = []int32{
|
|||||||
4, // 3: conf.Server.mqtt:type_name -> conf.Server.Mqtt
|
4, // 3: conf.Server.mqtt:type_name -> conf.Server.Mqtt
|
||||||
5, // 4: conf.Server.kafka:type_name -> conf.Server.Kafka
|
5, // 4: conf.Server.kafka:type_name -> conf.Server.Kafka
|
||||||
6, // 5: conf.Server.rabbitmq:type_name -> conf.Server.RabbitMQ
|
6, // 5: conf.Server.rabbitmq:type_name -> conf.Server.RabbitMQ
|
||||||
8, // 6: conf.Server.REST.timeout:type_name -> google.protobuf.Duration
|
7, // 6: conf.Server.asynq:type_name -> conf.Server.Asynq
|
||||||
7, // 7: conf.Server.REST.cors:type_name -> conf.Server.REST.CORS
|
8, // 7: conf.Server.machinery:type_name -> conf.Server.Machinery
|
||||||
9, // 8: conf.Server.REST.middleware:type_name -> conf.Middleware
|
10, // 8: conf.Server.REST.timeout:type_name -> google.protobuf.Duration
|
||||||
8, // 9: conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration
|
9, // 9: conf.Server.REST.cors:type_name -> conf.Server.REST.CORS
|
||||||
9, // 10: conf.Server.GRPC.middleware:type_name -> conf.Middleware
|
11, // 10: conf.Server.REST.middleware:type_name -> conf.Middleware
|
||||||
8, // 11: conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration
|
10, // 11: conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration
|
||||||
12, // [12:12] is the sub-list for method output_type
|
11, // 12: conf.Server.GRPC.middleware:type_name -> conf.Middleware
|
||||||
12, // [12:12] is the sub-list for method input_type
|
10, // 13: conf.Server.Websocket.timeout:type_name -> google.protobuf.Duration
|
||||||
12, // [12:12] is the sub-list for extension type_name
|
14, // [14:14] is the sub-list for method output_type
|
||||||
12, // [12:12] is the sub-list for extension extendee
|
14, // [14:14] is the sub-list for method input_type
|
||||||
0, // [0:12] is the sub-list for field type_name
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_conf_v1_server_proto_init() }
|
func init() { file_conf_v1_server_proto_init() }
|
||||||
@@ -750,6 +907,30 @@ func file_conf_v1_server_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_conf_v1_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_conf_v1_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Server_Asynq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_conf_v1_server_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Server_Machinery); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_conf_v1_server_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*Server_REST_CORS); i {
|
switch v := v.(*Server_REST_CORS); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -768,7 +949,7 @@ func file_conf_v1_server_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_conf_v1_server_proto_rawDesc,
|
RawDescriptor: file_conf_v1_server_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 8,
|
NumMessages: 10,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -230,6 +230,64 @@ func (m *Server) validate(all bool) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if all {
|
||||||
|
switch v := interface{}(m.GetAsynq()).(type) {
|
||||||
|
case interface{ ValidateAll() error }:
|
||||||
|
if err := v.ValidateAll(); err != nil {
|
||||||
|
errors = append(errors, ServerValidationError{
|
||||||
|
field: "Asynq",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case interface{ Validate() error }:
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
errors = append(errors, ServerValidationError{
|
||||||
|
field: "Asynq",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if v, ok := interface{}(m.GetAsynq()).(interface{ Validate() error }); ok {
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
return ServerValidationError{
|
||||||
|
field: "Asynq",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if all {
|
||||||
|
switch v := interface{}(m.GetMachinery()).(type) {
|
||||||
|
case interface{ ValidateAll() error }:
|
||||||
|
if err := v.ValidateAll(); err != nil {
|
||||||
|
errors = append(errors, ServerValidationError{
|
||||||
|
field: "Machinery",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case interface{ Validate() error }:
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
errors = append(errors, ServerValidationError{
|
||||||
|
field: "Machinery",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if v, ok := interface{}(m.GetMachinery()).(interface{ Validate() error }); ok {
|
||||||
|
if err := v.Validate(); err != nil {
|
||||||
|
return ServerValidationError{
|
||||||
|
field: "Machinery",
|
||||||
|
reason: "embedded message failed validation",
|
||||||
|
cause: err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return ServerMultiError(errors)
|
return ServerMultiError(errors)
|
||||||
}
|
}
|
||||||
@@ -1093,6 +1151,211 @@ var _ interface {
|
|||||||
ErrorName() string
|
ErrorName() string
|
||||||
} = Server_RabbitMQValidationError{}
|
} = Server_RabbitMQValidationError{}
|
||||||
|
|
||||||
|
// Validate checks the field values on Server_Asynq with the rules defined in
|
||||||
|
// the proto definition for this message. If any rules are violated, the first
|
||||||
|
// error encountered is returned, or nil if there are no violations.
|
||||||
|
func (m *Server_Asynq) Validate() error {
|
||||||
|
return m.validate(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateAll checks the field values on Server_Asynq with the rules defined
|
||||||
|
// in the proto definition for this message. If any rules are violated, the
|
||||||
|
// result is a list of violation errors wrapped in Server_AsynqMultiError, or
|
||||||
|
// nil if none found.
|
||||||
|
func (m *Server_Asynq) ValidateAll() error {
|
||||||
|
return m.validate(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Server_Asynq) validate(all bool) error {
|
||||||
|
if m == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var errors []error
|
||||||
|
|
||||||
|
// no validation rules for Endpoint
|
||||||
|
|
||||||
|
// no validation rules for Password
|
||||||
|
|
||||||
|
// no validation rules for Db
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
return Server_AsynqMultiError(errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Server_AsynqMultiError is an error wrapping multiple validation errors
|
||||||
|
// returned by Server_Asynq.ValidateAll() if the designated constraints aren't met.
|
||||||
|
type Server_AsynqMultiError []error
|
||||||
|
|
||||||
|
// Error returns a concatenation of all the error messages it wraps.
|
||||||
|
func (m Server_AsynqMultiError) Error() string {
|
||||||
|
var msgs []string
|
||||||
|
for _, err := range m {
|
||||||
|
msgs = append(msgs, err.Error())
|
||||||
|
}
|
||||||
|
return strings.Join(msgs, "; ")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AllErrors returns a list of validation violation errors.
|
||||||
|
func (m Server_AsynqMultiError) AllErrors() []error { return m }
|
||||||
|
|
||||||
|
// Server_AsynqValidationError is the validation error returned by
|
||||||
|
// Server_Asynq.Validate if the designated constraints aren't met.
|
||||||
|
type Server_AsynqValidationError struct {
|
||||||
|
field string
|
||||||
|
reason string
|
||||||
|
cause error
|
||||||
|
key bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field function returns field value.
|
||||||
|
func (e Server_AsynqValidationError) Field() string { return e.field }
|
||||||
|
|
||||||
|
// Reason function returns reason value.
|
||||||
|
func (e Server_AsynqValidationError) Reason() string { return e.reason }
|
||||||
|
|
||||||
|
// Cause function returns cause value.
|
||||||
|
func (e Server_AsynqValidationError) Cause() error { return e.cause }
|
||||||
|
|
||||||
|
// Key function returns key value.
|
||||||
|
func (e Server_AsynqValidationError) Key() bool { return e.key }
|
||||||
|
|
||||||
|
// ErrorName returns error name.
|
||||||
|
func (e Server_AsynqValidationError) ErrorName() string { return "Server_AsynqValidationError" }
|
||||||
|
|
||||||
|
// Error satisfies the builtin error interface
|
||||||
|
func (e Server_AsynqValidationError) Error() string {
|
||||||
|
cause := ""
|
||||||
|
if e.cause != nil {
|
||||||
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
key := ""
|
||||||
|
if e.key {
|
||||||
|
key = "key for "
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"invalid %sServer_Asynq.%s: %s%s",
|
||||||
|
key,
|
||||||
|
e.field,
|
||||||
|
e.reason,
|
||||||
|
cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ error = Server_AsynqValidationError{}
|
||||||
|
|
||||||
|
var _ interface {
|
||||||
|
Field() string
|
||||||
|
Reason() string
|
||||||
|
Key() bool
|
||||||
|
Cause() error
|
||||||
|
ErrorName() string
|
||||||
|
} = Server_AsynqValidationError{}
|
||||||
|
|
||||||
|
// Validate checks the field values on Server_Machinery with the rules defined
|
||||||
|
// in the proto definition for this message. If any rules are violated, the
|
||||||
|
// first error encountered is returned, or nil if there are no violations.
|
||||||
|
func (m *Server_Machinery) Validate() error {
|
||||||
|
return m.validate(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateAll checks the field values on Server_Machinery with the rules
|
||||||
|
// defined in the proto definition for this message. If any rules are
|
||||||
|
// violated, the result is a list of violation errors wrapped in
|
||||||
|
// Server_MachineryMultiError, or nil if none found.
|
||||||
|
func (m *Server_Machinery) ValidateAll() error {
|
||||||
|
return m.validate(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Server_Machinery) validate(all bool) error {
|
||||||
|
if m == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var errors []error
|
||||||
|
|
||||||
|
if len(errors) > 0 {
|
||||||
|
return Server_MachineryMultiError(errors)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Server_MachineryMultiError is an error wrapping multiple validation errors
|
||||||
|
// returned by Server_Machinery.ValidateAll() if the designated constraints
|
||||||
|
// aren't met.
|
||||||
|
type Server_MachineryMultiError []error
|
||||||
|
|
||||||
|
// Error returns a concatenation of all the error messages it wraps.
|
||||||
|
func (m Server_MachineryMultiError) Error() string {
|
||||||
|
var msgs []string
|
||||||
|
for _, err := range m {
|
||||||
|
msgs = append(msgs, err.Error())
|
||||||
|
}
|
||||||
|
return strings.Join(msgs, "; ")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AllErrors returns a list of validation violation errors.
|
||||||
|
func (m Server_MachineryMultiError) AllErrors() []error { return m }
|
||||||
|
|
||||||
|
// Server_MachineryValidationError is the validation error returned by
|
||||||
|
// Server_Machinery.Validate if the designated constraints aren't met.
|
||||||
|
type Server_MachineryValidationError struct {
|
||||||
|
field string
|
||||||
|
reason string
|
||||||
|
cause error
|
||||||
|
key bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field function returns field value.
|
||||||
|
func (e Server_MachineryValidationError) Field() string { return e.field }
|
||||||
|
|
||||||
|
// Reason function returns reason value.
|
||||||
|
func (e Server_MachineryValidationError) Reason() string { return e.reason }
|
||||||
|
|
||||||
|
// Cause function returns cause value.
|
||||||
|
func (e Server_MachineryValidationError) Cause() error { return e.cause }
|
||||||
|
|
||||||
|
// Key function returns key value.
|
||||||
|
func (e Server_MachineryValidationError) Key() bool { return e.key }
|
||||||
|
|
||||||
|
// ErrorName returns error name.
|
||||||
|
func (e Server_MachineryValidationError) ErrorName() string { return "Server_MachineryValidationError" }
|
||||||
|
|
||||||
|
// Error satisfies the builtin error interface
|
||||||
|
func (e Server_MachineryValidationError) Error() string {
|
||||||
|
cause := ""
|
||||||
|
if e.cause != nil {
|
||||||
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
key := ""
|
||||||
|
if e.key {
|
||||||
|
key = "key for "
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"invalid %sServer_Machinery.%s: %s%s",
|
||||||
|
key,
|
||||||
|
e.field,
|
||||||
|
e.reason,
|
||||||
|
cause)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ error = Server_MachineryValidationError{}
|
||||||
|
|
||||||
|
var _ interface {
|
||||||
|
Field() string
|
||||||
|
Reason() string
|
||||||
|
Key() bool
|
||||||
|
Cause() error
|
||||||
|
ErrorName() string
|
||||||
|
} = Server_MachineryValidationError{}
|
||||||
|
|
||||||
// Validate checks the field values on Server_REST_CORS with the rules defined
|
// Validate checks the field values on Server_REST_CORS with the rules defined
|
||||||
// in the proto definition for this message. If any rules are violated, the
|
// in the proto definition for this message. If any rules are violated, the
|
||||||
// first error encountered is returned, or nil if there are no violations.
|
// first error encountered is returned, or nil if there are no violations.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.30.0
|
// protoc-gen-go v1.31.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: conf/v1/tracer.proto
|
// source: conf/v1/tracer.proto
|
||||||
|
|
||||||
@@ -103,10 +103,11 @@ var file_conf_v1_tracer_proto_rawDesc = []byte{
|
|||||||
0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07,
|
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,
|
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,
|
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, 0x23, 0x5a, 0x21, 0x6b, 0x72, 0x61, 0x74,
|
0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68,
|
||||||
0x6f, 0x73, 0x2d, 0x62, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f,
|
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61,
|
||||||
0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70,
|
0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x67, 0x65,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
|||||||
254
go.mod
254
go.mod
@@ -5,183 +5,197 @@ go 1.20
|
|||||||
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-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/consul/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/config/polaris/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/config/polaris/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20230516054017-1d50f502622a
|
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/polaris/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/polaris/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20230519061918-96480c11ee42
|
github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20231023125239-6cdd81811e10
|
||||||
github.com/go-kratos/kratos/v2 v2.6.2
|
github.com/go-kratos/kratos/v2 v2.7.1
|
||||||
|
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/subcommands v1.2.0
|
github.com/google/subcommands v1.2.0
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.1
|
||||||
github.com/hashicorp/consul/api v1.20.0
|
github.com/hashicorp/consul/api v1.25.1
|
||||||
github.com/minio/minio-go/v7 v7.0.53
|
github.com/minio/minio-go/v7 v7.0.63
|
||||||
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/polarismesh/polaris-go v1.4.3
|
github.com/polarismesh/polaris-go v1.5.5
|
||||||
github.com/sirupsen/logrus v1.9.2
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/spf13/cobra v1.7.0
|
github.com/spf13/cobra v1.7.0
|
||||||
github.com/stretchr/testify v1.8.3
|
github.com/stretchr/testify v1.8.4
|
||||||
go.etcd.io/etcd/client/v3 v3.5.9
|
go.etcd.io/etcd/client/v3 v3.5.9
|
||||||
go.opentelemetry.io/otel v1.15.1
|
go.opentelemetry.io/otel v1.19.0
|
||||||
go.opentelemetry.io/otel/exporters/jaeger v1.15.1
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
|
||||||
go.opentelemetry.io/otel/exporters/zipkin v1.15.1
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0
|
||||||
go.opentelemetry.io/otel/sdk v1.15.1
|
go.opentelemetry.io/otel/exporters/zipkin v1.19.0
|
||||||
go.uber.org/zap v1.24.0
|
go.opentelemetry.io/otel/sdk v1.19.0
|
||||||
golang.org/x/tools v0.7.0
|
go.uber.org/zap v1.26.0
|
||||||
google.golang.org/grpc v1.54.0
|
golang.org/x/tools v0.14.0
|
||||||
google.golang.org/protobuf v1.30.0
|
google.golang.org/grpc v1.59.0
|
||||||
k8s.io/client-go v0.27.2
|
google.golang.org/protobuf v1.31.0
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||||
|
k8s.io/client-go v0.28.3
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
|
github.com/aliyun/alibaba-cloud-sdk-go v1.62.589 // indirect
|
||||||
github.com/aliyun/aliyun-log-go-sdk v0.1.44 // indirect
|
github.com/aliyun/aliyun-log-go-sdk v0.1.64 // indirect
|
||||||
github.com/apolloconfig/agollo/v4 v4.3.0 // indirect
|
github.com/apolloconfig/agollo/v4 v4.3.1 // indirect
|
||||||
github.com/armon/go-metrics v0.3.10 // indirect
|
github.com/armon/go-metrics v0.4.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.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.1.1 // indirect
|
github.com/cenkalti/backoff/v4 v4.2.1 // 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.0 // indirect
|
github.com/coreos/go-semver v0.3.1 // indirect
|
||||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/deckarep/golang-set v1.7.1 // indirect
|
github.com/deckarep/golang-set v1.8.0 // 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/dlclark/regexp2 v1.7.0 // indirect
|
github.com/dlclark/regexp2 v1.10.0 // 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.9.0 // indirect
|
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||||
github.com/fatih/color v1.13.0 // indirect
|
github.com/fatih/color v1.15.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.1 // 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.5.4 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/go-chassis/cari v0.6.0 // indirect
|
github.com/go-chassis/cari v0.9.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.0.1 // indirect
|
github.com/go-errors/errors v1.5.1 // indirect
|
||||||
github.com/go-kit/kit v0.10.0 // indirect
|
github.com/go-kit/kit v0.13.0 // indirect
|
||||||
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
github.com/go-kit/log v0.2.1 // indirect
|
||||||
|
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||||
github.com/go-logr/logr v1.2.4 // 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.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.20.0 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.1 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/go-playground/form/v4 v4.2.0 // indirect
|
github.com/go-playground/form/v4 v4.2.1 // indirect
|
||||||
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect
|
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect
|
||||||
github.com/go-redis/redis/extra/redisotel/v8 v8.11.5 // indirect
|
github.com/gofrs/uuid v4.4.0+incompatible // indirect
|
||||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
|
||||||
github.com/gofrs/uuid v4.2.0+incompatible // indirect
|
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic v0.5.7-v3refs // indirect
|
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.6.0 // indirect
|
||||||
github.com/google/gofuzz v1.1.0 // indirect
|
github.com/google/gofuzz v1.2.0 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.1 // indirect
|
||||||
github.com/gorilla/mux v1.8.0 // indirect
|
github.com/gorilla/mux v1.8.0 // indirect
|
||||||
github.com/gorilla/websocket v1.4.3-0.20210424162022-e8629af678b7 // indirect
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.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.2.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-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 v0.5.4 // indirect
|
github.com/hashicorp/golang-lru v1.0.2 // 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.12 // indirect
|
github.com/imdario/mergo v0.3.16 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
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.16.0 // indirect
|
github.com/klauspost/compress v1.17.2 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||||
github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect
|
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
|
||||||
github.com/magiconair/properties v1.8.6 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
github.com/mattn/go-runewidth v0.0.15 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // 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.0 // 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
|
||||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
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/natefinch/lumberjack v2.0.0+incompatible // indirect
|
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
|
||||||
github.com/openzipkin/zipkin-go v0.4.1 // indirect
|
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // 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 v1.9.4 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
|
github.com/philhofer/fwd v1.1.2 // 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.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/polarismesh/specification v1.2.1 // indirect
|
github.com/polarismesh/specification v1.4.1 // 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/prometheus/client_golang v1.12.2 // indirect
|
github.com/prometheus/client_golang v1.17.0 // indirect
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.5.0 // indirect
|
||||||
github.com/prometheus/common v0.35.0 // indirect
|
github.com/prometheus/common v0.45.0 // indirect
|
||||||
github.com/prometheus/procfs v0.7.3 // indirect
|
github.com/prometheus/procfs v0.12.0 // indirect
|
||||||
github.com/rs/xid v1.4.0 // indirect
|
github.com/rivo/uniseg v0.4.4 // indirect
|
||||||
github.com/shirou/gopsutil/v3 v3.23.2 // 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/shoenig/go-m1cpu v0.1.6 // indirect
|
||||||
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.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.11.0 // indirect
|
github.com/spf13/viper v1.17.0 // indirect
|
||||||
github.com/subosito/gotenv v1.2.0 // indirect
|
github.com/stretchr/objx v0.5.1 // indirect
|
||||||
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/tinylib/msgp v1.1.6 // indirect
|
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.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.0 // indirect
|
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||||
github.com/yusufpapurcu/wmi v1.2.2 // 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.9 // indirect
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
|
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.15.1 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.opentelemetry.io/otel/metric v1.19.0 // indirect
|
||||||
go.uber.org/multierr v1.8.0 // indirect
|
go.opentelemetry.io/otel/trace v1.19.0 // indirect
|
||||||
golang.org/x/crypto v0.6.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||||
golang.org/x/mod v0.9.0 // indirect
|
go.uber.org/atomic v1.11.0 // indirect
|
||||||
golang.org/x/net v0.8.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/oauth2 v0.4.0 // indirect
|
golang.org/x/crypto v0.14.0 // indirect
|
||||||
golang.org/x/sync v0.1.0 // indirect
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||||
golang.org/x/sys v0.7.0 // indirect
|
golang.org/x/mod v0.13.0 // indirect
|
||||||
golang.org/x/term v0.6.0 // indirect
|
golang.org/x/net v0.17.0 // indirect
|
||||||
golang.org/x/text v0.8.0 // indirect
|
golang.org/x/oauth2 v0.13.0 // indirect
|
||||||
golang.org/x/time v0.1.0 // indirect
|
golang.org/x/sync v0.4.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
golang.org/x/sys v0.13.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
|
golang.org/x/term v0.13.0 // indirect
|
||||||
|
golang.org/x/text v0.13.0 // indirect
|
||||||
|
golang.org/x/time v0.3.0 // indirect
|
||||||
|
google.golang.org/appengine v1.6.8 // indirect
|
||||||
|
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // 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/natefinch/lumberjack.v2 v2.0.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.27.2 // indirect
|
k8s.io/api v0.28.3 // indirect
|
||||||
k8s.io/apimachinery v0.27.2 // indirect
|
k8s.io/apimachinery v0.28.3 // indirect
|
||||||
k8s.io/klog/v2 v2.90.1 // indirect
|
k8s.io/klog/v2 v2.100.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // 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.2.3 // indirect
|
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
45
tracer.go
45
tracer.go
@@ -1,29 +1,22 @@
|
|||||||
package bootstrap
|
package bootstrap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"go.opentelemetry.io/otel/exporters/jaeger"
|
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||||
|
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
|
||||||
"go.opentelemetry.io/otel/exporters/zipkin"
|
"go.opentelemetry.io/otel/exporters/zipkin"
|
||||||
|
|
||||||
"github.com/tx7do/kratos-bootstrap/gen/api/go/conf/v1"
|
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/sdk/resource"
|
"go.opentelemetry.io/otel/sdk/resource"
|
||||||
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"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewJaegerExporter 创建一个jaeger导出器
|
|
||||||
func NewJaegerExporter(endpoint string) (traceSdk.SpanExporter, error) {
|
|
||||||
return jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewZipkinExporter 创建一个zipkin导出器
|
|
||||||
func NewZipkinExporter(endpoint string) (traceSdk.SpanExporter, error) {
|
|
||||||
return zipkin.New(endpoint)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewTracerExporter 创建一个导出器,支持:jaeger和zipkin
|
// NewTracerExporter 创建一个导出器,支持:jaeger和zipkin
|
||||||
func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, error) {
|
func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, error) {
|
||||||
if exporterName == "" {
|
if exporterName == "" {
|
||||||
@@ -31,10 +24,14 @@ func NewTracerExporter(exporterName, endpoint string) (traceSdk.SpanExporter, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch exporterName {
|
switch exporterName {
|
||||||
case "jaeger":
|
|
||||||
return NewJaegerExporter(endpoint)
|
|
||||||
case "zipkin":
|
case "zipkin":
|
||||||
return NewZipkinExporter(endpoint)
|
return NewZipkinExporter(endpoint)
|
||||||
|
case "jaeger":
|
||||||
|
fallthrough
|
||||||
|
case "otlptracehttp":
|
||||||
|
return NewOtlpHttpExporter(endpoint)
|
||||||
|
case "otlptracegrpc":
|
||||||
|
return NewOtlpGrpcExporter(endpoint)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("exporter type not support")
|
return nil, errors.New("exporter type not support")
|
||||||
}
|
}
|
||||||
@@ -82,3 +79,23 @@ func NewTracerProvider(cfg *conf.Tracer, serviceInfo *ServiceInfo) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewZipkinExporter 创建一个zipkin导出器
|
||||||
|
func NewZipkinExporter(endpoint string) (traceSdk.SpanExporter, error) {
|
||||||
|
return zipkin.New(endpoint)
|
||||||
|
}
|
||||||
|
|
||||||
|
//// NewJaegerExporter 创建一个jaeger导出器
|
||||||
|
//func NewJaegerExporter(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))
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewOtlpGrpcExporter 创建一个OTLP GRPC导出器
|
||||||
|
func NewOtlpGrpcExporter(endpoint string) (traceSdk.SpanExporter, error) {
|
||||||
|
return otlptracegrpc.New(context.Background(), otlptracegrpc.WithEndpoint(endpoint))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user