Compare commits
50 Commits
logger/v0.
...
cache/redi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bda9c5e6bb | ||
|
|
c88687b033 | ||
|
|
f3dbfdea77 | ||
|
|
579ffd9848 | ||
|
|
c5fc1a5b7d | ||
|
|
13aa5042b4 | ||
|
|
f7166c40b0 | ||
|
|
dfa34e0f51 | ||
|
|
405717ba70 | ||
|
|
54e887034f | ||
|
|
0759f2d752 | ||
|
|
59c731904a | ||
|
|
b0e91998e1 | ||
|
|
45a51d01a7 | ||
|
|
a94b15f3f9 | ||
|
|
22a04344d4 | ||
|
|
9e4e56bc2d | ||
|
|
411aabf0fa | ||
|
|
46bffc550a | ||
|
|
3f27534f13 | ||
|
|
8a4eb0c479 | ||
|
|
0b7e6265f4 | ||
|
|
b54b4252d9 | ||
|
|
0804d46f69 | ||
|
|
984b5dbb9c | ||
|
|
9812fa1494 | ||
|
|
6099965d89 | ||
|
|
03c605e139 | ||
|
|
00e2881172 | ||
|
|
5313e6862b | ||
|
|
bccb4e1b90 | ||
|
|
a24d01286b | ||
|
|
612a81089c | ||
|
|
4c3b801ae5 | ||
|
|
29e8e79d50 | ||
|
|
ce77bd094d | ||
|
|
6f251c9fb7 | ||
|
|
c7f54ac1e2 | ||
|
|
6b606eb032 | ||
|
|
2d9e26ee1d | ||
|
|
bdd869b5ab | ||
|
|
2d04529a89 | ||
|
|
16cccfe6ab | ||
|
|
9e9d634935 | ||
|
|
f65e647380 | ||
|
|
be232fe811 | ||
|
|
52fc752502 | ||
|
|
120029bb01 | ||
|
|
f3d17b9d34 | ||
|
|
62ee65a36b |
350
api/gen/go/conf/v1/kratos_conf_authn.pb.go
Normal file
350
api/gen/go/conf/v1/kratos_conf_authn.pb.go
Normal file
@@ -0,0 +1,350 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_authn.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
_ "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
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 Authentication struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Jwt *Authentication_Jwt `protobuf:"bytes,2,opt,name=jwt,proto3,oneof" json:"jwt,omitempty"` // JWT 认证
|
||||
Oidc *Authentication_OIDC `protobuf:"bytes,3,opt,name=oidc,proto3,oneof" json:"oidc,omitempty"` // OIDC
|
||||
PresharedKey *Authentication_PresharedKey `protobuf:"bytes,4,opt,name=preshared_key,json=presharedKey,proto3,oneof" json:"preshared_key,omitempty"` // 预共享密钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authentication) Reset() {
|
||||
*x = Authentication{}
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authentication) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authentication) ProtoMessage() {}
|
||||
|
||||
func (x *Authentication) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authentication.ProtoReflect.Descriptor instead.
|
||||
func (*Authentication) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Authentication) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authentication) GetJwt() *Authentication_Jwt {
|
||||
if x != nil {
|
||||
return x.Jwt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authentication) GetOidc() *Authentication_OIDC {
|
||||
if x != nil {
|
||||
return x.Oidc
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authentication) GetPresharedKey() *Authentication_PresharedKey {
|
||||
if x != nil {
|
||||
return x.PresharedKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// JWT
|
||||
type Authentication_Jwt struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authentication_Jwt) Reset() {
|
||||
*x = Authentication_Jwt{}
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authentication_Jwt) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authentication_Jwt) ProtoMessage() {}
|
||||
|
||||
func (x *Authentication_Jwt) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authentication_Jwt.ProtoReflect.Descriptor instead.
|
||||
func (*Authentication_Jwt) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Authentication_Jwt) GetMethod() string {
|
||||
if x != nil {
|
||||
return x.Method
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authentication_Jwt) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Authentication_OIDC struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
IssuerUrl string `protobuf:"bytes,1,opt,name=issuer_url,json=issuerUrl,proto3" json:"issuer_url,omitempty"`
|
||||
Audience string `protobuf:"bytes,2,opt,name=audience,proto3" json:"audience,omitempty"`
|
||||
Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authentication_OIDC) Reset() {
|
||||
*x = Authentication_OIDC{}
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authentication_OIDC) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authentication_OIDC) ProtoMessage() {}
|
||||
|
||||
func (x *Authentication_OIDC) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authentication_OIDC.ProtoReflect.Descriptor instead.
|
||||
func (*Authentication_OIDC) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 1}
|
||||
}
|
||||
|
||||
func (x *Authentication_OIDC) GetIssuerUrl() string {
|
||||
if x != nil {
|
||||
return x.IssuerUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authentication_OIDC) GetAudience() string {
|
||||
if x != nil {
|
||||
return x.Audience
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authentication_OIDC) GetMethod() string {
|
||||
if x != nil {
|
||||
return x.Method
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Authentication_PresharedKey struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ValidKeys []string `protobuf:"bytes,1,rep,name=valid_keys,json=validKeys,proto3" json:"valid_keys,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authentication_PresharedKey) Reset() {
|
||||
*x = Authentication_PresharedKey{}
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authentication_PresharedKey) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authentication_PresharedKey) ProtoMessage() {}
|
||||
|
||||
func (x *Authentication_PresharedKey) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authn_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authentication_PresharedKey.ProtoReflect.Descriptor instead.
|
||||
func (*Authentication_PresharedKey) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authn_proto_rawDescGZIP(), []int{0, 2}
|
||||
}
|
||||
|
||||
func (x *Authentication_PresharedKey) GetValidKeys() []string {
|
||||
if x != nil {
|
||||
return x.ValidKeys
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_conf_v1_kratos_conf_authn_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_authn_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x03, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
|
||||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f,
|
||||
0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x4a, 0x77, 0x74, 0x48, 0x00, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x88, 0x01, 0x01, 0x12,
|
||||
0x32, 0x0a, 0x04, 0x6f, 0x69, 0x64, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x49, 0x44, 0x43, 0x48, 0x01, 0x52, 0x04, 0x6f, 0x69, 0x64, 0x63,
|
||||
0x88, 0x01, 0x01, 0x12, 0x4b, 0x0a, 0x0d, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64,
|
||||
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x2e, 0x50, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x48, 0x02, 0x52,
|
||||
0x0c, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01,
|
||||
0x1a, 0x2f, 0x0a, 0x03, 0x4a, 0x77, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x1a, 0x59, 0x0a, 0x04, 0x4f, 0x49, 0x44, 0x43, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x73,
|
||||
0x75, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69,
|
||||
0x73, 0x73, 0x75, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69,
|
||||
0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69,
|
||||
0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x2d, 0x0a, 0x0c,
|
||||
0x50, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a,
|
||||
0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
||||
0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f,
|
||||
0x6a, 0x77, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6f, 0x69, 0x64, 0x63, 0x42, 0x10, 0x0a, 0x0e,
|
||||
0x5f, 0x70, 0x72, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x42, 0x86,
|
||||
0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x14, 0x4b, 0x72, 0x61,
|
||||
0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f,
|
||||
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67,
|
||||
0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa,
|
||||
0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||
0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_authn_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_authn_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_authn_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_authn_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_authn_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authn_proto_rawDesc), len(file_conf_v1_kratos_conf_authn_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_authn_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_conf_v1_kratos_conf_authn_proto_goTypes = []any{
|
||||
(*Authentication)(nil), // 0: conf.Authentication
|
||||
(*Authentication_Jwt)(nil), // 1: conf.Authentication.Jwt
|
||||
(*Authentication_OIDC)(nil), // 2: conf.Authentication.OIDC
|
||||
(*Authentication_PresharedKey)(nil), // 3: conf.Authentication.PresharedKey
|
||||
}
|
||||
var file_conf_v1_kratos_conf_authn_proto_depIdxs = []int32{
|
||||
1, // 0: conf.Authentication.jwt:type_name -> conf.Authentication.Jwt
|
||||
2, // 1: conf.Authentication.oidc:type_name -> conf.Authentication.OIDC
|
||||
3, // 2: conf.Authentication.preshared_key:type_name -> conf.Authentication.PresharedKey
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_conf_v1_kratos_conf_authn_proto_init() }
|
||||
func file_conf_v1_kratos_conf_authn_proto_init() {
|
||||
if File_conf_v1_kratos_conf_authn_proto != nil {
|
||||
return
|
||||
}
|
||||
file_conf_v1_kratos_conf_authn_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authn_proto_rawDesc), len(file_conf_v1_kratos_conf_authn_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_conf_v1_kratos_conf_authn_proto_goTypes,
|
||||
DependencyIndexes: file_conf_v1_kratos_conf_authn_proto_depIdxs,
|
||||
MessageInfos: file_conf_v1_kratos_conf_authn_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_authn_proto = out.File
|
||||
file_conf_v1_kratos_conf_authn_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_authn_proto_depIdxs = nil
|
||||
}
|
||||
597
api/gen/go/conf/v1/kratos_conf_authz.pb.go
Normal file
597
api/gen/go/conf/v1/kratos_conf_authz.pb.go
Normal file
@@ -0,0 +1,597 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_authz.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
_ "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
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 Authorization struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Casbin *Authorization_Casbin `protobuf:"bytes,2,opt,name=casbin,proto3" json:"casbin,omitempty"` // casbin
|
||||
Opa *Authorization_OPA `protobuf:"bytes,3,opt,name=opa,proto3" json:"opa,omitempty"` // OPA
|
||||
Zanzibar *Authorization_Zanzibar `protobuf:"bytes,4,opt,name=zanzibar,proto3" json:"zanzibar,omitempty"` // zanzibar
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization) Reset() {
|
||||
*x = Authorization{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Authorization) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization) GetCasbin() *Authorization_Casbin {
|
||||
if x != nil {
|
||||
return x.Casbin
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authorization) GetOpa() *Authorization_OPA {
|
||||
if x != nil {
|
||||
return x.Opa
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authorization) GetZanzibar() *Authorization_Zanzibar {
|
||||
if x != nil {
|
||||
return x.Zanzibar
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Authorization_Casbin struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ModelPath *string `protobuf:"bytes,1,opt,name=model_path,json=modelPath,proto3,oneof" json:"model_path,omitempty"` // casbin 模型文件路径
|
||||
PolicyPath *string `protobuf:"bytes,2,opt,name=policy_path,json=policyPath,proto3,oneof" json:"policy_path,omitempty"` // casbin 策略文件路径
|
||||
Policies []string `protobuf:"bytes,10,rep,name=policies,proto3" json:"policies,omitempty"` // 策略列表
|
||||
Model *string `protobuf:"bytes,11,opt,name=model,proto3,oneof" json:"model,omitempty"` // 模型内容
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) Reset() {
|
||||
*x = Authorization_Casbin{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_Casbin) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_Casbin) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_Casbin.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_Casbin) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) GetModelPath() string {
|
||||
if x != nil && x.ModelPath != nil {
|
||||
return *x.ModelPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) GetPolicyPath() string {
|
||||
if x != nil && x.PolicyPath != nil {
|
||||
return *x.PolicyPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) GetPolicies() []string {
|
||||
if x != nil {
|
||||
return x.Policies
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authorization_Casbin) GetModel() string {
|
||||
if x != nil && x.Model != nil {
|
||||
return *x.Model
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Authorization_OPA struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Policies map[string]string `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // OPA 策略列表
|
||||
Roles map[string]*Authorization_OPA_RoleActions `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` //
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA) Reset() {
|
||||
*x = Authorization_OPA{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_OPA) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_OPA) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_OPA.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_OPA) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 1}
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA) GetPolicies() map[string]string {
|
||||
if x != nil {
|
||||
return x.Policies
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA) GetRoles() map[string]*Authorization_OPA_RoleActions {
|
||||
if x != nil {
|
||||
return x.Roles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Authorization_Zanzibar struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // zanzibar 类型
|
||||
Keto *Authorization_Zanzibar_Keto `protobuf:"bytes,2,opt,name=keto,proto3,oneof" json:"keto,omitempty"` // Keto 配置
|
||||
OpenFga *Authorization_Zanzibar_OpenFga `protobuf:"bytes,3,opt,name=open_fga,json=openFga,proto3,oneof" json:"open_fga,omitempty"` // OpenFGA 配置
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar) Reset() {
|
||||
*x = Authorization_Zanzibar{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_Zanzibar) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_Zanzibar) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_Zanzibar.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_Zanzibar) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 2}
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar) GetKeto() *Authorization_Zanzibar_Keto {
|
||||
if x != nil {
|
||||
return x.Keto
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar) GetOpenFga() *Authorization_Zanzibar_OpenFga {
|
||||
if x != nil {
|
||||
return x.OpenFga
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Authorization_OPA_RoleActions struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Actions []string `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` // 角色对应的操作列表 {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA_RoleActions) Reset() {
|
||||
*x = Authorization_OPA_RoleActions{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA_RoleActions) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_OPA_RoleActions) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_OPA_RoleActions) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_OPA_RoleActions.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_OPA_RoleActions) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 1, 0}
|
||||
}
|
||||
|
||||
func (x *Authorization_OPA_RoleActions) GetActions() []string {
|
||||
if x != nil {
|
||||
return x.Actions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Authorization_Zanzibar_Keto struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
WriteUrl string `protobuf:"bytes,1,opt,name=write_url,json=writeUrl,proto3" json:"write_url,omitempty"` // 写入 URL
|
||||
ReadUrl string `protobuf:"bytes,2,opt,name=read_url,json=readUrl,proto3" json:"read_url,omitempty"` // 读取 URL
|
||||
UseGrpc bool `protobuf:"varint,3,opt,name=use_grpc,json=useGrpc,proto3" json:"use_grpc,omitempty"` // 是否使用 gRPC
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) Reset() {
|
||||
*x = Authorization_Zanzibar_Keto{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_Zanzibar_Keto) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_Zanzibar_Keto.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_Zanzibar_Keto) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 2, 0}
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) GetWriteUrl() string {
|
||||
if x != nil {
|
||||
return x.WriteUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) GetReadUrl() string {
|
||||
if x != nil {
|
||||
return x.ReadUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_Keto) GetUseGrpc() bool {
|
||||
if x != nil {
|
||||
return x.UseGrpc
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Authorization_Zanzibar_OpenFga struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ApiUrl string `protobuf:"bytes,1,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"` // OpenFGA API URL
|
||||
StoreId string `protobuf:"bytes,2,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` // OpenFGA 存储 ID
|
||||
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` // OpenFGA 访问令牌
|
||||
ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // OpenFGA 客户端 ID
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) Reset() {
|
||||
*x = Authorization_Zanzibar_OpenFga{}
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Authorization_Zanzibar_OpenFga) ProtoMessage() {}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_authz_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Authorization_Zanzibar_OpenFga.ProtoReflect.Descriptor instead.
|
||||
func (*Authorization_Zanzibar_OpenFga) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescGZIP(), []int{0, 2, 1}
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) GetApiUrl() string {
|
||||
if x != nil {
|
||||
return x.ApiUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) GetStoreId() string {
|
||||
if x != nil {
|
||||
return x.StoreId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Authorization_Zanzibar_OpenFga) GetClientId() string {
|
||||
if x != nil {
|
||||
return x.ClientId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_conf_v1_kratos_conf_authz_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_authz_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x1f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x08, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a,
|
||||
0x06, 0x63, 0x61, 0x73, 0x62, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x73, 0x62, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x61, 0x73, 0x62, 0x69,
|
||||
0x6e, 0x12, 0x29, 0x0a, 0x03, 0x6f, 0x70, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x50, 0x41, 0x52, 0x03, 0x6f, 0x70, 0x61, 0x12, 0x38, 0x0a, 0x08,
|
||||
0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x62, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x5a, 0x61, 0x6e, 0x7a, 0x69, 0x62, 0x61, 0x72, 0x52, 0x08, 0x7a, 0x61,
|
||||
0x6e, 0x7a, 0x69, 0x62, 0x61, 0x72, 0x1a, 0xb2, 0x01, 0x0a, 0x06, 0x43, 0x61, 0x73, 0x62, 0x69,
|
||||
0x6e, 0x12, 0x22, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61,
|
||||
0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f,
|
||||
0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x70, 0x6f,
|
||||
0x6c, 0x69, 0x63, 0x79, 0x50, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x70,
|
||||
0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70,
|
||||
0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x88,
|
||||
0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x74,
|
||||
0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x74,
|
||||
0x68, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xc7, 0x02, 0x0a, 0x03,
|
||||
0x4f, 0x50, 0x41, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18,
|
||||
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74,
|
||||
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x50, 0x41, 0x2e, 0x50,
|
||||
0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x6f,
|
||||
0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74,
|
||||
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x50, 0x41, 0x2e, 0x52,
|
||||
0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73,
|
||||
0x1a, 0x27, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
||||
0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x6f, 0x6c,
|
||||
0x69, 0x63, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5d, 0x0a, 0x0a, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74,
|
||||
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x50, 0x41, 0x2e, 0x52,
|
||||
0x6f, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x83, 0x03, 0x0a, 0x08, 0x5a, 0x61, 0x6e, 0x7a, 0x69, 0x62,
|
||||
0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x6b, 0x65, 0x74, 0x6f, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x5a, 0x61, 0x6e, 0x7a, 0x69, 0x62,
|
||||
0x61, 0x72, 0x2e, 0x4b, 0x65, 0x74, 0x6f, 0x48, 0x00, 0x52, 0x04, 0x6b, 0x65, 0x74, 0x6f, 0x88,
|
||||
0x01, 0x01, 0x12, 0x44, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x66, 0x67, 0x61, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x5a, 0x61, 0x6e, 0x7a, 0x69, 0x62,
|
||||
0x61, 0x72, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x46, 0x67, 0x61, 0x48, 0x01, 0x52, 0x07, 0x6f, 0x70,
|
||||
0x65, 0x6e, 0x46, 0x67, 0x61, 0x88, 0x01, 0x01, 0x1a, 0x59, 0x0a, 0x04, 0x4b, 0x65, 0x74, 0x6f,
|
||||
0x12, 0x1b, 0x0a, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x72, 0x69, 0x74, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a,
|
||||
0x08, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x07, 0x72, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x5f,
|
||||
0x67, 0x72, 0x70, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x75, 0x73, 0x65, 0x47,
|
||||
0x72, 0x70, 0x63, 0x1a, 0x70, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x46, 0x67, 0x61, 0x12, 0x17,
|
||||
0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65,
|
||||
0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69,
|
||||
0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6b, 0x65, 0x74, 0x6f, 0x42, 0x0b,
|
||||
0x0a, 0x09, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x66, 0x67, 0x61, 0x42, 0x86, 0x01, 0x0a, 0x08,
|
||||
0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x14, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37,
|
||||
0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
|
||||
0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_authz_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_authz_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_authz_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_authz_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_authz_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authz_proto_rawDesc), len(file_conf_v1_kratos_conf_authz_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_authz_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_conf_v1_kratos_conf_authz_proto_goTypes = []any{
|
||||
(*Authorization)(nil), // 0: conf.Authorization
|
||||
(*Authorization_Casbin)(nil), // 1: conf.Authorization.Casbin
|
||||
(*Authorization_OPA)(nil), // 2: conf.Authorization.OPA
|
||||
(*Authorization_Zanzibar)(nil), // 3: conf.Authorization.Zanzibar
|
||||
(*Authorization_OPA_RoleActions)(nil), // 4: conf.Authorization.OPA.RoleActions
|
||||
nil, // 5: conf.Authorization.OPA.PoliciesEntry
|
||||
nil, // 6: conf.Authorization.OPA.RolesEntry
|
||||
(*Authorization_Zanzibar_Keto)(nil), // 7: conf.Authorization.Zanzibar.Keto
|
||||
(*Authorization_Zanzibar_OpenFga)(nil), // 8: conf.Authorization.Zanzibar.OpenFga
|
||||
}
|
||||
var file_conf_v1_kratos_conf_authz_proto_depIdxs = []int32{
|
||||
1, // 0: conf.Authorization.casbin:type_name -> conf.Authorization.Casbin
|
||||
2, // 1: conf.Authorization.opa:type_name -> conf.Authorization.OPA
|
||||
3, // 2: conf.Authorization.zanzibar:type_name -> conf.Authorization.Zanzibar
|
||||
5, // 3: conf.Authorization.OPA.policies:type_name -> conf.Authorization.OPA.PoliciesEntry
|
||||
6, // 4: conf.Authorization.OPA.roles:type_name -> conf.Authorization.OPA.RolesEntry
|
||||
7, // 5: conf.Authorization.Zanzibar.keto:type_name -> conf.Authorization.Zanzibar.Keto
|
||||
8, // 6: conf.Authorization.Zanzibar.open_fga:type_name -> conf.Authorization.Zanzibar.OpenFga
|
||||
4, // 7: conf.Authorization.OPA.RolesEntry.value:type_name -> conf.Authorization.OPA.RoleActions
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_conf_v1_kratos_conf_authz_proto_init() }
|
||||
func file_conf_v1_kratos_conf_authz_proto_init() {
|
||||
if File_conf_v1_kratos_conf_authz_proto != nil {
|
||||
return
|
||||
}
|
||||
file_conf_v1_kratos_conf_authz_proto_msgTypes[1].OneofWrappers = []any{}
|
||||
file_conf_v1_kratos_conf_authz_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_authz_proto_rawDesc), len(file_conf_v1_kratos_conf_authz_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_conf_v1_kratos_conf_authz_proto_goTypes,
|
||||
DependencyIndexes: file_conf_v1_kratos_conf_authz_proto_depIdxs,
|
||||
MessageInfos: file_conf_v1_kratos_conf_authz_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_authz_proto = out.File
|
||||
file_conf_v1_kratos_conf_authz_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_authz_proto_depIdxs = nil
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_bootstrap.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -22,28 +23,27 @@ const (
|
||||
|
||||
// 引导信息
|
||||
type Bootstrap struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Server *Server `protobuf:"bytes,1,opt,name=server,proto3,oneof" json:"server,omitempty"`
|
||||
Client *Client `protobuf:"bytes,2,opt,name=client,proto3,oneof" json:"client,omitempty"`
|
||||
Data *Data `protobuf:"bytes,3,opt,name=data,proto3,oneof" json:"data,omitempty"`
|
||||
Trace *Tracer `protobuf:"bytes,4,opt,name=trace,proto3,oneof" json:"trace,omitempty"`
|
||||
Logger *Logger `protobuf:"bytes,5,opt,name=logger,proto3,oneof" json:"logger,omitempty"`
|
||||
Registry *Registry `protobuf:"bytes,6,opt,name=registry,proto3,oneof" json:"registry,omitempty"`
|
||||
Config *RemoteConfig `protobuf:"bytes,7,opt,name=config,proto3,oneof" json:"config,omitempty"`
|
||||
Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3,oneof" json:"oss,omitempty"`
|
||||
Notify *Notification `protobuf:"bytes,9,opt,name=notify,proto3,oneof" json:"notify,omitempty"`
|
||||
Authn *Authentication `protobuf:"bytes,10,opt,name=authn,proto3,oneof" json:"authn,omitempty"`
|
||||
Authz *Authorization `protobuf:"bytes,11,opt,name=authz,proto3,oneof" json:"authz,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
|
||||
Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"`
|
||||
Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Trace *Tracer `protobuf:"bytes,4,opt,name=trace,proto3" json:"trace,omitempty"`
|
||||
Logger *Logger `protobuf:"bytes,5,opt,name=logger,proto3" json:"logger,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"`
|
||||
Oss *OSS `protobuf:"bytes,8,opt,name=oss,proto3" json:"oss,omitempty"`
|
||||
Notify *Notification `protobuf:"bytes,9,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Bootstrap) Reset() {
|
||||
*x = Bootstrap{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_bootstrap_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_bootstrap_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Bootstrap) String() string {
|
||||
@@ -54,7 +54,7 @@ func (*Bootstrap) ProtoMessage() {}
|
||||
|
||||
func (x *Bootstrap) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_bootstrap_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -132,9 +132,23 @@ func (x *Bootstrap) GetNotify() *Notification {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Bootstrap) GetAuthn() *Authentication {
|
||||
if x != nil {
|
||||
return x.Authn
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Bootstrap) GetAuthz() *Authorization {
|
||||
if x != nil {
|
||||
return x.Authz
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_conf_v1_kratos_conf_bootstrap_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x20, 0x63, 0x6f, 0x6e,
|
||||
@@ -156,81 +170,105 @@ var file_conf_v1_kratos_conf_bootstrap_proto_rawDesc = []byte{
|
||||
0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76,
|
||||
0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x6e, 0x6f,
|
||||
0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x02, 0x0a, 0x09, 0x42,
|
||||
0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x24,
|
||||
0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c,
|
||||
0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65,
|
||||
0x72, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67,
|
||||
0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x2a,
|
||||
0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
|
||||
0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x63, 0x6f,
|
||||
0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f,
|
||||
0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x5f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x04, 0x0a,
|
||||
0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x65,
|
||||
0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69,
|
||||
0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01,
|
||||
0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x02, 0x52, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x72, 0x61, 0x63,
|
||||
0x65, 0x72, 0x48, 0x03, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29,
|
||||
0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x48, 0x04, 0x52, 0x06,
|
||||
0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x08, 0x72, 0x65, 0x67,
|
||||
0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x48, 0x05, 0x52, 0x08, 0x72,
|
||||
0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x52, 0x03,
|
||||
0x6f, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x09, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42,
|
||||
0x8a, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x18, 0x4b, 0x72,
|
||||
0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
|
||||
0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f,
|
||||
0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02,
|
||||
0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
|
||||
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x66, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x06,
|
||||
0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x03, 0x6f,
|
||||
0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x4f, 0x53, 0x53, 0x48, 0x07, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a,
|
||||
0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x48, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x88, 0x01, 0x01, 0x12, 0x2f,
|
||||
0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x48, 0x09, 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x88, 0x01, 0x01, 0x12,
|
||||
0x2e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x48, 0x0a, 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x88, 0x01, 0x01, 0x42,
|
||||
0x09, 0x0a, 0x07, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63,
|
||||
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08,
|
||||
0x0a, 0x06, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6c, 0x6f, 0x67,
|
||||
0x67, 0x65, 0x72, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
|
||||
0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x06, 0x0a, 0x04, 0x5f,
|
||||
0x6f, 0x73, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42, 0x08,
|
||||
0x0a, 0x06, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x61, 0x75, 0x74,
|
||||
0x68, 0x7a, 0x42, 0x8a, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42,
|
||||
0x18, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x42, 0x6f, 0x6f, 0x74, 0x73,
|
||||
0x74, 0x72, 0x61, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72,
|
||||
0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76,
|
||||
0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02,
|
||||
0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42,
|
||||
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescData = file_conf_v1_kratos_conf_bootstrap_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_bootstrap_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_bootstrap_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_bootstrap_proto_rawDesc), len(file_conf_v1_kratos_conf_bootstrap_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_bootstrap_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_goTypes = []interface{}{
|
||||
(*Bootstrap)(nil), // 0: conf.Bootstrap
|
||||
(*Server)(nil), // 1: conf.Server
|
||||
(*Client)(nil), // 2: conf.Client
|
||||
(*Data)(nil), // 3: conf.Data
|
||||
(*Tracer)(nil), // 4: conf.Tracer
|
||||
(*Logger)(nil), // 5: conf.Logger
|
||||
(*Registry)(nil), // 6: conf.Registry
|
||||
(*RemoteConfig)(nil), // 7: conf.RemoteConfig
|
||||
(*OSS)(nil), // 8: conf.OSS
|
||||
(*Notification)(nil), // 9: conf.Notification
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_goTypes = []any{
|
||||
(*Bootstrap)(nil), // 0: conf.Bootstrap
|
||||
(*Server)(nil), // 1: conf.Server
|
||||
(*Client)(nil), // 2: conf.Client
|
||||
(*Data)(nil), // 3: conf.Data
|
||||
(*Tracer)(nil), // 4: conf.Tracer
|
||||
(*Logger)(nil), // 5: conf.Logger
|
||||
(*Registry)(nil), // 6: conf.Registry
|
||||
(*RemoteConfig)(nil), // 7: conf.RemoteConfig
|
||||
(*OSS)(nil), // 8: conf.OSS
|
||||
(*Notification)(nil), // 9: conf.Notification
|
||||
(*Authentication)(nil), // 10: conf.Authentication
|
||||
(*Authorization)(nil), // 11: conf.Authorization
|
||||
}
|
||||
var file_conf_v1_kratos_conf_bootstrap_proto_depIdxs = []int32{
|
||||
1, // 0: conf.Bootstrap.server:type_name -> conf.Server
|
||||
2, // 1: conf.Bootstrap.client:type_name -> conf.Client
|
||||
3, // 2: conf.Bootstrap.data:type_name -> conf.Data
|
||||
4, // 3: conf.Bootstrap.trace:type_name -> conf.Tracer
|
||||
5, // 4: conf.Bootstrap.logger:type_name -> conf.Logger
|
||||
6, // 5: conf.Bootstrap.registry:type_name -> conf.Registry
|
||||
7, // 6: conf.Bootstrap.config:type_name -> conf.RemoteConfig
|
||||
8, // 7: conf.Bootstrap.oss:type_name -> conf.OSS
|
||||
9, // 8: conf.Bootstrap.notify:type_name -> conf.Notification
|
||||
9, // [9:9] is the sub-list for method output_type
|
||||
9, // [9:9] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
1, // 0: conf.Bootstrap.server:type_name -> conf.Server
|
||||
2, // 1: conf.Bootstrap.client:type_name -> conf.Client
|
||||
3, // 2: conf.Bootstrap.data:type_name -> conf.Data
|
||||
4, // 3: conf.Bootstrap.trace:type_name -> conf.Tracer
|
||||
5, // 4: conf.Bootstrap.logger:type_name -> conf.Logger
|
||||
6, // 5: conf.Bootstrap.registry:type_name -> conf.Registry
|
||||
7, // 6: conf.Bootstrap.config:type_name -> conf.RemoteConfig
|
||||
8, // 7: conf.Bootstrap.oss:type_name -> conf.OSS
|
||||
9, // 8: conf.Bootstrap.notify:type_name -> conf.Notification
|
||||
10, // 9: conf.Bootstrap.authn:type_name -> conf.Authentication
|
||||
11, // 10: conf.Bootstrap.authz:type_name -> conf.Authorization
|
||||
11, // [11:11] is the sub-list for method output_type
|
||||
11, // [11:11] is the sub-list for method input_type
|
||||
11, // [11:11] is the sub-list for extension type_name
|
||||
11, // [11:11] is the sub-list for extension extendee
|
||||
0, // [0:11] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_conf_v1_kratos_conf_bootstrap_proto_init() }
|
||||
@@ -247,25 +285,14 @@ func file_conf_v1_kratos_conf_bootstrap_proto_init() {
|
||||
file_conf_v1_kratos_conf_oss_proto_init()
|
||||
file_conf_v1_kratos_conf_config_proto_init()
|
||||
file_conf_v1_kratos_conf_notify_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Bootstrap); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_authn_proto_init()
|
||||
file_conf_v1_kratos_conf_authz_proto_init()
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_bootstrap_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_bootstrap_proto_rawDesc), len(file_conf_v1_kratos_conf_bootstrap_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
@@ -276,7 +303,6 @@ func file_conf_v1_kratos_conf_bootstrap_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_bootstrap_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_bootstrap_proto = out.File
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_bootstrap_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_client.proto
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,21 +24,18 @@ const (
|
||||
|
||||
// 客户端
|
||||
type Client struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Rest *Client_REST `protobuf:"bytes,1,opt,name=rest,proto3,oneof" json:"rest,omitempty"` // REST服务
|
||||
Grpc *Client_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"` // gRPC服务
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rest *Client_REST `protobuf:"bytes,1,opt,name=rest,proto3,oneof" json:"rest,omitempty"` // REST服务
|
||||
Grpc *Client_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"` // gRPC服务
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Client) Reset() {
|
||||
*x = Client{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Client) String() string {
|
||||
@@ -48,7 +46,7 @@ func (*Client) ProtoMessage() {}
|
||||
|
||||
func (x *Client) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -79,22 +77,19 @@ func (x *Client) GetGrpc() *Client_GRPC {
|
||||
|
||||
// REST
|
||||
type Client_REST struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
|
||||
Tls *TLS `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
|
||||
Tls *TLS `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Client_REST) Reset() {
|
||||
*x = Client_REST{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Client_REST) String() string {
|
||||
@@ -105,7 +100,7 @@ func (*Client_REST) ProtoMessage() {}
|
||||
|
||||
func (x *Client_REST) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -143,22 +138,19 @@ func (x *Client_REST) GetTls() *TLS {
|
||||
|
||||
// gPRC
|
||||
type Client_GRPC struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
|
||||
Tls *TLS `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Middleware *Middleware `protobuf:"bytes,2,opt,name=middleware,proto3" json:"middleware,omitempty"` // 中间件
|
||||
Tls *TLS `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Client_GRPC) Reset() {
|
||||
*x = Client_GRPC{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Client_GRPC) String() string {
|
||||
@@ -169,7 +161,7 @@ func (*Client_GRPC) ProtoMessage() {}
|
||||
|
||||
func (x *Client_GRPC) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_client_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -207,7 +199,7 @@ func (x *Client_GRPC) GetTls() *TLS {
|
||||
|
||||
var File_conf_v1_kratos_conf_client_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_client_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_client_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
@@ -251,22 +243,22 @@ var file_conf_v1_kratos_conf_client_proto_rawDesc = []byte{
|
||||
0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescData = file_conf_v1_kratos_conf_client_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_client_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_client_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_client_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_client_proto_rawDesc), len(file_conf_v1_kratos_conf_client_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_client_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_client_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_conf_v1_kratos_conf_client_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_client_proto_goTypes = []any{
|
||||
(*Client)(nil), // 0: conf.Client
|
||||
(*Client_REST)(nil), // 1: conf.Client.REST
|
||||
(*Client_GRPC)(nil), // 2: conf.Client.GRPC
|
||||
@@ -297,50 +289,12 @@ func file_conf_v1_kratos_conf_client_proto_init() {
|
||||
}
|
||||
file_conf_v1_kratos_conf_middleware_proto_init()
|
||||
file_conf_v1_kratos_conf_tls_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Client); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Client_REST); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Client_GRPC); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_client_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_client_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_client_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_client_proto_rawDesc), len(file_conf_v1_kratos_conf_client_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
@@ -351,7 +305,6 @@ func file_conf_v1_kratos_conf_client_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_client_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_client_proto = out.File
|
||||
file_conf_v1_kratos_conf_client_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_client_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_client_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_config.proto
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,26 +24,23 @@ const (
|
||||
|
||||
// 配置服务
|
||||
type RemoteConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // 配置类型
|
||||
Etcd *RemoteConfig_Etcd `protobuf:"bytes,2,opt,name=etcd,proto3,oneof" json:"etcd,omitempty"`
|
||||
Consul *RemoteConfig_Consul `protobuf:"bytes,3,opt,name=consul,proto3,oneof" json:"consul,omitempty"`
|
||||
Nacos *RemoteConfig_Nacos `protobuf:"bytes,4,opt,name=nacos,proto3,oneof" json:"nacos,omitempty"`
|
||||
Apollo *RemoteConfig_Apollo `protobuf:"bytes,6,opt,name=apollo,proto3,oneof" json:"apollo,omitempty"`
|
||||
Kubernetes *RemoteConfig_Kubernetes `protobuf:"bytes,7,opt,name=kubernetes,proto3,oneof" json:"kubernetes,omitempty"`
|
||||
Polaris *RemoteConfig_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3,oneof" json:"polaris,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // 配置类型
|
||||
Etcd *RemoteConfig_Etcd `protobuf:"bytes,2,opt,name=etcd,proto3,oneof" json:"etcd,omitempty"`
|
||||
Consul *RemoteConfig_Consul `protobuf:"bytes,3,opt,name=consul,proto3,oneof" json:"consul,omitempty"`
|
||||
Nacos *RemoteConfig_Nacos `protobuf:"bytes,4,opt,name=nacos,proto3,oneof" json:"nacos,omitempty"`
|
||||
Apollo *RemoteConfig_Apollo `protobuf:"bytes,6,opt,name=apollo,proto3,oneof" json:"apollo,omitempty"`
|
||||
Kubernetes *RemoteConfig_Kubernetes `protobuf:"bytes,7,opt,name=kubernetes,proto3,oneof" json:"kubernetes,omitempty"`
|
||||
Polaris *RemoteConfig_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3,oneof" json:"polaris,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig) Reset() {
|
||||
*x = RemoteConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig) String() string {
|
||||
@@ -53,7 +51,7 @@ func (*RemoteConfig) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -118,22 +116,19 @@ func (x *RemoteConfig) GetPolaris() *RemoteConfig_Polaris {
|
||||
}
|
||||
|
||||
type RemoteConfig_Nacos struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Nacos) Reset() {
|
||||
*x = RemoteConfig_Nacos{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Nacos) String() string {
|
||||
@@ -144,7 +139,7 @@ func (*RemoteConfig_Nacos) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Nacos) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -181,22 +176,19 @@ func (x *RemoteConfig_Nacos) GetKey() string {
|
||||
}
|
||||
|
||||
type RemoteConfig_Etcd struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` // 服务端地址
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` // 服务端地址
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` // 超时时间
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Etcd) Reset() {
|
||||
*x = RemoteConfig_Etcd{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Etcd) String() string {
|
||||
@@ -207,7 +199,7 @@ func (*RemoteConfig_Etcd) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Etcd) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -244,22 +236,19 @@ func (x *RemoteConfig_Etcd) GetKey() string {
|
||||
}
|
||||
|
||||
type RemoteConfig_Consul struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // 配置键
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Consul) Reset() {
|
||||
*x = RemoteConfig_Consul{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Consul) String() string {
|
||||
@@ -270,7 +259,7 @@ func (*RemoteConfig_Consul) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Consul) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -307,24 +296,21 @@ func (x *RemoteConfig_Consul) GetKey() string {
|
||||
}
|
||||
|
||||
type RemoteConfig_Apollo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 服务端地址
|
||||
AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // 应用ID
|
||||
Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` // 集群
|
||||
Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间
|
||||
Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` // 密钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 服务端地址
|
||||
AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // 应用ID
|
||||
Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` // 集群
|
||||
Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间
|
||||
Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` // 密钥
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Apollo) Reset() {
|
||||
*x = RemoteConfig_Apollo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Apollo) String() string {
|
||||
@@ -335,7 +321,7 @@ func (*RemoteConfig_Apollo) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Apollo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -386,20 +372,17 @@ func (x *RemoteConfig_Apollo) GetSecret() string {
|
||||
}
|
||||
|
||||
type RemoteConfig_Kubernetes struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Kubernetes) Reset() {
|
||||
*x = RemoteConfig_Kubernetes{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Kubernetes) String() string {
|
||||
@@ -410,7 +393,7 @@ func (*RemoteConfig_Kubernetes) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Kubernetes) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -433,18 +416,16 @@ func (x *RemoteConfig_Kubernetes) GetNamespace() string {
|
||||
}
|
||||
|
||||
type RemoteConfig_Polaris struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Polaris) Reset() {
|
||||
*x = RemoteConfig_Polaris{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RemoteConfig_Polaris) String() string {
|
||||
@@ -455,7 +436,7 @@ func (*RemoteConfig_Polaris) ProtoMessage() {}
|
||||
|
||||
func (x *RemoteConfig_Polaris) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_config_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -472,7 +453,7 @@ func (*RemoteConfig_Polaris) Descriptor() ([]byte, []int) {
|
||||
|
||||
var File_conf_v1_kratos_conf_config_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_config_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_config_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
@@ -544,22 +525,22 @@ var file_conf_v1_kratos_conf_config_proto_rawDesc = []byte{
|
||||
0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
|
||||
0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescData = file_conf_v1_kratos_conf_config_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_config_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_config_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_config_proto_rawDesc), len(file_conf_v1_kratos_conf_config_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_config_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_conf_v1_kratos_conf_config_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_config_proto_goTypes = []any{
|
||||
(*RemoteConfig)(nil), // 0: conf.RemoteConfig
|
||||
(*RemoteConfig_Nacos)(nil), // 1: conf.RemoteConfig.Nacos
|
||||
(*RemoteConfig_Etcd)(nil), // 2: conf.RemoteConfig.Etcd
|
||||
@@ -589,98 +570,12 @@ func file_conf_v1_kratos_conf_config_proto_init() {
|
||||
if File_conf_v1_kratos_conf_config_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Nacos); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Etcd); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Consul); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Apollo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Kubernetes); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RemoteConfig_Polaris); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_config_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_config_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_config_proto_rawDesc), len(file_conf_v1_kratos_conf_config_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
@@ -691,7 +586,6 @@ func file_conf_v1_kratos_conf_config_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_config_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_config_proto = out.File
|
||||
file_conf_v1_kratos_conf_config_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_config_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_config_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_logger.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -22,25 +23,22 @@ const (
|
||||
|
||||
// 日志
|
||||
type Logger struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Zap *Logger_Zap `protobuf:"bytes,2,opt,name=zap,proto3,oneof" json:"zap,omitempty"`
|
||||
Logrus *Logger_Logrus `protobuf:"bytes,3,opt,name=logrus,proto3,oneof" json:"logrus,omitempty"`
|
||||
Fluent *Logger_Fluent `protobuf:"bytes,4,opt,name=fluent,proto3,oneof" json:"fluent,omitempty"`
|
||||
Aliyun *Logger_Aliyun `protobuf:"bytes,5,opt,name=aliyun,proto3,oneof" json:"aliyun,omitempty"`
|
||||
Tencent *Logger_Tencent `protobuf:"bytes,6,opt,name=tencent,proto3,oneof" json:"tencent,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Zap *Logger_Zap `protobuf:"bytes,2,opt,name=zap,proto3,oneof" json:"zap,omitempty"`
|
||||
Logrus *Logger_Logrus `protobuf:"bytes,3,opt,name=logrus,proto3,oneof" json:"logrus,omitempty"`
|
||||
Fluent *Logger_Fluent `protobuf:"bytes,4,opt,name=fluent,proto3,oneof" json:"fluent,omitempty"`
|
||||
Aliyun *Logger_Aliyun `protobuf:"bytes,5,opt,name=aliyun,proto3,oneof" json:"aliyun,omitempty"`
|
||||
Tencent *Logger_Tencent `protobuf:"bytes,6,opt,name=tencent,proto3,oneof" json:"tencent,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger) Reset() {
|
||||
*x = Logger{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger) String() string {
|
||||
@@ -51,7 +49,7 @@ func (*Logger) ProtoMessage() {}
|
||||
|
||||
func (x *Logger) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -110,24 +108,21 @@ func (x *Logger) GetTencent() *Logger_Tencent {
|
||||
|
||||
// Zap
|
||||
type Logger_Zap struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` //
|
||||
Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` //
|
||||
MaxSize int32 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` //
|
||||
MaxAge int32 `protobuf:"varint,4,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` //
|
||||
MaxBackups int32 `protobuf:"varint,5,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"` //
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` //
|
||||
Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"` //
|
||||
MaxSize int32 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` //
|
||||
MaxAge int32 `protobuf:"varint,4,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` //
|
||||
MaxBackups int32 `protobuf:"varint,5,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"` //
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger_Zap) Reset() {
|
||||
*x = Logger_Zap{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger_Zap) String() string {
|
||||
@@ -138,7 +133,7 @@ func (*Logger_Zap) ProtoMessage() {}
|
||||
|
||||
func (x *Logger_Zap) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -190,24 +185,21 @@ func (x *Logger_Zap) GetMaxBackups() int32 {
|
||||
|
||||
// logrus
|
||||
type Logger_Logrus struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` // 日志等级
|
||||
Formatter string `protobuf:"bytes,2,opt,name=formatter,proto3" json:"formatter,omitempty"` // 输出格式:text, json.
|
||||
TimestampFormat string `protobuf:"bytes,3,opt,name=timestamp_format,json=timestampFormat,proto3" json:"timestamp_format,omitempty"` // 定义时间戳格式,例如:"2006-01-02 15:04:05"
|
||||
DisableColors bool `protobuf:"varint,4,opt,name=disable_colors,json=disableColors,proto3" json:"disable_colors,omitempty"` // 不需要彩色日志
|
||||
DisableTimestamp bool `protobuf:"varint,5,opt,name=disable_timestamp,json=disableTimestamp,proto3" json:"disable_timestamp,omitempty"` // 不需要时间戳
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` // 日志等级
|
||||
Formatter string `protobuf:"bytes,2,opt,name=formatter,proto3" json:"formatter,omitempty"` // 输出格式:text, json.
|
||||
TimestampFormat string `protobuf:"bytes,3,opt,name=timestamp_format,json=timestampFormat,proto3" json:"timestamp_format,omitempty"` // 定义时间戳格式,例如:"2006-01-02 15:04:05"
|
||||
DisableColors bool `protobuf:"varint,4,opt,name=disable_colors,json=disableColors,proto3" json:"disable_colors,omitempty"` // 不需要彩色日志
|
||||
DisableTimestamp bool `protobuf:"varint,5,opt,name=disable_timestamp,json=disableTimestamp,proto3" json:"disable_timestamp,omitempty"` // 不需要时间戳
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger_Logrus) Reset() {
|
||||
*x = Logger_Logrus{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger_Logrus) String() string {
|
||||
@@ -218,7 +210,7 @@ func (*Logger_Logrus) ProtoMessage() {}
|
||||
|
||||
func (x *Logger_Logrus) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -270,20 +262,17 @@ func (x *Logger_Logrus) GetDisableTimestamp() bool {
|
||||
|
||||
// Fluent
|
||||
type Logger_Fluent struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger_Fluent) Reset() {
|
||||
*x = Logger_Fluent{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger_Fluent) String() string {
|
||||
@@ -294,7 +283,7 @@ func (*Logger_Fluent) ProtoMessage() {}
|
||||
|
||||
func (x *Logger_Fluent) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -318,23 +307,20 @@ func (x *Logger_Fluent) GetEndpoint() string {
|
||||
|
||||
// 阿里云
|
||||
type Logger_Aliyun struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` //
|
||||
AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID
|
||||
AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` //
|
||||
AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID
|
||||
AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger_Aliyun) Reset() {
|
||||
*x = Logger_Aliyun{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger_Aliyun) String() string {
|
||||
@@ -345,7 +331,7 @@ func (*Logger_Aliyun) ProtoMessage() {}
|
||||
|
||||
func (x *Logger_Aliyun) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -390,23 +376,20 @@ func (x *Logger_Aliyun) GetAccessSecret() string {
|
||||
|
||||
// 腾讯
|
||||
type Logger_Tencent struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
TopicId string `protobuf:"bytes,2,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` //
|
||||
AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID
|
||||
AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 公网接入地址
|
||||
TopicId string `protobuf:"bytes,2,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` //
|
||||
AccessKey string `protobuf:"bytes,3,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥ID
|
||||
AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // 访问密钥
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Logger_Tencent) Reset() {
|
||||
*x = Logger_Tencent{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Logger_Tencent) String() string {
|
||||
@@ -417,7 +400,7 @@ func (*Logger_Tencent) ProtoMessage() {}
|
||||
|
||||
func (x *Logger_Tencent) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_logger_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -462,7 +445,7 @@ func (x *Logger_Tencent) GetAccessSecret() string {
|
||||
|
||||
var File_conf_v1_kratos_conf_logger_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_logger_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_logger_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0xc4, 0x07, 0x0a, 0x06, 0x4c, 0x6f, 0x67,
|
||||
@@ -536,22 +519,22 @@ var file_conf_v1_kratos_conf_logger_proto_rawDesc = []byte{
|
||||
0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||
0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescData = file_conf_v1_kratos_conf_logger_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_logger_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_logger_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_logger_proto_rawDesc), len(file_conf_v1_kratos_conf_logger_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_logger_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_logger_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_conf_v1_kratos_conf_logger_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_logger_proto_goTypes = []any{
|
||||
(*Logger)(nil), // 0: conf.Logger
|
||||
(*Logger_Zap)(nil), // 1: conf.Logger.Zap
|
||||
(*Logger_Logrus)(nil), // 2: conf.Logger.Logrus
|
||||
@@ -577,86 +560,12 @@ func file_conf_v1_kratos_conf_logger_proto_init() {
|
||||
if File_conf_v1_kratos_conf_logger_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger_Zap); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger_Logrus); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger_Fluent); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger_Aliyun); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Logger_Tencent); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_logger_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_logger_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_logger_proto_rawDesc), len(file_conf_v1_kratos_conf_logger_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
@@ -667,7 +576,6 @@ func file_conf_v1_kratos_conf_logger_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_logger_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_logger_proto = out.File
|
||||
file_conf_v1_kratos_conf_logger_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_logger_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_logger_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_middleware.proto
|
||||
|
||||
@@ -9,9 +9,10 @@ package v1
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
_ "google.golang.org/protobuf/types/known/durationpb"
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -21,28 +22,27 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 中间件
|
||||
type Middleware struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EnableLogging bool `protobuf:"varint,1,opt,name=enable_logging,json=enableLogging,proto3" json:"enable_logging,omitempty"` // 日志开关
|
||||
EnableRecovery bool `protobuf:"varint,2,opt,name=enable_recovery,json=enableRecovery,proto3" json:"enable_recovery,omitempty"` // 异常恢复
|
||||
EnableTracing bool `protobuf:"varint,3,opt,name=enable_tracing,json=enableTracing,proto3" json:"enable_tracing,omitempty"` // 链路追踪开关
|
||||
EnableValidate bool `protobuf:"varint,4,opt,name=enable_validate,json=enableValidate,proto3" json:"enable_validate,omitempty"` // 参数校验开关
|
||||
EnableCircuitBreaker bool `protobuf:"varint,5,opt,name=enable_circuit_breaker,json=enableCircuitBreaker,proto3" json:"enable_circuit_breaker,omitempty"` // 熔断器
|
||||
Limiter *Middleware_RateLimiter `protobuf:"bytes,6,opt,name=limiter,proto3" json:"limiter,omitempty"`
|
||||
Metrics *Middleware_Metrics `protobuf:"bytes,7,opt,name=metrics,proto3" json:"metrics,omitempty"`
|
||||
Auth *Middleware_Auth `protobuf:"bytes,8,opt,name=auth,proto3" json:"auth,omitempty"`
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Limiter *Middleware_RateLimiter `protobuf:"bytes,1,opt,name=limiter,proto3" json:"limiter,omitempty"`
|
||||
Metrics *Middleware_Metrics `protobuf:"bytes,2,opt,name=metrics,proto3" json:"metrics,omitempty"`
|
||||
Auth *Middleware_Auth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"`
|
||||
EnableLogging bool `protobuf:"varint,10,opt,name=enable_logging,json=enableLogging,proto3" json:"enable_logging,omitempty"` // 日志开关
|
||||
EnableRecovery bool `protobuf:"varint,11,opt,name=enable_recovery,json=enableRecovery,proto3" json:"enable_recovery,omitempty"` // 异常恢复
|
||||
EnableTracing bool `protobuf:"varint,12,opt,name=enable_tracing,json=enableTracing,proto3" json:"enable_tracing,omitempty"` // 链路追踪开关
|
||||
EnableValidate bool `protobuf:"varint,13,opt,name=enable_validate,json=enableValidate,proto3" json:"enable_validate,omitempty"` // 参数校验开关
|
||||
EnableCircuitBreaker bool `protobuf:"varint,14,opt,name=enable_circuit_breaker,json=enableCircuitBreaker,proto3" json:"enable_circuit_breaker,omitempty"` // 熔断器
|
||||
EnableMetadata bool `protobuf:"varint,15,opt,name=enable_metadata,json=enableMetadata,proto3" json:"enable_metadata,omitempty"` // 元数据
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Middleware) Reset() {
|
||||
*x = Middleware{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Middleware) String() string {
|
||||
@@ -53,7 +53,7 @@ func (*Middleware) ProtoMessage() {}
|
||||
|
||||
func (x *Middleware) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -68,6 +68,27 @@ func (*Middleware) Descriptor() ([]byte, []int) {
|
||||
return file_conf_v1_kratos_conf_middleware_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Middleware) GetLimiter() *Middleware_RateLimiter {
|
||||
if x != nil {
|
||||
return x.Limiter
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware) GetMetrics() *Middleware_Metrics {
|
||||
if x != nil {
|
||||
return x.Metrics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware) GetAuth() *Middleware_Auth {
|
||||
if x != nil {
|
||||
return x.Auth
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware) GetEnableLogging() bool {
|
||||
if x != nil {
|
||||
return x.EnableLogging
|
||||
@@ -103,44 +124,31 @@ func (x *Middleware) GetEnableCircuitBreaker() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Middleware) GetLimiter() *Middleware_RateLimiter {
|
||||
func (x *Middleware) GetEnableMetadata() bool {
|
||||
if x != nil {
|
||||
return x.Limiter
|
||||
return x.EnableMetadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware) GetMetrics() *Middleware_Metrics {
|
||||
if x != nil {
|
||||
return x.Metrics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware) GetAuth() *Middleware_Auth {
|
||||
if x != nil {
|
||||
return x.Auth
|
||||
}
|
||||
return nil
|
||||
return false
|
||||
}
|
||||
|
||||
// JWT校验
|
||||
type Middleware_Auth struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // JWT签名的算法,支持算法:HS256
|
||||
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // JWT 秘钥
|
||||
AccessTokenExpires *durationpb.Duration `protobuf:"bytes,3,opt,name=access_token_expires,json=accessTokenExpires,proto3,oneof" json:"access_token_expires,omitempty"` // 访问令牌过期时间
|
||||
RefreshTokenExpires *durationpb.Duration `protobuf:"bytes,4,opt,name=refresh_token_expires,json=refreshTokenExpires,proto3,oneof" json:"refresh_token_expires,omitempty"` // 刷新令牌过期时间
|
||||
AccessTokenKeyPrefix *string `protobuf:"bytes,5,opt,name=access_token_key_prefix,json=accessTokenKeyPrefix,proto3,oneof" json:"access_token_key_prefix,omitempty"` // 访问令牌键前缀
|
||||
RefreshTokenKeyPrefix *string `protobuf:"bytes,6,opt,name=refresh_token_key_prefix,json=refreshTokenKeyPrefix,proto3,oneof" json:"refresh_token_key_prefix,omitempty"` // 刷新令牌键前缀
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) Reset() {
|
||||
*x = Middleware_Auth{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) String() string {
|
||||
@@ -151,7 +159,7 @@ func (*Middleware_Auth) ProtoMessage() {}
|
||||
|
||||
func (x *Middleware_Auth) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -180,22 +188,47 @@ func (x *Middleware_Auth) GetKey() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) GetAccessTokenExpires() *durationpb.Duration {
|
||||
if x != nil {
|
||||
return x.AccessTokenExpires
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) GetRefreshTokenExpires() *durationpb.Duration {
|
||||
if x != nil {
|
||||
return x.RefreshTokenExpires
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) GetAccessTokenKeyPrefix() string {
|
||||
if x != nil && x.AccessTokenKeyPrefix != nil {
|
||||
return *x.AccessTokenKeyPrefix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Middleware_Auth) GetRefreshTokenKeyPrefix() string {
|
||||
if x != nil && x.RefreshTokenKeyPrefix != nil {
|
||||
return *x.RefreshTokenKeyPrefix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// 限流器
|
||||
type Middleware_RateLimiter struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 限流器名字,支持:bbr。
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 限流器名字,支持:bbr。
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Middleware_RateLimiter) Reset() {
|
||||
*x = Middleware_RateLimiter{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Middleware_RateLimiter) String() string {
|
||||
@@ -206,7 +239,7 @@ func (*Middleware_RateLimiter) ProtoMessage() {}
|
||||
|
||||
func (x *Middleware_RateLimiter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -230,23 +263,20 @@ func (x *Middleware_RateLimiter) GetName() string {
|
||||
|
||||
// 性能指标
|
||||
type Middleware_Metrics struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Histogram bool `protobuf:"varint,1,opt,name=histogram,proto3" json:"histogram,omitempty"` // 直方图
|
||||
Counter bool `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` // 计数器
|
||||
Gauge bool `protobuf:"varint,3,opt,name=gauge,proto3" json:"gauge,omitempty"` // 仪表盘
|
||||
Summary bool `protobuf:"varint,4,opt,name=summary,proto3" json:"summary,omitempty"` // 摘要
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Histogram bool `protobuf:"varint,1,opt,name=histogram,proto3" json:"histogram,omitempty"` // 直方图
|
||||
Counter bool `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` // 计数器
|
||||
Gauge bool `protobuf:"varint,3,opt,name=gauge,proto3" json:"gauge,omitempty"` // 仪表盘
|
||||
Summary bool `protobuf:"varint,4,opt,name=summary,proto3" json:"summary,omitempty"` // 摘要
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Middleware_Metrics) Reset() {
|
||||
*x = Middleware_Metrics{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Middleware_Metrics) String() string {
|
||||
@@ -257,7 +287,7 @@ func (*Middleware_Metrics) ProtoMessage() {}
|
||||
|
||||
func (x *Middleware_Metrics) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_middleware_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -302,88 +332,118 @@ func (x *Middleware_Metrics) GetSummary() bool {
|
||||
|
||||
var File_conf_v1_kratos_conf_middleware_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_middleware_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_middleware_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x24, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75,
|
||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x04, 0x0a,
|
||||
0x0a, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65,
|
||||
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x67, 0x69,
|
||||
0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63,
|
||||
0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x65,
|
||||
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69,
|
||||
0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65,
|
||||
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x5f, 0x62, 0x72,
|
||||
0x65, 0x61, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x65, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x65,
|
||||
0x72, 0x12, 0x36, 0x0a, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65,
|
||||
0x77, 0x61, 0x72, 0x65, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72,
|
||||
0x52, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x74,
|
||||
0x72, 0x69, 0x63, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x74,
|
||||
0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x29, 0x0a,
|
||||
0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x41, 0x75,
|
||||
0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x1a, 0x30, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x21, 0x0a, 0x0b, 0x52, 0x61,
|
||||
0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x71, 0x0a,
|
||||
0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74,
|
||||
0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x69, 0x73,
|
||||
0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
|
||||
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x75, 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, 0x6d, 0x6d, 0x61, 0x72,
|
||||
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
|
||||
0x42, 0x8b, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x19, 0x4b,
|
||||
0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77,
|
||||
0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61,
|
||||
0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31,
|
||||
0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x07, 0x0a,
|
||||
0x0a, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6c,
|
||||
0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x52,
|
||||
0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x52, 0x07, 0x6c, 0x69, 0x6d, 0x69,
|
||||
0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64, 0x64,
|
||||
0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07,
|
||||
0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x64,
|
||||
0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75,
|
||||
0x74, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x67,
|
||||
0x67, 0x69, 0x6e, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65,
|
||||
0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x61,
|
||||
0x63, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x69, 0x72,
|
||||
0x63, 0x75, 0x69, 0x74, 0x5f, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x14, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x69, 0x72, 0x63, 0x75, 0x69,
|
||||
0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0x1a, 0xbc, 0x03, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65,
|
||||
0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68,
|
||||
0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x50, 0x0a, 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52,
|
||||
0x12, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69,
|
||||
0x72, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x52, 0x0a, 0x15, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
|
||||
0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x48, 0x01, 0x52, 0x13, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x61, 0x63,
|
||||
0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70,
|
||||
0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x14, 0x61,
|
||||
0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x65,
|
||||
0x66, 0x69, 0x78, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x18, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
|
||||
0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x72, 0x65, 0x66,
|
||||
0x69, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x15, 0x72, 0x65, 0x66, 0x72,
|
||||
0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x65, 0x66, 0x69,
|
||||
0x78, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f,
|
||||
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x42, 0x18, 0x0a,
|
||||
0x16, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f,
|
||||
0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x61, 0x63, 0x63, 0x65,
|
||||
0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x72, 0x65,
|
||||
0x66, 0x69, 0x78, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f,
|
||||
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78,
|
||||
0x1a, 0x21, 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x1a, 0x71, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63,
|
||||
0x6f, 0x75, 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, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73,
|
||||
0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x8b, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x42, 0x19, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4d,
|
||||
0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37,
|
||||
0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
|
||||
0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63,
|
||||
0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescData = file_conf_v1_kratos_conf_middleware_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_middleware_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_middleware_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_middleware_proto_rawDesc), len(file_conf_v1_kratos_conf_middleware_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_middleware_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_middleware_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_conf_v1_kratos_conf_middleware_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_middleware_proto_goTypes = []any{
|
||||
(*Middleware)(nil), // 0: conf.Middleware
|
||||
(*Middleware_Auth)(nil), // 1: conf.Middleware.Auth
|
||||
(*Middleware_RateLimiter)(nil), // 2: conf.Middleware.RateLimiter
|
||||
(*Middleware_Metrics)(nil), // 3: conf.Middleware.Metrics
|
||||
(*durationpb.Duration)(nil), // 4: google.protobuf.Duration
|
||||
}
|
||||
var file_conf_v1_kratos_conf_middleware_proto_depIdxs = []int32{
|
||||
2, // 0: conf.Middleware.limiter:type_name -> conf.Middleware.RateLimiter
|
||||
3, // 1: conf.Middleware.metrics:type_name -> conf.Middleware.Metrics
|
||||
1, // 2: conf.Middleware.auth:type_name -> conf.Middleware.Auth
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
4, // 3: conf.Middleware.Auth.access_token_expires:type_name -> google.protobuf.Duration
|
||||
4, // 4: conf.Middleware.Auth.refresh_token_expires:type_name -> google.protobuf.Duration
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_conf_v1_kratos_conf_middleware_proto_init() }
|
||||
@@ -391,61 +451,12 @@ func file_conf_v1_kratos_conf_middleware_proto_init() {
|
||||
if File_conf_v1_kratos_conf_middleware_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_middleware_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Middleware); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_middleware_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Middleware_Auth); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_middleware_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Middleware_RateLimiter); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_middleware_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Middleware_Metrics); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_middleware_proto_msgTypes[1].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_middleware_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_middleware_proto_rawDesc), len(file_conf_v1_kratos_conf_middleware_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
@@ -456,7 +467,6 @@ func file_conf_v1_kratos_conf_middleware_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_middleware_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_middleware_proto = out.File
|
||||
file_conf_v1_kratos_conf_middleware_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_middleware_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_middleware_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_notify.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -22,20 +23,17 @@ const (
|
||||
|
||||
// 通知消息
|
||||
type Notification struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Sms *Notification_SMS `protobuf:"bytes,1,opt,name=sms,proto3,oneof" json:"sms,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sms *Notification_SMS `protobuf:"bytes,1,opt,name=sms,proto3" json:"sms,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Notification) Reset() {
|
||||
*x = Notification{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Notification) String() string {
|
||||
@@ -46,7 +44,7 @@ func (*Notification) ProtoMessage() {}
|
||||
|
||||
func (x *Notification) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -70,23 +68,20 @@ func (x *Notification) GetSms() *Notification_SMS {
|
||||
|
||||
// 短信
|
||||
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"` // 访问密钥
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
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"` // 访问密钥
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Notification_SMS) Reset() {
|
||||
*x = Notification_SMS{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Notification_SMS) String() string {
|
||||
@@ -97,7 +92,7 @@ func (*Notification_SMS) ProtoMessage() {}
|
||||
|
||||
func (x *Notification_SMS) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_notify_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -142,48 +137,49 @@ func (x *Notification_SMS) GetAccessKeySecret() string {
|
||||
|
||||
var File_conf_v1_kratos_conf_notify_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_notify_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_notify_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 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,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0xd6, 0x01, 0x0a, 0x0c, 0x4e, 0x6f, 0x74,
|
||||
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 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, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x42, 0x15, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4e, 0x6f, 0x74,
|
||||
0x69, 0x66, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61,
|
||||
0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31,
|
||||
0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x4d, 0x53, 0x48, 0x00,
|
||||
0x52, 0x03, 0x73, 0x6d, 0x73, 0x88, 0x01, 0x01, 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, 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x6d,
|
||||
0x73, 0x42, 0x87, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x15,
|
||||
0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67,
|
||||
0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
||||
0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescData = file_conf_v1_kratos_conf_notify_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_notify_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_notify_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_notify_proto_rawDesc), len(file_conf_v1_kratos_conf_notify_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_notify_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_conf_v1_kratos_conf_notify_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_notify_proto_goTypes = []any{
|
||||
(*Notification)(nil), // 0: conf.Notification
|
||||
(*Notification_SMS)(nil), // 1: conf.Notification.SMS
|
||||
}
|
||||
@@ -201,37 +197,12 @@ func file_conf_v1_kratos_conf_notify_proto_init() {
|
||||
if File_conf_v1_kratos_conf_notify_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_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_kratos_conf_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
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_notify_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_notify_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_notify_proto_rawDesc), len(file_conf_v1_kratos_conf_notify_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
@@ -242,7 +213,6 @@ func file_conf_v1_kratos_conf_notify_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_notify_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_notify_proto = out.File
|
||||
file_conf_v1_kratos_conf_notify_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_notify_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_notify_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_oss.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -20,21 +21,19 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 对象存储
|
||||
type OSS struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Minio *OSS_MinIO `protobuf:"bytes,1,opt,name=minio,proto3,oneof" json:"minio,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Minio *OSS_MinIO `protobuf:"bytes,1,opt,name=minio,proto3" json:"minio,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *OSS) Reset() {
|
||||
*x = OSS{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *OSS) String() string {
|
||||
@@ -45,7 +44,7 @@ func (*OSS) ProtoMessage() {}
|
||||
|
||||
func (x *OSS) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -69,27 +68,24 @@ func (x *OSS) GetMinio() *OSS_MinIO {
|
||||
|
||||
// MinIO
|
||||
type OSS_MinIO struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 对端端口
|
||||
AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥
|
||||
SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // 密钥
|
||||
Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // 令牌
|
||||
UseSsl bool `protobuf:"varint,10,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` // 使用SSL
|
||||
Tls *TLS `protobuf:"bytes,11,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
UploadHost string `protobuf:"bytes,20,opt,name=upload_host,json=uploadHost,proto3" json:"upload_host,omitempty"` // 上传链接的主机名
|
||||
DownloadHost string `protobuf:"bytes,21,opt,name=download_host,json=downloadHost,proto3" json:"download_host,omitempty"` // 下载链接的主机名
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 对端端口
|
||||
AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥
|
||||
SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // 密钥
|
||||
Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // 令牌
|
||||
UseSsl bool `protobuf:"varint,10,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` // 使用SSL
|
||||
Tls *TLS `protobuf:"bytes,11,opt,name=tls,proto3" json:"tls,omitempty"` // TLS配置
|
||||
UploadHost string `protobuf:"bytes,20,opt,name=upload_host,json=uploadHost,proto3" json:"upload_host,omitempty"` // 上传链接的主机名
|
||||
DownloadHost string `protobuf:"bytes,21,opt,name=download_host,json=downloadHost,proto3" json:"download_host,omitempty"` // 下载链接的主机名
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *OSS_MinIO) Reset() {
|
||||
*x = OSS_MinIO{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *OSS_MinIO) String() string {
|
||||
@@ -100,7 +96,7 @@ func (*OSS_MinIO) ProtoMessage() {}
|
||||
|
||||
func (x *OSS_MinIO) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_oss_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -173,55 +169,56 @@ func (x *OSS_MinIO) GetDownloadHost() string {
|
||||
|
||||
var File_conf_v1_kratos_conf_oss_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_oss_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_oss_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x6f, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1d, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b,
|
||||
0x72, 0x61, 0x74, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x74, 0x6c, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, 0x0a, 0x03, 0x4f, 0x53, 0x53, 0x12, 0x25, 0x0a, 0x05,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb1, 0x02, 0x0a, 0x03, 0x4f, 0x53, 0x53, 0x12, 0x2a, 0x0a, 0x05,
|
||||
0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x2e, 0x4d, 0x69, 0x6e, 0x49, 0x4f, 0x52, 0x05, 0x6d, 0x69,
|
||||
0x6e, 0x69, 0x6f, 0x1a, 0xf3, 0x01, 0x0a, 0x05, 0x4d, 0x69, 0x6e, 0x49, 0x4f, 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, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63,
|
||||
0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61,
|
||||
0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72,
|
||||
0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65,
|
||||
0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x0a,
|
||||
0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06,
|
||||
0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x1b, 0x0a, 0x03, 0x74, 0x6c, 0x73, 0x18, 0x0b, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x4c, 0x53, 0x52, 0x03,
|
||||
0x74, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f,
|
||||
0x73, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64,
|
||||
0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
|
||||
0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77,
|
||||
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x84, 0x01, 0x0a, 0x08, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x12, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x4f, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b,
|
||||
0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f,
|
||||
0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca,
|
||||
0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50,
|
||||
0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x6e, 0x66, 0x2e, 0x4f, 0x53, 0x53, 0x2e, 0x4d, 0x69, 0x6e, 0x49, 0x4f, 0x48, 0x00, 0x52, 0x05,
|
||||
0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x88, 0x01, 0x01, 0x1a, 0xf3, 0x01, 0x0a, 0x05, 0x4d, 0x69, 0x6e,
|
||||
0x49, 0x4f, 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, 0x1d,
|
||||
0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a,
|
||||
0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x0a, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x1b, 0x0a, 0x03, 0x74,
|
||||
0x6c, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x54, 0x4c, 0x53, 0x52, 0x03, 0x74, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75,
|
||||
0x70, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77,
|
||||
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x08,
|
||||
0x0a, 0x06, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x42, 0x84, 0x01, 0x0a, 0x08, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x12, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x4f, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72,
|
||||
0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76,
|
||||
0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02,
|
||||
0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42,
|
||||
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescData = file_conf_v1_kratos_conf_oss_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_oss_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_oss_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_oss_proto_rawDesc), len(file_conf_v1_kratos_conf_oss_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_oss_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_oss_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_conf_v1_kratos_conf_oss_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_oss_proto_goTypes = []any{
|
||||
(*OSS)(nil), // 0: conf.OSS
|
||||
(*OSS_MinIO)(nil), // 1: conf.OSS.MinIO
|
||||
(*TLS)(nil), // 2: conf.TLS
|
||||
@@ -242,37 +239,12 @@ func file_conf_v1_kratos_conf_oss_proto_init() {
|
||||
return
|
||||
}
|
||||
file_conf_v1_kratos_conf_tls_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_oss_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*OSS); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_oss_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*OSS_MinIO); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_oss_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_oss_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_oss_proto_rawDesc), len(file_conf_v1_kratos_conf_oss_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
@@ -283,7 +255,6 @@ func file_conf_v1_kratos_conf_oss_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_oss_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_oss_proto = out.File
|
||||
file_conf_v1_kratos_conf_oss_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_oss_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_oss_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_registry.proto
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,28 +24,25 @@ const (
|
||||
|
||||
// 注册发现中心
|
||||
type Registry struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Consul *Registry_Consul `protobuf:"bytes,2,opt,name=consul,proto3,oneof" json:"consul,omitempty"` // Consul
|
||||
Etcd *Registry_Etcd `protobuf:"bytes,3,opt,name=etcd,proto3,oneof" json:"etcd,omitempty"` // Etcd
|
||||
Zookeeper *Registry_ZooKeeper `protobuf:"bytes,4,opt,name=zookeeper,proto3,oneof" json:"zookeeper,omitempty"` // ZooKeeper
|
||||
Nacos *Registry_Nacos `protobuf:"bytes,5,opt,name=nacos,proto3,oneof" json:"nacos,omitempty"` // Nacos
|
||||
Kubernetes *Registry_Kubernetes `protobuf:"bytes,6,opt,name=kubernetes,proto3,oneof" json:"kubernetes,omitempty"` // Kubernetes
|
||||
Eureka *Registry_Eureka `protobuf:"bytes,7,opt,name=eureka,proto3,oneof" json:"eureka,omitempty"` // Eureka
|
||||
Polaris *Registry_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3,oneof" json:"polaris,omitempty"` // Polaris
|
||||
Servicecomb *Registry_Servicecomb `protobuf:"bytes,9,opt,name=servicecomb,proto3,oneof" json:"servicecomb,omitempty"` // Servicecomb
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Consul *Registry_Consul `protobuf:"bytes,2,opt,name=consul,proto3" json:"consul,omitempty"` // Consul
|
||||
Etcd *Registry_Etcd `protobuf:"bytes,3,opt,name=etcd,proto3" json:"etcd,omitempty"` // Etcd
|
||||
Zookeeper *Registry_ZooKeeper `protobuf:"bytes,4,opt,name=zookeeper,proto3" json:"zookeeper,omitempty"` // ZooKeeper
|
||||
Nacos *Registry_Nacos `protobuf:"bytes,5,opt,name=nacos,proto3" json:"nacos,omitempty"` // Nacos
|
||||
Kubernetes *Registry_Kubernetes `protobuf:"bytes,6,opt,name=kubernetes,proto3" json:"kubernetes,omitempty"` // Kubernetes
|
||||
Eureka *Registry_Eureka `protobuf:"bytes,7,opt,name=eureka,proto3" json:"eureka,omitempty"` // Eureka
|
||||
Polaris *Registry_Polaris `protobuf:"bytes,8,opt,name=polaris,proto3" json:"polaris,omitempty"` // Polaris
|
||||
Servicecomb *Registry_Servicecomb `protobuf:"bytes,9,opt,name=servicecomb,proto3" json:"servicecomb,omitempty"` // Servicecomb
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry) Reset() {
|
||||
*x = Registry{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry) String() string {
|
||||
@@ -55,7 +53,7 @@ func (*Registry) ProtoMessage() {}
|
||||
|
||||
func (x *Registry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -135,22 +133,19 @@ func (x *Registry) GetServicecomb() *Registry_Servicecomb {
|
||||
|
||||
// Consul
|
||||
type Registry_Consul struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
HealthCheck bool `protobuf:"varint,3,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"` // 健康检查
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Scheme string `protobuf:"bytes,1,opt,name=scheme,proto3" json:"scheme,omitempty"` // 网络样式
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
HealthCheck bool `protobuf:"varint,3,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"` // 健康检查
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Consul) Reset() {
|
||||
*x = Registry_Consul{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Consul) String() string {
|
||||
@@ -161,7 +156,7 @@ func (*Registry_Consul) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Consul) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -199,20 +194,17 @@ func (x *Registry_Consul) GetHealthCheck() bool {
|
||||
|
||||
// Etcd
|
||||
type Registry_Etcd struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Etcd) Reset() {
|
||||
*x = Registry_Etcd{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Etcd) String() string {
|
||||
@@ -223,7 +215,7 @@ func (*Registry_Etcd) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Etcd) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -247,21 +239,18 @@ func (x *Registry_Etcd) GetEndpoints() []string {
|
||||
|
||||
// ZooKeeper
|
||||
type Registry_ZooKeeper struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_ZooKeeper) Reset() {
|
||||
*x = Registry_ZooKeeper{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_ZooKeeper) String() string {
|
||||
@@ -272,7 +261,7 @@ func (*Registry_ZooKeeper) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_ZooKeeper) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -303,30 +292,37 @@ func (x *Registry_ZooKeeper) GetTimeout() *durationpb.Duration {
|
||||
|
||||
// Nacos
|
||||
type Registry_Nacos struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
NamespaceId string `protobuf:"bytes,3,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` //
|
||||
LogLevel string `protobuf:"bytes,4,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` // 日志等级
|
||||
CacheDir string `protobuf:"bytes,5,opt,name=cache_dir,json=cacheDir,proto3" json:"cache_dir,omitempty"` // 缓存目录
|
||||
LogDir string `protobuf:"bytes,6,opt,name=log_dir,json=logDir,proto3" json:"log_dir,omitempty"` // 日志目录
|
||||
UpdateThreadNum int32 `protobuf:"varint,7,opt,name=update_thread_num,json=updateThreadNum,proto3" json:"update_thread_num,omitempty"` // 更新服务的线程数
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,8,opt,name=timeout,proto3" json:"timeout,omitempty"` // http请求超时时间,单位: 毫秒
|
||||
BeatInterval *durationpb.Duration `protobuf:"bytes,9,opt,name=beat_interval,json=beatInterval,proto3" json:"beat_interval,omitempty"` // 心跳间隔时间,单位: 毫秒
|
||||
NotLoadCacheAtStart bool `protobuf:"varint,10,opt,name=not_load_cache_at_start,json=notLoadCacheAtStart,proto3" json:"not_load_cache_at_start,omitempty"` // 在启动时不读取本地缓存数据,true: 不读取,false: 读取
|
||||
UpdateCacheWhenEmpty bool `protobuf:"varint,11,opt,name=update_cache_when_empty,json=updateCacheWhenEmpty,proto3" json:"update_cache_when_empty,omitempty"` // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port uint64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
NamespaceId string `protobuf:"bytes,3,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // 命名空间ID
|
||||
RegionId string `protobuf:"bytes,4,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` // 区域ID
|
||||
AppName string `protobuf:"bytes,5,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` // 应用名称
|
||||
AppKey string `protobuf:"bytes,6,opt,name=app_key,json=appKey,proto3" json:"app_key,omitempty"` // 应用密钥
|
||||
AccessKey string `protobuf:"bytes,7,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 访问密钥
|
||||
SecretKey string `protobuf:"bytes,8,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // 密钥
|
||||
Username string `protobuf:"bytes,9,opt,name=username,proto3" json:"username,omitempty"` // 用户名
|
||||
Password string `protobuf:"bytes,10,opt,name=password,proto3" json:"password,omitempty"` // 密码
|
||||
Timeout *durationpb.Duration `protobuf:"bytes,20,opt,name=timeout,proto3" json:"timeout,omitempty"` // http请求超时时间,单位: 毫秒
|
||||
BeatInterval *durationpb.Duration `protobuf:"bytes,21,opt,name=beat_interval,json=beatInterval,proto3" json:"beat_interval,omitempty"` // 心跳间隔时间,单位: 毫秒
|
||||
ListenInterval *durationpb.Duration `protobuf:"bytes,22,opt,name=listen_interval,json=listenInterval,proto3" json:"listen_interval,omitempty"` // 心跳间隔时间,单位: 毫秒
|
||||
UpdateThreadNum int32 `protobuf:"varint,30,opt,name=update_thread_num,json=updateThreadNum,proto3" json:"update_thread_num,omitempty"` // 更新服务的线程数
|
||||
NotLoadCacheAtStart bool `protobuf:"varint,40,opt,name=not_load_cache_at_start,json=notLoadCacheAtStart,proto3" json:"not_load_cache_at_start,omitempty"` // 在启动时不读取本地缓存数据,true: 不读取,false: 读取
|
||||
UpdateCacheWhenEmpty bool `protobuf:"varint,41,opt,name=update_cache_when_empty,json=updateCacheWhenEmpty,proto3" json:"update_cache_when_empty,omitempty"` // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新
|
||||
OpenKms bool `protobuf:"varint,42,opt,name=open_kms,json=openKms,proto3" json:"open_kms,omitempty"` // 是否开启kms加密,true: 开启,false: 关闭
|
||||
LogLevel string `protobuf:"bytes,50,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` // 日志等级
|
||||
LogDir string `protobuf:"bytes,51,opt,name=log_dir,json=logDir,proto3" json:"log_dir,omitempty"` // 日志目录
|
||||
CacheDir string `protobuf:"bytes,52,opt,name=cache_dir,json=cacheDir,proto3" json:"cache_dir,omitempty"` // 缓存目录
|
||||
ContextPath string `protobuf:"bytes,53,opt,name=context_path,json=contextPath,proto3" json:"context_path,omitempty"` // 上下文路径
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) Reset() {
|
||||
*x = Registry_Nacos{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) String() string {
|
||||
@@ -337,7 +333,7 @@ func (*Registry_Nacos) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Nacos) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -373,32 +369,53 @@ func (x *Registry_Nacos) GetNamespaceId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetLogLevel() string {
|
||||
func (x *Registry_Nacos) GetRegionId() string {
|
||||
if x != nil {
|
||||
return x.LogLevel
|
||||
return x.RegionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetCacheDir() string {
|
||||
func (x *Registry_Nacos) GetAppName() string {
|
||||
if x != nil {
|
||||
return x.CacheDir
|
||||
return x.AppName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetLogDir() string {
|
||||
func (x *Registry_Nacos) GetAppKey() string {
|
||||
if x != nil {
|
||||
return x.LogDir
|
||||
return x.AppKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetUpdateThreadNum() int32 {
|
||||
func (x *Registry_Nacos) GetAccessKey() string {
|
||||
if x != nil {
|
||||
return x.UpdateThreadNum
|
||||
return x.AccessKey
|
||||
}
|
||||
return 0
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetSecretKey() string {
|
||||
if x != nil {
|
||||
return x.SecretKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetTimeout() *durationpb.Duration {
|
||||
@@ -415,6 +432,20 @@ func (x *Registry_Nacos) GetBeatInterval() *durationpb.Duration {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetListenInterval() *durationpb.Duration {
|
||||
if x != nil {
|
||||
return x.ListenInterval
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetUpdateThreadNum() int32 {
|
||||
if x != nil {
|
||||
return x.UpdateThreadNum
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetNotLoadCacheAtStart() bool {
|
||||
if x != nil {
|
||||
return x.NotLoadCacheAtStart
|
||||
@@ -429,20 +460,53 @@ func (x *Registry_Nacos) GetUpdateCacheWhenEmpty() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetOpenKms() bool {
|
||||
if x != nil {
|
||||
return x.OpenKms
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetLogLevel() string {
|
||||
if x != nil {
|
||||
return x.LogLevel
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetLogDir() string {
|
||||
if x != nil {
|
||||
return x.LogDir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetCacheDir() string {
|
||||
if x != nil {
|
||||
return x.CacheDir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Registry_Nacos) GetContextPath() string {
|
||||
if x != nil {
|
||||
return x.ContextPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Kubernetes
|
||||
type Registry_Kubernetes struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Kubernetes) Reset() {
|
||||
*x = Registry_Kubernetes{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Kubernetes) String() string {
|
||||
@@ -453,7 +517,7 @@ func (*Registry_Kubernetes) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Kubernetes) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -470,23 +534,20 @@ func (*Registry_Kubernetes) Descriptor() ([]byte, []int) {
|
||||
|
||||
// Eureka
|
||||
type Registry_Eureka struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
HeartbeatInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"`
|
||||
RefreshInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=refresh_interval,json=refreshInterval,proto3" json:"refresh_interval,omitempty"`
|
||||
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
HeartbeatInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"`
|
||||
RefreshInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=refresh_interval,json=refreshInterval,proto3" json:"refresh_interval,omitempty"`
|
||||
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Eureka) Reset() {
|
||||
*x = Registry_Eureka{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Eureka) String() string {
|
||||
@@ -497,7 +558,7 @@ func (*Registry_Eureka) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Eureka) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -542,25 +603,22 @@ func (x *Registry_Eureka) GetPath() string {
|
||||
|
||||
// Polaris
|
||||
type Registry_Polaris struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
InstanceCount int32 `protobuf:"varint,3,opt,name=instance_count,json=instanceCount,proto3" json:"instance_count,omitempty"`
|
||||
Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"`
|
||||
Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // 服务端地址
|
||||
Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // 服务端端口
|
||||
InstanceCount int32 `protobuf:"varint,3,opt,name=instance_count,json=instanceCount,proto3" json:"instance_count,omitempty"`
|
||||
Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"`
|
||||
Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Polaris) Reset() {
|
||||
*x = Registry_Polaris{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Polaris) String() string {
|
||||
@@ -571,7 +629,7 @@ func (*Registry_Polaris) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Polaris) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -630,20 +688,17 @@ func (x *Registry_Polaris) GetToken() string {
|
||||
|
||||
// Servicecomb
|
||||
type Registry_Servicecomb struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Registry_Servicecomb) Reset() {
|
||||
*x = Registry_Servicecomb{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Registry_Servicecomb) String() string {
|
||||
@@ -654,7 +709,7 @@ func (*Registry_Servicecomb) ProtoMessage() {}
|
||||
|
||||
func (x *Registry_Servicecomb) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_registry_proto_msgTypes[8]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -678,134 +733,163 @@ func (x *Registry_Servicecomb) GetEndpoints() []string {
|
||||
|
||||
var File_conf_v1_kratos_conf_registry_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_registry_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_registry_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x0c, 0x0a, 0x08, 0x52,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x0f, 0x0a, 0x08, 0x52,
|
||||
0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x63,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73,
|
||||
0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x65, 0x74,
|
||||
0x63, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x52, 0x04, 0x65,
|
||||
0x74, 0x63, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65,
|
||||
0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65, 0x70, 0x65, 0x72,
|
||||
0x52, 0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x05, 0x6e,
|
||||
0x61, 0x63, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e,
|
||||
0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73,
|
||||
0x52, 0x05, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72,
|
||||
0x6e, 0x65, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x75, 0x62, 0x65,
|
||||
0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74,
|
||||
0x65, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x18, 0x07, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x45, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x52, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b,
|
||||
0x61, 0x12, 0x30, 0x0a, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61,
|
||||
0x72, 0x69, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f,
|
||||
0x6d, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
||||
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x63, 0x6f, 0x6d, 0x62, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d,
|
||||
0x62, 0x1a, 0x5d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73,
|
||||
0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68,
|
||||
0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a,
|
||||
0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b,
|
||||
0x1a, 0x24, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12, 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, 0x1a, 0x5e, 0x0a, 0x09, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65,
|
||||
0x70, 0x65, 0x72, 0x12, 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, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xb9, 0x03, 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x21,
|
||||
0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49,
|
||||
0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b,
|
||||
0x0a, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x08, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, 0x69, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6c,
|
||||
0x6f, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f,
|
||||
0x67, 0x44, 0x69, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
|
||||
0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4e, 0x75, 0x6d,
|
||||
0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
|
||||
0x75, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x88, 0x01, 0x01, 0x12,
|
||||
0x2c, 0x0a, 0x04, 0x65, 0x74, 0x63, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x74,
|
||||
0x63, 0x64, 0x48, 0x01, 0x52, 0x04, 0x65, 0x74, 0x63, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a,
|
||||
0x09, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
|
||||
0x2e, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x48, 0x02, 0x52, 0x09, 0x7a, 0x6f,
|
||||
0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x05, 0x6e, 0x61,
|
||||
0x63, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
|
||||
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x48,
|
||||
0x03, 0x52, 0x05, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x0a, 0x6b,
|
||||
0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e,
|
||||
0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x48, 0x04, 0x52, 0x0a, 0x6b, 0x75,
|
||||
0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x06, 0x65,
|
||||
0x75, 0x72, 0x65, 0x6b, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x75, 0x72, 0x65,
|
||||
0x6b, 0x61, 0x48, 0x05, 0x52, 0x06, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x88, 0x01, 0x01, 0x12,
|
||||
0x35, 0x0a, 0x07, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
|
||||
0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x48, 0x06, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x61,
|
||||
0x72, 0x69, 0x73, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x63, 0x6f, 0x6d, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f,
|
||||
0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x48, 0x07, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x88, 0x01, 0x01, 0x1a, 0x5d, 0x0a, 0x06, 0x43, 0x6f, 0x6e,
|
||||
0x73, 0x75, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61,
|
||||
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64,
|
||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f,
|
||||
0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x65, 0x61,
|
||||
0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x24, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64,
|
||||
0x12, 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, 0x1a, 0x5e,
|
||||
0x0a, 0x09, 0x5a, 0x6f, 0x6f, 0x4b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x12, 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, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x82,
|
||||
0x06, 0x0a, 0x05, 0x4e, 0x61, 0x63, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65,
|
||||
0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67,
|
||||
0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65,
|
||||
0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63,
|
||||
0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
||||
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63,
|
||||
0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73,
|
||||
0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e,
|
||||
0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
|
||||
0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
|
||||
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74,
|
||||
0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x17, 0x6e, 0x6f, 0x74, 0x5f, 0x6c, 0x6f, 0x61,
|
||||
0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x42, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f,
|
||||
0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x65,
|
||||
0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x11, 0x75, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x1e,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65,
|
||||
0x61, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x17, 0x6e, 0x6f, 0x74, 0x5f, 0x6c, 0x6f, 0x61,
|
||||
0x64, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6e, 0x6f, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x43,
|
||||
0x18, 0x28, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6e, 0x6f, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x43,
|
||||
0x61, 0x63, 0x68, 0x65, 0x41, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x35, 0x0a, 0x17, 0x75,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x77, 0x68, 0x65, 0x6e,
|
||||
0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x70,
|
||||
0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x29, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x57, 0x68, 0x65, 0x6e, 0x45, 0x6d, 0x70,
|
||||
0x74, 0x79, 0x1a, 0x0c, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73,
|
||||
0x1a, 0xca, 0x01, 0x0a, 0x06, 0x45, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x12, 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, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65, 0x61,
|
||||
0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72,
|
||||
0x76, 0x61, 0x6c, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x69,
|
||||
0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
|
||||
0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
|
||||
0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x1a, 0xac, 0x01,
|
||||
0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64,
|
||||
0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61,
|
||||
0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 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, 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, 0x89, 0x01, 0x0a, 0x08, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x17, 0x4b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78,
|
||||
0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73,
|
||||
0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f,
|
||||
0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x04,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x74, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6b, 0x6d, 0x73, 0x18, 0x2a,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x4b, 0x6d, 0x73, 0x12, 0x1b, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x32, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f,
|
||||
0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x67,
|
||||
0x44, 0x69, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x64, 0x69, 0x72,
|
||||
0x18, 0x34, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x63, 0x68, 0x65, 0x44, 0x69, 0x72,
|
||||
0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68,
|
||||
0x18, 0x35, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50,
|
||||
0x61, 0x74, 0x68, 0x1a, 0x0c, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65,
|
||||
0x73, 0x1a, 0xca, 0x01, 0x0a, 0x06, 0x45, 0x75, 0x72, 0x65, 0x6b, 0x61, 0x12, 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, 0x12, 0x48, 0x0a, 0x12, 0x68, 0x65,
|
||||
0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x74, 0x65,
|
||||
0x72, 0x76, 0x61, 0x6c, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f,
|
||||
0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x72, 0x65,
|
||||
0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
|
||||
0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x1a, 0xac,
|
||||
0x01, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64,
|
||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64,
|
||||
0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 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, 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, 0x09, 0x0a, 0x07, 0x5f, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x65, 0x74, 0x63, 0x64, 0x42, 0x0c,
|
||||
0x0a, 0x0a, 0x5f, 0x7a, 0x6f, 0x6f, 0x6b, 0x65, 0x65, 0x70, 0x65, 0x72, 0x42, 0x08, 0x0a, 0x06,
|
||||
0x5f, 0x6e, 0x61, 0x63, 0x6f, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6b, 0x75, 0x62, 0x65, 0x72,
|
||||
0x6e, 0x65, 0x74, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x65, 0x75, 0x72, 0x65, 0x6b, 0x61,
|
||||
0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6d, 0x62, 0x42, 0x89, 0x01, 0x0a,
|
||||
0x08, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x42, 0x17, 0x4b, 0x72, 0x61, 0x74, 0x6f,
|
||||
0x73, 0x43, 0x6f, 0x6e, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f,
|
||||
0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
|
||||
0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58,
|
||||
0xaa, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xca, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0xe2, 0x02,
|
||||
0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescData = file_conf_v1_kratos_conf_registry_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_registry_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_registry_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_registry_proto_rawDesc), len(file_conf_v1_kratos_conf_registry_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_registry_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_conf_v1_kratos_conf_registry_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_registry_proto_goTypes = []any{
|
||||
(*Registry)(nil), // 0: conf.Registry
|
||||
(*Registry_Consul)(nil), // 1: conf.Registry.Consul
|
||||
(*Registry_Etcd)(nil), // 2: conf.Registry.Etcd
|
||||
@@ -829,13 +913,14 @@ var file_conf_v1_kratos_conf_registry_proto_depIdxs = []int32{
|
||||
9, // 8: conf.Registry.ZooKeeper.timeout:type_name -> google.protobuf.Duration
|
||||
9, // 9: conf.Registry.Nacos.timeout:type_name -> google.protobuf.Duration
|
||||
9, // 10: conf.Registry.Nacos.beat_interval:type_name -> google.protobuf.Duration
|
||||
9, // 11: conf.Registry.Eureka.heartbeat_interval:type_name -> google.protobuf.Duration
|
||||
9, // 12: conf.Registry.Eureka.refresh_interval:type_name -> google.protobuf.Duration
|
||||
13, // [13:13] is the sub-list for method output_type
|
||||
13, // [13:13] is the sub-list for method input_type
|
||||
13, // [13:13] is the sub-list for extension type_name
|
||||
13, // [13:13] is the sub-list for extension extendee
|
||||
0, // [0:13] is the sub-list for field type_name
|
||||
9, // 11: conf.Registry.Nacos.listen_interval:type_name -> google.protobuf.Duration
|
||||
9, // 12: conf.Registry.Eureka.heartbeat_interval:type_name -> google.protobuf.Duration
|
||||
9, // 13: conf.Registry.Eureka.refresh_interval:type_name -> google.protobuf.Duration
|
||||
14, // [14:14] is the sub-list for method output_type
|
||||
14, // [14:14] is the sub-list for method input_type
|
||||
14, // [14:14] is the sub-list for extension type_name
|
||||
14, // [14:14] is the sub-list for extension extendee
|
||||
0, // [0:14] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_conf_v1_kratos_conf_registry_proto_init() }
|
||||
@@ -843,121 +928,12 @@ func file_conf_v1_kratos_conf_registry_proto_init() {
|
||||
if File_conf_v1_kratos_conf_registry_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Consul); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Etcd); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_ZooKeeper); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Nacos); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Kubernetes); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Eureka); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Polaris); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Registry_Servicecomb); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_registry_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_registry_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_registry_proto_rawDesc), len(file_conf_v1_kratos_conf_registry_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
@@ -968,7 +944,6 @@ func file_conf_v1_kratos_conf_registry_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_registry_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_registry_proto = out.File
|
||||
file_conf_v1_kratos_conf_registry_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_registry_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_registry_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_tls.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -20,23 +21,21 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// TLS配置
|
||||
type TLS struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
File *TLS_File `protobuf:"bytes,1,opt,name=file,proto3,oneof" json:"file,omitempty"`
|
||||
Config *TLS_Config `protobuf:"bytes,2,opt,name=config,proto3,oneof" json:"config,omitempty"`
|
||||
InsecureSkipVerify bool `protobuf:"varint,3,opt,name=insecure_skip_verify,json=insecureSkipVerify,proto3" json:"insecure_skip_verify,omitempty"`
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
File *TLS_File `protobuf:"bytes,1,opt,name=file,proto3,oneof" json:"file,omitempty"`
|
||||
Config *TLS_Config `protobuf:"bytes,2,opt,name=config,proto3,oneof" json:"config,omitempty"`
|
||||
InsecureSkipVerify bool `protobuf:"varint,3,opt,name=insecure_skip_verify,json=insecureSkipVerify,proto3" json:"insecure_skip_verify,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TLS) Reset() {
|
||||
*x = TLS{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TLS) String() string {
|
||||
@@ -47,7 +46,7 @@ func (*TLS) ProtoMessage() {}
|
||||
|
||||
func (x *TLS) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -84,22 +83,19 @@ func (x *TLS) GetInsecureSkipVerify() bool {
|
||||
}
|
||||
|
||||
type TLS_File struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CertPath *string `protobuf:"bytes,1,opt,name=cert_path,json=certPath,proto3,oneof" json:"cert_path,omitempty"`
|
||||
KeyPath *string `protobuf:"bytes,2,opt,name=key_path,json=keyPath,proto3,oneof" json:"key_path,omitempty"`
|
||||
CaPath *string `protobuf:"bytes,3,opt,name=ca_path,json=caPath,proto3,oneof" json:"ca_path,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CertPath *string `protobuf:"bytes,1,opt,name=cert_path,json=certPath,proto3,oneof" json:"cert_path,omitempty"`
|
||||
KeyPath *string `protobuf:"bytes,2,opt,name=key_path,json=keyPath,proto3,oneof" json:"key_path,omitempty"`
|
||||
CaPath *string `protobuf:"bytes,3,opt,name=ca_path,json=caPath,proto3,oneof" json:"ca_path,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TLS_File) Reset() {
|
||||
*x = TLS_File{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TLS_File) String() string {
|
||||
@@ -110,7 +106,7 @@ func (*TLS_File) ProtoMessage() {}
|
||||
|
||||
func (x *TLS_File) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -147,22 +143,19 @@ func (x *TLS_File) GetCaPath() string {
|
||||
}
|
||||
|
||||
type TLS_Config struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CertPem []byte `protobuf:"bytes,1,opt,name=cert_pem,json=certPem,proto3,oneof" json:"cert_pem,omitempty"`
|
||||
KeyPem []byte `protobuf:"bytes,2,opt,name=key_pem,json=keyPem,proto3,oneof" json:"key_pem,omitempty"`
|
||||
CaPem []byte `protobuf:"bytes,3,opt,name=ca_pem,json=caPem,proto3,oneof" json:"ca_pem,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CertPem []byte `protobuf:"bytes,1,opt,name=cert_pem,json=certPem,proto3,oneof" json:"cert_pem,omitempty"`
|
||||
KeyPem []byte `protobuf:"bytes,2,opt,name=key_pem,json=keyPem,proto3,oneof" json:"key_pem,omitempty"`
|
||||
CaPem []byte `protobuf:"bytes,3,opt,name=ca_pem,json=caPem,proto3,oneof" json:"ca_pem,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TLS_Config) Reset() {
|
||||
*x = TLS_Config{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TLS_Config) String() string {
|
||||
@@ -173,7 +166,7 @@ func (*TLS_Config) ProtoMessage() {}
|
||||
|
||||
func (x *TLS_Config) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_tls_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -211,7 +204,7 @@ func (x *TLS_Config) GetCaPem() []byte {
|
||||
|
||||
var File_conf_v1_kratos_conf_tls_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_tls_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_tls_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x74, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0xbc, 0x03, 0x0a, 0x03, 0x54, 0x4c, 0x53, 0x12, 0x27, 0x0a,
|
||||
@@ -252,22 +245,22 @@ var file_conf_v1_kratos_conf_tls_proto_rawDesc = []byte{
|
||||
0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescData = file_conf_v1_kratos_conf_tls_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_tls_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_tls_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_tls_proto_rawDesc), len(file_conf_v1_kratos_conf_tls_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_tls_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_tls_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_conf_v1_kratos_conf_tls_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_tls_proto_goTypes = []any{
|
||||
(*TLS)(nil), // 0: conf.TLS
|
||||
(*TLS_File)(nil), // 1: conf.TLS.File
|
||||
(*TLS_Config)(nil), // 2: conf.TLS.Config
|
||||
@@ -287,52 +280,14 @@ func file_conf_v1_kratos_conf_tls_proto_init() {
|
||||
if File_conf_v1_kratos_conf_tls_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TLS); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TLS_File); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TLS_Config); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[1].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[2].OneofWrappers = []interface{}{}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[1].OneofWrappers = []any{}
|
||||
file_conf_v1_kratos_conf_tls_proto_msgTypes[2].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_conf_v1_kratos_conf_tls_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_tls_proto_rawDesc), len(file_conf_v1_kratos_conf_tls_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
@@ -343,7 +298,6 @@ func file_conf_v1_kratos_conf_tls_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_tls_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_tls_proto = out.File
|
||||
file_conf_v1_kratos_conf_tls_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_tls_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_tls_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: conf/v1/kratos_conf_tracer.proto
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -22,24 +23,21 @@ const (
|
||||
|
||||
// 链路追踪
|
||||
type Tracer struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Batcher string `protobuf:"bytes,1,opt,name=batcher,proto3" json:"batcher,omitempty"` // jaeger或者zipkin
|
||||
Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口
|
||||
Sampler float64 `protobuf:"fixed64,3,opt,name=sampler,proto3" json:"sampler,omitempty"` // 采样率,默认:1.0
|
||||
Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` // 运行环境:dev、debug、product
|
||||
Insecure bool `protobuf:"varint,5,opt,name=insecure,proto3" json:"insecure,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Batcher string `protobuf:"bytes,1,opt,name=batcher,proto3" json:"batcher,omitempty"` // jaeger或者zipkin
|
||||
Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // 端口
|
||||
Sampler float64 `protobuf:"fixed64,3,opt,name=sampler,proto3" json:"sampler,omitempty"` // 采样率,默认:1.0
|
||||
Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` // 运行环境:dev、debug、product
|
||||
Insecure bool `protobuf:"varint,5,opt,name=insecure,proto3" json:"insecure,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Tracer) Reset() {
|
||||
*x = Tracer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_conf_v1_kratos_conf_tracer_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_conf_v1_kratos_conf_tracer_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Tracer) String() string {
|
||||
@@ -50,7 +48,7 @@ func (*Tracer) ProtoMessage() {}
|
||||
|
||||
func (x *Tracer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_conf_v1_kratos_conf_tracer_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -102,7 +100,7 @@ func (x *Tracer) GetInsecure() bool {
|
||||
|
||||
var File_conf_v1_kratos_conf_tracer_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_conf_v1_kratos_conf_tracer_proto_rawDesc = []byte{
|
||||
var file_conf_v1_kratos_conf_tracer_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73,
|
||||
0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x54, 0x72, 0x61,
|
||||
@@ -124,22 +122,22 @@ var file_conf_v1_kratos_conf_tracer_proto_rawDesc = []byte{
|
||||
0x66, 0xe2, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
})
|
||||
|
||||
var (
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescOnce sync.Once
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescData = file_conf_v1_kratos_conf_tracer_proto_rawDesc
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_conf_v1_kratos_conf_tracer_proto_rawDescGZIP() []byte {
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescOnce.Do(func() {
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescData = protoimpl.X.CompressGZIP(file_conf_v1_kratos_conf_tracer_proto_rawDescData)
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_tracer_proto_rawDesc), len(file_conf_v1_kratos_conf_tracer_proto_rawDesc)))
|
||||
})
|
||||
return file_conf_v1_kratos_conf_tracer_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_conf_v1_kratos_conf_tracer_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_conf_v1_kratos_conf_tracer_proto_goTypes = []interface{}{
|
||||
var file_conf_v1_kratos_conf_tracer_proto_goTypes = []any{
|
||||
(*Tracer)(nil), // 0: conf.Tracer
|
||||
}
|
||||
var file_conf_v1_kratos_conf_tracer_proto_depIdxs = []int32{
|
||||
@@ -155,25 +153,11 @@ func file_conf_v1_kratos_conf_tracer_proto_init() {
|
||||
if File_conf_v1_kratos_conf_tracer_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_conf_v1_kratos_conf_tracer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Tracer); 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_kratos_conf_tracer_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_v1_kratos_conf_tracer_proto_rawDesc), len(file_conf_v1_kratos_conf_tracer_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
@@ -184,7 +168,6 @@ func file_conf_v1_kratos_conf_tracer_proto_init() {
|
||||
MessageInfos: file_conf_v1_kratos_conf_tracer_proto_msgTypes,
|
||||
}.Build()
|
||||
File_conf_v1_kratos_conf_tracer_proto = out.File
|
||||
file_conf_v1_kratos_conf_tracer_proto_rawDesc = nil
|
||||
file_conf_v1_kratos_conf_tracer_proto_goTypes = nil
|
||||
file_conf_v1_kratos_conf_tracer_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc (unknown)
|
||||
// source: pagination/v1/pagination.proto
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
_ "github.com/google/gnostic/openapiv3"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,33 +25,31 @@ const (
|
||||
|
||||
// 分页通用请求
|
||||
type PagingRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// 当前页码
|
||||
Page *int32 `protobuf:"varint,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
|
||||
// 每页的行数
|
||||
// 每一页的行数
|
||||
PageSize *int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3,oneof" json:"page_size,omitempty"`
|
||||
// 与过滤参数
|
||||
// AND过滤参数,其语法为json格式的字符串,如:{"key1":"val1","key2":"val2"},具体请参见:https://github.com/tx7do/go-utils/tree/main/entgo/query/README.md
|
||||
Query *string `protobuf:"bytes,3,opt,name=query,proto3,oneof" json:"query,omitempty"`
|
||||
// 或过滤参数
|
||||
// OR过滤参数,语法同AND过滤参数。
|
||||
OrQuery *string `protobuf:"bytes,4,opt,name=or_query,json=or,proto3,oneof" json:"or_query,omitempty"`
|
||||
// 排序条件
|
||||
// 排序条件,其语法为JSON字符串,例如:{"val1", "-val2"}。字段名前加'-'为降序,否则为升序。
|
||||
OrderBy []string `protobuf:"bytes,5,rep,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
|
||||
// 是否不分页
|
||||
NoPaging *bool `protobuf:"varint,6,opt,name=no_paging,json=nopaging,proto3,oneof" json:"no_paging,omitempty"`
|
||||
// 字段掩码
|
||||
FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"`
|
||||
// 是否不分页,如果为true,则page和pageSize参数无效。
|
||||
NoPaging *bool `protobuf:"varint,6,opt,name=no_paging,json=noPaging,proto3,oneof" json:"no_paging,omitempty"`
|
||||
// 字段掩码,其作用为SELECT中的字段,其语法为使用逗号分隔字段名,例如:id,realName,userName。如果为空则选中所有字段,即SELECT *。
|
||||
FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=field_mask,json=fieldMask,proto3,oneof" json:"field_mask,omitempty"`
|
||||
TenantId *uint32 `protobuf:"varint,8,opt,name=tenant_id,json=tenantId,proto3,oneof" json:"tenant_id,omitempty"` // 租户ID
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *PagingRequest) Reset() {
|
||||
*x = PagingRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *PagingRequest) String() string {
|
||||
@@ -62,7 +60,7 @@ func (*PagingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *PagingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -126,25 +124,29 @@ func (x *PagingRequest) GetFieldMask() *fieldmaskpb.FieldMask {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PagingRequest) GetTenantId() uint32 {
|
||||
if x != nil && x.TenantId != nil {
|
||||
return *x.TenantId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 分页通用结果
|
||||
type PagingResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// 总数
|
||||
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
||||
// 分页数据
|
||||
Items []*anypb.Any `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
|
||||
Items [][]byte `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *PagingResponse) Reset() {
|
||||
*x = PagingResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *PagingResponse) String() string {
|
||||
@@ -155,7 +157,7 @@ func (*PagingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *PagingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pagination_v1_pagination_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@@ -177,7 +179,7 @@ func (x *PagingResponse) GetTotal() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PagingResponse) GetItems() []*anypb.Any {
|
||||
func (x *PagingResponse) GetItems() [][]byte {
|
||||
if x != nil {
|
||||
return x.Items
|
||||
}
|
||||
@@ -186,105 +188,130 @@ func (x *PagingResponse) GetItems() []*anypb.Any {
|
||||
|
||||
var File_pagination_v1_pagination_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pagination_v1_pagination_proto_rawDesc = []byte{
|
||||
var file_pagination_v1_pagination_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x1e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e,
|
||||
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,
|
||||
0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x67, 0x6e, 0x6f, 0x73, 0x74,
|
||||
0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0xb1, 0x05, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42,
|
||||
0x1e, 0xba, 0x47, 0x1b, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f,
|
||||
0x92, 0x02, 0x0c, 0xe5, 0xbd, 0x93, 0xe5, 0x89, 0x8d, 0xe9, 0xa1, 0xb5, 0xe7, 0xa0, 0x81, 0x48,
|
||||
0x00, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x70, 0x61,
|
||||
0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x24, 0xba,
|
||||
0x47, 0x21, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x92, 0x02,
|
||||
0x12, 0xe6, 0xaf, 0x8f, 0xe4, 0xb8, 0x80, 0xe9, 0xa1, 0xb5, 0xe7, 0x9a, 0x84, 0xe8, 0xa1, 0x8c,
|
||||
0xe6, 0x95, 0xb0, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88,
|
||||
0x01, 0x01, 0x12, 0x51, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x42, 0x36, 0xba, 0x47, 0x33, 0x3a, 0x1f, 0x12, 0x1d, 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31,
|
||||
0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22, 0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a,
|
||||
0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0f, 0xe4, 0xb8, 0x8e, 0xe8, 0xbf, 0x87,
|
||||
0xe6, 0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0x48, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65,
|
||||
0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x08, 0x6f, 0x72, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xba, 0x47, 0x33, 0x3a, 0x1f, 0x12, 0x1d,
|
||||
0x12, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24,
|
||||
0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x76, 0x33, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x09, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x42, 0x1e, 0xba, 0x47, 0x1b, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xf0, 0x3f, 0x92, 0x02, 0x0c, 0xe5, 0xbd, 0x93, 0xe5, 0x89, 0x8d, 0xe9, 0xa1,
|
||||
0xb5, 0xe7, 0xa0, 0x81, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12,
|
||||
0x46, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x42, 0x24, 0xba, 0x47, 0x21, 0x8a, 0x02, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x24, 0x40, 0x92, 0x02, 0x12, 0xe6, 0xaf, 0x8f, 0xe4, 0xb8, 0x80, 0xe9, 0xa1, 0xb5, 0xe7,
|
||||
0x9a, 0x84, 0xe8, 0xa1, 0x8c, 0xe6, 0x95, 0xb0, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
|
||||
0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0xf5, 0x01, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0xd9, 0x01, 0xba, 0x47, 0xd5, 0x01, 0x3a, 0x1f,
|
||||
0x12, 0x1d, 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22,
|
||||
0x2c, 0x22, 0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92,
|
||||
0x02, 0xb0, 0x01, 0x41, 0x4e, 0x44, 0xe8, 0xbf, 0x87, 0xe6, 0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6,
|
||||
0x95, 0xb0, 0xef, 0xbc, 0x8c, 0xe5, 0x85, 0xb6, 0xe8, 0xaf, 0xad, 0xe6, 0xb3, 0x95, 0xe4, 0xb8,
|
||||
0xba, 0x6a, 0x73, 0x6f, 0x6e, 0xe6, 0xa0, 0xbc, 0xe5, 0xbc, 0x8f, 0xe7, 0x9a, 0x84, 0xe5, 0xad,
|
||||
0x97, 0xe7, 0xac, 0xa6, 0xe4, 0xb8, 0xb2, 0xef, 0xbc, 0x8c, 0xe5, 0xa6, 0x82, 0xef, 0xbc, 0x9a,
|
||||
0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22,
|
||||
0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0f,
|
||||
0xe6, 0x88, 0x96, 0xe8, 0xbf, 0x87, 0xe6, 0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0x48,
|
||||
0x03, 0x52, 0x02, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x75, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65,
|
||||
0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x5a, 0xba, 0x47, 0x57, 0x3a,
|
||||
0x13, 0x12, 0x11, 0x7b, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x2d, 0x76, 0x61,
|
||||
0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x3f, 0xe6, 0x8e, 0x92, 0xe5, 0xba, 0x8f, 0xe6, 0x9d, 0xa1,
|
||||
0xe4, 0xbb, 0xb6, 0xef, 0xbc, 0x8c, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe5, 0x90, 0x8d, 0xe5,
|
||||
0x89, 0x8d, 0xe5, 0x8a, 0xa0, 0x27, 0x2d, 0x27, 0xe4, 0xb8, 0xba, 0xe9, 0x99, 0x8d, 0xe5, 0xba,
|
||||
0x8f, 0xef, 0xbc, 0x8c, 0xe5, 0x90, 0xa6, 0xe5, 0x88, 0x99, 0xe4, 0xb8, 0xba, 0xe5, 0x8d, 0x87,
|
||||
0xe5, 0xba, 0x8f, 0xe3, 0x80, 0x82, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12,
|
||||
0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x08, 0x42, 0x15, 0xba, 0x47, 0x12, 0x92, 0x02, 0x0f, 0xe6, 0x98, 0xaf, 0xe5, 0x90, 0xa6,
|
||||
0xe4, 0xb8, 0x8d, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0x48, 0x04, 0x52, 0x08, 0x6e, 0x6f, 0x70,
|
||||
0x61, 0x67, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x8c, 0x01, 0x0a, 0x0a, 0x66, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x51, 0xba, 0x47, 0x4e, 0x3a, 0x16,
|
||||
0x12, 0x14, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x75, 0x73,
|
||||
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x92, 0x02, 0x33, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe6,
|
||||
0x8e, 0xa9, 0xe7, 0xa0, 0x81, 0xef, 0xbc, 0x8c, 0xe5, 0xa6, 0x82, 0xe6, 0x9e, 0x9c, 0xe4, 0xb8,
|
||||
0xba, 0xe7, 0xa9, 0xba, 0xe5, 0x88, 0x99, 0xe9, 0x80, 0x89, 0xe4, 0xb8, 0xad, 0xe6, 0x89, 0x80,
|
||||
0xe6, 0x9c, 0x89, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe3, 0x80, 0x82, 0x52, 0x09, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x67, 0x65,
|
||||
0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x08,
|
||||
0x0a, 0x06, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6f, 0x72, 0x5f,
|
||||
0x71, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67,
|
||||
0x69, 0x6e, 0x67, 0x22, 0x52, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x69,
|
||||
0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79,
|
||||
0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x42, 0xa5, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x50, 0x61, 0x67, 0x69,
|
||||
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f,
|
||||
0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x61, 0x67, 0x69,
|
||||
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa,
|
||||
0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0a, 0x50,
|
||||
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x16, 0x50, 0x61, 0x67, 0x69,
|
||||
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||
0x74, 0x61, 0xea, 0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0xef, 0xbc, 0x8c,
|
||||
0xe5, 0x85, 0xb7, 0xe4, 0xbd, 0x93, 0xe8, 0xaf, 0xb7, 0xe5, 0x8f, 0x82, 0xe8, 0xa7, 0x81, 0xef,
|
||||
0xbc, 0x9a, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37, 0x64, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x75, 0x74,
|
||||
0x69, 0x6c, 0x73, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x65, 0x6e,
|
||||
0x74, 0x67, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x52, 0x45, 0x41, 0x44, 0x4d, 0x45,
|
||||
0x2e, 0x6d, 0x64, 0x48, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12,
|
||||
0x50, 0x0a, 0x08, 0x6f, 0x72, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x09, 0x42, 0x35, 0xba, 0x47, 0x32, 0x3a, 0x1f, 0x12, 0x1d, 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x31,
|
||||
0x22, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x22, 0x6b, 0x65, 0x79, 0x32, 0x22, 0x3a,
|
||||
0x22, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0x92, 0x02, 0x0e, 0x4f, 0x52, 0xe8, 0xbf, 0x87, 0xe6,
|
||||
0xbb, 0xa4, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0x48, 0x03, 0x52, 0x02, 0x6f, 0x72, 0x88, 0x01,
|
||||
0x01, 0x12, 0xb0, 0x01, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05,
|
||||
0x20, 0x03, 0x28, 0x09, 0x42, 0x94, 0x01, 0xba, 0x47, 0x90, 0x01, 0x3a, 0x13, 0x12, 0x11, 0x7b,
|
||||
0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x2d, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d,
|
||||
0x92, 0x02, 0x78, 0xe6, 0x8e, 0x92, 0xe5, 0xba, 0x8f, 0xe6, 0x9d, 0xa1, 0xe4, 0xbb, 0xb6, 0xef,
|
||||
0xbc, 0x8c, 0xe5, 0x85, 0xb6, 0xe8, 0xaf, 0xad, 0xe6, 0xb3, 0x95, 0xe4, 0xb8, 0xba, 0x4a, 0x53,
|
||||
0x4f, 0x4e, 0xe5, 0xad, 0x97, 0xe7, 0xac, 0xa6, 0xe4, 0xb8, 0xb2, 0xef, 0xbc, 0x8c, 0xe4, 0xbe,
|
||||
0x8b, 0xe5, 0xa6, 0x82, 0xef, 0xbc, 0x9a, 0x7b, 0x22, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20,
|
||||
0x22, 0x2d, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x7d, 0xe3, 0x80, 0x82, 0xe5, 0xad, 0x97, 0xe6, 0xae,
|
||||
0xb5, 0xe5, 0x90, 0x8d, 0xe5, 0x89, 0x8d, 0xe5, 0x8a, 0xa0, 0x27, 0x2d, 0x27, 0xe4, 0xb8, 0xba,
|
||||
0xe9, 0x99, 0x8d, 0xe5, 0xba, 0x8f, 0xef, 0xbc, 0x8c, 0xe5, 0x90, 0xa6, 0xe5, 0x88, 0x99, 0xe4,
|
||||
0xb8, 0xba, 0xe5, 0x8d, 0x87, 0xe5, 0xba, 0x8f, 0xe3, 0x80, 0x82, 0x52, 0x07, 0x6f, 0x72, 0x64,
|
||||
0x65, 0x72, 0x42, 0x79, 0x12, 0x6b, 0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67, 0x69, 0x6e,
|
||||
0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x49, 0xba, 0x47, 0x46, 0x92, 0x02, 0x43, 0xe6,
|
||||
0x98, 0xaf, 0xe5, 0x90, 0xa6, 0xe4, 0xb8, 0x8d, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xef, 0xbc,
|
||||
0x8c, 0xe5, 0xa6, 0x82, 0xe6, 0x9e, 0x9c, 0xe4, 0xb8, 0xba, 0x74, 0x72, 0x75, 0x65, 0xef, 0xbc,
|
||||
0x8c, 0xe5, 0x88, 0x99, 0x70, 0x61, 0x67, 0x65, 0xe5, 0x92, 0x8c, 0x70, 0x61, 0x67, 0x65, 0x53,
|
||||
0x69, 0x7a, 0x65, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0xe6, 0x97, 0xa0, 0xe6, 0x95, 0x88, 0xe3,
|
||||
0x80, 0x82, 0x48, 0x04, 0x52, 0x08, 0x6e, 0x6f, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x88, 0x01,
|
||||
0x01, 0x12, 0x8d, 0x02, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61,
|
||||
0x73, 0x6b, 0x42, 0xcc, 0x01, 0xba, 0x47, 0xc8, 0x01, 0x3a, 0x16, 0x12, 0x14, 0x69, 0x64, 0x2c,
|
||||
0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x92, 0x02, 0xac, 0x01, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe6, 0x8e, 0xa9, 0xe7, 0xa0,
|
||||
0x81, 0xef, 0xbc, 0x8c, 0xe5, 0x85, 0xb6, 0xe4, 0xbd, 0x9c, 0xe7, 0x94, 0xa8, 0xe4, 0xb8, 0xba,
|
||||
0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0xe4, 0xb8, 0xad, 0xe7, 0x9a, 0x84, 0xe5, 0xad, 0x97, 0xe6,
|
||||
0xae, 0xb5, 0xef, 0xbc, 0x8c, 0xe5, 0x85, 0xb6, 0xe8, 0xaf, 0xad, 0xe6, 0xb3, 0x95, 0xe4, 0xb8,
|
||||
0xba, 0xe4, 0xbd, 0xbf, 0xe7, 0x94, 0xa8, 0xe9, 0x80, 0x97, 0xe5, 0x8f, 0xb7, 0xe5, 0x88, 0x86,
|
||||
0xe9, 0x9a, 0x94, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5, 0xe5, 0x90, 0x8d, 0xef, 0xbc, 0x8c, 0xe4,
|
||||
0xbe, 0x8b, 0xe5, 0xa6, 0x82, 0xef, 0xbc, 0x9a, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x6c, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x2c, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0xe3, 0x80, 0x82, 0xe5,
|
||||
0xa6, 0x82, 0xe6, 0x9e, 0x9c, 0xe4, 0xb8, 0xba, 0xe7, 0xa9, 0xba, 0xe5, 0x88, 0x99, 0xe9, 0x80,
|
||||
0x89, 0xe4, 0xb8, 0xad, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe5, 0xad, 0x97, 0xe6, 0xae, 0xb5,
|
||||
0xef, 0xbc, 0x8c, 0xe5, 0x8d, 0xb3, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x20, 0x2a, 0xe3, 0x80,
|
||||
0x82, 0x48, 0x05, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01,
|
||||
0x01, 0x12, 0x30, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x42, 0x0e, 0xba, 0x47, 0x0b, 0x92, 0x02, 0x08, 0xe7, 0xa7, 0x9f, 0xe6,
|
||||
0x88, 0xb7, 0x49, 0x44, 0x48, 0x06, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64,
|
||||
0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x42, 0x0c, 0x0a, 0x0a,
|
||||
0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x71,
|
||||
0x75, 0x65, 0x72, 0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6f, 0x72, 0x5f, 0x71, 0x75, 0x65, 0x72,
|
||||
0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x42,
|
||||
0x0d, 0x0a, 0x0b, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x42, 0x0c,
|
||||
0x0a, 0x0a, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x3c, 0x0a, 0x0e,
|
||||
0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74,
|
||||
0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x42, 0xa5, 0x01, 0x0a, 0x0e, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x50,
|
||||
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x78, 0x37,
|
||||
0x64, 0x6f, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
|
||||
0x72, 0x61, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70,
|
||||
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50,
|
||||
0x58, 0x58, 0xaa, 0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca,
|
||||
0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x16, 0x50,
|
||||
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
|
||||
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_pagination_v1_pagination_proto_rawDescOnce sync.Once
|
||||
file_pagination_v1_pagination_proto_rawDescData = file_pagination_v1_pagination_proto_rawDesc
|
||||
file_pagination_v1_pagination_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_pagination_v1_pagination_proto_rawDescGZIP() []byte {
|
||||
file_pagination_v1_pagination_proto_rawDescOnce.Do(func() {
|
||||
file_pagination_v1_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagination_v1_pagination_proto_rawDescData)
|
||||
file_pagination_v1_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pagination_v1_pagination_proto_rawDesc), len(file_pagination_v1_pagination_proto_rawDesc)))
|
||||
})
|
||||
return file_pagination_v1_pagination_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pagination_v1_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_pagination_v1_pagination_proto_goTypes = []interface{}{
|
||||
var file_pagination_v1_pagination_proto_goTypes = []any{
|
||||
(*PagingRequest)(nil), // 0: pagination.PagingRequest
|
||||
(*PagingResponse)(nil), // 1: pagination.PagingResponse
|
||||
(*fieldmaskpb.FieldMask)(nil), // 2: google.protobuf.FieldMask
|
||||
(*anypb.Any)(nil), // 3: google.protobuf.Any
|
||||
}
|
||||
var file_pagination_v1_pagination_proto_depIdxs = []int32{
|
||||
2, // 0: pagination.PagingRequest.field_mask:type_name -> google.protobuf.FieldMask
|
||||
3, // 1: pagination.PagingResponse.items:type_name -> google.protobuf.Any
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
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_pagination_v1_pagination_proto_init() }
|
||||
@@ -292,38 +319,12 @@ func file_pagination_v1_pagination_proto_init() {
|
||||
if File_pagination_v1_pagination_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pagination_v1_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PagingRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pagination_v1_pagination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PagingResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_pagination_v1_pagination_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
file_pagination_v1_pagination_proto_msgTypes[0].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pagination_v1_pagination_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_pagination_v1_pagination_proto_rawDesc), len(file_pagination_v1_pagination_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
@@ -334,7 +335,6 @@ func file_pagination_v1_pagination_proto_init() {
|
||||
MessageInfos: file_pagination_v1_pagination_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pagination_v1_pagination_proto = out.File
|
||||
file_pagination_v1_pagination_proto_rawDesc = nil
|
||||
file_pagination_v1_pagination_proto_goTypes = nil
|
||||
file_pagination_v1_pagination_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ toolchain go1.22.1
|
||||
|
||||
require (
|
||||
github.com/google/gnostic v0.7.0
|
||||
google.golang.org/protobuf v1.35.1
|
||||
google.golang.org/protobuf v1.36.6
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||
github.com/google/gnostic-models v0.6.9 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/rogpeppe/go-internal v1.10.0 // indirect
|
||||
|
||||
@@ -707,8 +707,9 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
|
||||
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/gnostic v0.7.0 h1:d7EpuFp8vVdML+y0JJJYiKeOLjKTdH/GvVkLOBWqJpw=
|
||||
github.com/google/gnostic v0.7.0/go.mod h1:IAcUyMl6vtC95f60EZ8oXyqTsOersP6HbwjeG7EyDPM=
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU=
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M=
|
||||
github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw=
|
||||
github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
@@ -1462,8 +1463,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
|
||||
32
api/protos/conf/v1/kratos_conf_authn.proto
Normal file
32
api/protos/conf/v1/kratos_conf_authn.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package conf;
|
||||
|
||||
option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
// 认证
|
||||
message Authentication {
|
||||
// JWT
|
||||
message Jwt {
|
||||
string method = 1; // JWT签名的算法,支持算法:HS256
|
||||
string key = 2; // JWT 秘钥
|
||||
}
|
||||
|
||||
message OIDC {
|
||||
string issuer_url = 1;
|
||||
string audience = 2;
|
||||
string method = 3; // JWT签名的算法,支持算法:HS256
|
||||
}
|
||||
|
||||
message PresharedKey {
|
||||
repeated string valid_keys = 1;
|
||||
}
|
||||
|
||||
string type = 1;
|
||||
|
||||
optional Jwt jwt = 2; // JWT 认证
|
||||
optional OIDC oidc = 3; // OIDC
|
||||
optional PresharedKey preshared_key = 4; // 预共享密钥
|
||||
}
|
||||
53
api/protos/conf/v1/kratos_conf_authz.proto
Normal file
53
api/protos/conf/v1/kratos_conf_authz.proto
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package conf;
|
||||
|
||||
option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
// 授权
|
||||
message Authorization {
|
||||
message Casbin {
|
||||
optional string model_path = 1; // casbin 模型文件路径
|
||||
optional string policy_path = 2; // casbin 策略文件路径
|
||||
|
||||
repeated string policies = 10; // 策略列表
|
||||
optional string model = 11; // 模型内容
|
||||
}
|
||||
|
||||
message OPA {
|
||||
message RoleActions {
|
||||
repeated string actions = 1; // 角色对应的操作列表 {
|
||||
}
|
||||
|
||||
map<string, string> policies = 1; // OPA 策略列表
|
||||
map<string, RoleActions> roles = 2; //
|
||||
}
|
||||
|
||||
message Zanzibar {
|
||||
message Keto {
|
||||
string write_url = 1; // 写入 URL
|
||||
string read_url = 2; // 读取 URL
|
||||
bool use_grpc = 3; // 是否使用 gRPC
|
||||
}
|
||||
|
||||
message OpenFga {
|
||||
string api_url = 1; // OpenFGA API URL
|
||||
string store_id = 2; // OpenFGA 存储 ID
|
||||
string token = 3; // OpenFGA 访问令牌
|
||||
string client_id = 4; // OpenFGA 客户端 ID
|
||||
}
|
||||
|
||||
string type = 1; // zanzibar 类型
|
||||
|
||||
optional Keto keto = 2; // Keto 配置
|
||||
optional OpenFga open_fga = 3; // OpenFGA 配置
|
||||
}
|
||||
|
||||
string type = 1;
|
||||
|
||||
Casbin casbin = 2; // casbin
|
||||
OPA opa = 3; // OPA
|
||||
Zanzibar zanzibar = 4; // zanzibar
|
||||
}
|
||||
@@ -13,16 +13,20 @@ import "conf/v1/kratos_conf_registry.proto";
|
||||
import "conf/v1/kratos_conf_oss.proto";
|
||||
import "conf/v1/kratos_conf_config.proto";
|
||||
import "conf/v1/kratos_conf_notify.proto";
|
||||
import "conf/v1/kratos_conf_authn.proto";
|
||||
import "conf/v1/kratos_conf_authz.proto";
|
||||
|
||||
// 引导信息
|
||||
message Bootstrap {
|
||||
Server server = 1;
|
||||
Client client = 2;
|
||||
Data data = 3;
|
||||
Tracer trace = 4;
|
||||
Logger logger = 5;
|
||||
Registry registry = 6;
|
||||
RemoteConfig config = 7;
|
||||
OSS oss = 8;
|
||||
Notification notify = 9;
|
||||
optional Server server = 1;
|
||||
optional Client client = 2;
|
||||
optional Data data = 3;
|
||||
optional Tracer trace = 4;
|
||||
optional Logger logger = 5;
|
||||
optional Registry registry = 6;
|
||||
optional RemoteConfig config = 7;
|
||||
optional OSS oss = 8;
|
||||
optional Notification notify = 9;
|
||||
optional Authentication authn = 10;
|
||||
optional Authorization authz = 11;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,13 @@ message Data {
|
||||
bool enable_trace = 12; // 链路追踪开关
|
||||
bool enable_metrics = 13; // 性能分析开关
|
||||
|
||||
int32 max_idle_connections = 20; // 连接池最大空闲连接数
|
||||
int32 max_open_connections = 21; // 连接池最大打开连接数
|
||||
google.protobuf.Duration connection_max_lifetime = 22; // 连接可重用的最大时间长度
|
||||
optional int32 max_idle_connections = 20; // 连接池最大空闲连接数
|
||||
optional int32 max_open_connections = 21; // 连接池最大打开连接数
|
||||
optional google.protobuf.Duration connection_max_lifetime = 22; // 连接可重用的最大时间长度
|
||||
|
||||
optional string prometheus_push_addr = 30;
|
||||
optional string prometheus_db_name = 31;
|
||||
optional uint32 prometheus_http_port = 32;
|
||||
}
|
||||
|
||||
// redis
|
||||
|
||||
@@ -6,11 +6,18 @@ option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
// 中间件
|
||||
message Middleware {
|
||||
// JWT校验
|
||||
message Auth {
|
||||
string method = 1; // JWT签名的算法,支持算法:HS256
|
||||
string key = 2; // JWT 秘钥
|
||||
|
||||
optional google.protobuf.Duration access_token_expires = 3; // 访问令牌过期时间
|
||||
optional google.protobuf.Duration refresh_token_expires = 4; // 刷新令牌过期时间
|
||||
|
||||
optional string access_token_key_prefix = 5; // 访问令牌键前缀
|
||||
optional string refresh_token_key_prefix = 6; // 刷新令牌键前缀
|
||||
}
|
||||
|
||||
// 限流器
|
||||
@@ -26,13 +33,14 @@ message Middleware {
|
||||
bool summary = 4; // 摘要
|
||||
}
|
||||
|
||||
bool enable_logging = 1; // 日志开关
|
||||
bool enable_recovery = 2; // 异常恢复
|
||||
bool enable_tracing = 3; // 链路追踪开关
|
||||
bool enable_validate = 4; // 参数校验开关
|
||||
bool enable_circuit_breaker = 5; // 熔断器
|
||||
RateLimiter limiter = 1;
|
||||
Metrics metrics = 2;
|
||||
Auth auth = 3;
|
||||
|
||||
RateLimiter limiter = 6;
|
||||
Metrics metrics = 7;
|
||||
Auth auth = 8;
|
||||
bool enable_logging = 10; // 日志开关
|
||||
bool enable_recovery = 11; // 异常恢复
|
||||
bool enable_tracing = 12; // 链路追踪开关
|
||||
bool enable_validate = 13; // 参数校验开关
|
||||
bool enable_circuit_breaker = 14; // 熔断器
|
||||
bool enable_metadata = 15; // 元数据
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ message Notification {
|
||||
string access_key_secret = 4; // 访问密钥
|
||||
}
|
||||
|
||||
SMS sms = 1;
|
||||
optional SMS sms = 1;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
|
||||
|
||||
import "conf/v1/kratos_conf_tls.proto";
|
||||
|
||||
// 对象存储
|
||||
message OSS {
|
||||
// MinIO
|
||||
message MinIO {
|
||||
@@ -21,5 +22,5 @@ message OSS {
|
||||
string download_host = 21; // 下载链接的主机名
|
||||
}
|
||||
|
||||
MinIO minio = 1;
|
||||
optional MinIO minio = 1;
|
||||
}
|
||||
|
||||
@@ -31,19 +31,33 @@ message Registry {
|
||||
string address = 1; // 服务端地址
|
||||
uint64 port = 2; // 服务端端口
|
||||
|
||||
string namespace_id = 3; //
|
||||
string namespace_id = 3; // 命名空间ID
|
||||
string region_id = 4; // 区域ID
|
||||
|
||||
string log_level = 4; // 日志等级
|
||||
string cache_dir = 5; // 缓存目录
|
||||
string log_dir = 6; // 日志目录
|
||||
string app_name = 5; // 应用名称
|
||||
string app_key = 6; // 应用密钥
|
||||
|
||||
int32 update_thread_num = 7; // 更新服务的线程数
|
||||
string access_key = 7; // 访问密钥
|
||||
string secret_key = 8; // 密钥
|
||||
|
||||
google.protobuf.Duration timeout = 8; // http请求超时时间,单位: 毫秒
|
||||
google.protobuf.Duration beat_interval = 9; // 心跳间隔时间,单位: 毫秒
|
||||
string username = 9; // 用户名
|
||||
string password = 10; // 密码
|
||||
|
||||
bool not_load_cache_at_start = 10; // 在启动时不读取本地缓存数据,true: 不读取,false: 读取
|
||||
bool update_cache_when_empty = 11; // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新
|
||||
google.protobuf.Duration timeout = 20; // http请求超时时间,单位: 毫秒
|
||||
google.protobuf.Duration beat_interval = 21; // 心跳间隔时间,单位: 毫秒
|
||||
google.protobuf.Duration listen_interval = 22; // 心跳间隔时间,单位: 毫秒
|
||||
|
||||
int32 update_thread_num = 30; // 更新服务的线程数
|
||||
|
||||
bool not_load_cache_at_start = 40; // 在启动时不读取本地缓存数据,true: 不读取,false: 读取
|
||||
bool update_cache_when_empty = 41; // 当服务列表为空时是否更新本地缓存,true: 更新,false: 不更新
|
||||
bool open_kms = 42; // 是否开启kms加密,true: 开启,false: 关闭
|
||||
|
||||
string log_level = 50; // 日志等级
|
||||
string log_dir = 51; // 日志目录
|
||||
|
||||
string cache_dir = 52; // 缓存目录
|
||||
string context_path = 53; // 上下文路径
|
||||
}
|
||||
|
||||
// Kubernetes
|
||||
@@ -76,12 +90,12 @@ message Registry {
|
||||
|
||||
string type = 1;
|
||||
|
||||
Consul consul = 2; // Consul
|
||||
Etcd etcd = 3; // Etcd
|
||||
ZooKeeper zookeeper = 4; // ZooKeeper
|
||||
Nacos nacos = 5; // Nacos
|
||||
Kubernetes kubernetes = 6; // Kubernetes
|
||||
Eureka eureka = 7; // Eureka
|
||||
Polaris polaris = 8; // Polaris
|
||||
Servicecomb servicecomb = 9; // Servicecomb
|
||||
optional Consul consul = 2; // Consul
|
||||
optional Etcd etcd = 3; // Etcd
|
||||
optional ZooKeeper zookeeper = 4; // ZooKeeper
|
||||
optional Nacos nacos = 5; // Nacos
|
||||
optional Kubernetes kubernetes = 6; // Kubernetes
|
||||
optional Eureka eureka = 7; // Eureka
|
||||
optional Polaris polaris = 8; // Polaris
|
||||
optional Servicecomb servicecomb = 9; // Servicecomb
|
||||
}
|
||||
|
||||
@@ -58,6 +58,10 @@ message Server {
|
||||
string endpoint = 1; // 对端网络地址
|
||||
string codec = 2; // 编解码器: json,xml,yaml...
|
||||
TLS tls = 3; // TLS配置
|
||||
string username = 4; // 用户名
|
||||
string password = 5; // 密码
|
||||
string client_id = 6; // 客户端ID
|
||||
bool clean_session = 7; // 清除会话
|
||||
}
|
||||
|
||||
// Kafka
|
||||
@@ -108,36 +112,124 @@ message Server {
|
||||
string version = 1; // 驱动版本:aliyun、v2、v5
|
||||
string codec = 2; // 编解码器: json,xml,yaml...
|
||||
|
||||
bool enable_trace = 3;
|
||||
repeated string name_servers = 3;
|
||||
string name_server_domain = 4;
|
||||
|
||||
repeated string name_servers = 4;
|
||||
string name_server_domain = 5;
|
||||
string access_key = 5;
|
||||
string secret_key = 6;
|
||||
string security_token = 7;
|
||||
|
||||
string access_key = 6;
|
||||
string secret_key = 7;
|
||||
string security_token = 8;
|
||||
string namespace = 8;
|
||||
string instance_name = 9;
|
||||
string group_name = 10;
|
||||
|
||||
string namespace = 9;
|
||||
string instance_name = 10;
|
||||
string group_name = 11;
|
||||
TLS tls = 11; // TLS配置
|
||||
|
||||
TLS tls = 12; // TLS配置
|
||||
bool enable_trace = 100;
|
||||
}
|
||||
|
||||
// Asynq
|
||||
message Asynq {
|
||||
string endpoint = 1; // 对端网络地址
|
||||
string password = 2; // redis登录密码
|
||||
int32 db = 3; // 数据库索引
|
||||
string location = 4; // 时区
|
||||
TLS tls = 5; // TLS配置
|
||||
string network = 1; // Redis对端网络地址
|
||||
string endpoint = 2; // Redis对端网络地址
|
||||
string password = 3; // Redis登录密码
|
||||
int32 db = 4; // Redis数据库索引
|
||||
string uri = 5; // Redis URI
|
||||
int32 pool_size = 6; // Redis连接池大小
|
||||
|
||||
TLS tls = 7; // TLS配置
|
||||
string codec = 8; // 编解码器: json,xml,yaml...
|
||||
|
||||
string location = 10; // 时区
|
||||
int32 concurrency = 11; // 并发数
|
||||
int32 group_max_size = 12; // 组最大大小
|
||||
map<string, int32> queues = 13; // 队列
|
||||
|
||||
bool enable_gracefully_shutdown = 20; // 优雅关闭
|
||||
bool enable_strict_priority = 21; // 严格优先级
|
||||
|
||||
google.protobuf.Duration shutdown_timeout = 30; // 关闭超时时间
|
||||
google.protobuf.Duration dial_timeout = 31; // 拨号超时时间
|
||||
google.protobuf.Duration read_timeout = 32; // 读取超时时间
|
||||
google.protobuf.Duration write_timeout = 33; // 写入超时时间
|
||||
|
||||
google.protobuf.Duration health_check_interval = 34; // 健康检查时间间隔
|
||||
google.protobuf.Duration delayed_task_check_interval = 35; // 延迟任务检查时间间隔
|
||||
google.protobuf.Duration group_grace_period = 36; // 组宽限期
|
||||
google.protobuf.Duration group_max_delay = 37; // 组最大延迟
|
||||
}
|
||||
|
||||
// Machinery
|
||||
message Machinery {
|
||||
repeated string brokers = 1; // broker的地址,可以根据实际使用的存储介质,分别指定Redis、AMQP或AWS SQS;
|
||||
repeated string backends = 2; // backend配置,用来指定存放结果的介质的配置。可以根据需求,分别指定为:Redis、memcached或mongodb等;
|
||||
TLS tls = 3; // TLS配置
|
||||
string broker_type = 1; // broker类型,可以根据实际使用的存储介质,分别指定Redis、AMQP或AWS SQS;
|
||||
string broker_addr = 2; // broker的地址
|
||||
int32 broker_db = 3; // broker的数据库索引
|
||||
|
||||
string backend_type = 10; // backend类型,可以分别指定为:redis、memcached或mongodb等;
|
||||
string backend_addr = 11; // backend的地址
|
||||
int32 backend_db = 12; // backend的数据库索引
|
||||
|
||||
string lock_type = 20; // lock类型,可以分别指定为:redis、memcached或mongodb等;
|
||||
string lock_addr = 21; // lock的地址
|
||||
int32 lock_db = 22; // lock的数据库索引
|
||||
|
||||
string consumer_tag = 30; // 消费者标签
|
||||
int32 consumer_concurrency = 31; // 消费者并发数
|
||||
string consumer_queue = 32; // 消费者队列
|
||||
|
||||
TLS tls = 50; // TLS配置
|
||||
string default_queue = 51; // 默认队列
|
||||
int32 results_expire_in = 52; // 结果过期时间
|
||||
bool no_unix_signals = 53; // 禁用Unix信号
|
||||
|
||||
message Redis {
|
||||
int32 max_idle = 1;
|
||||
int32 max_active = 2;
|
||||
int32 max_idle_timeout = 3;
|
||||
bool wait = 4;
|
||||
int32 read_timeout = 5;
|
||||
int32 write_timeout = 6;
|
||||
int32 connect_timeout = 7;
|
||||
int32 normal_tasks_poll_period = 8;
|
||||
int32 delayed_tasks_poll_period = 9;
|
||||
string delayed_tasks_key = 10;
|
||||
string master_name = 11;
|
||||
}
|
||||
Redis redis = 100; // Redis配置
|
||||
|
||||
message AMQP {
|
||||
string exchange = 1;
|
||||
string exchange_type = 2;
|
||||
map<string, string> queue_declare_args = 3;
|
||||
map<string, string> queue_binding_args = 4;
|
||||
string binding_key = 5;
|
||||
int32 prefetch_count = 6;
|
||||
bool auto_delete = 7;
|
||||
string delayed_queue = 8;
|
||||
}
|
||||
AMQP amqp = 101; // AMQP配置
|
||||
|
||||
message SQS {
|
||||
int32 receive_wait_time_seconds = 1;
|
||||
optional int32 receive_visibility_timeout = 2;
|
||||
}
|
||||
SQS sqs = 102; // SQS配置
|
||||
|
||||
message GCP {
|
||||
google.protobuf.Duration max_extension = 1;
|
||||
}
|
||||
GCP gcp = 103; // GCP配置
|
||||
|
||||
message MongoDB {
|
||||
string database = 1;
|
||||
}
|
||||
MongoDB mongodb = 104; // MongoDB配置
|
||||
|
||||
message DynamoDB {
|
||||
string task_states_table = 1;
|
||||
string group_metas_table = 2;
|
||||
}
|
||||
DynamoDB dynamodb = 105; // DynamoDB配置
|
||||
}
|
||||
|
||||
// SSE
|
||||
@@ -202,12 +294,19 @@ message Server {
|
||||
TLS tls = 7; // TLS配置
|
||||
}
|
||||
|
||||
message KeepAlive {
|
||||
string network = 1; // 网络
|
||||
string addr = 2; // 服务监听地址
|
||||
TLS tls = 3; // TLS配置
|
||||
}
|
||||
|
||||
// RPC
|
||||
|
||||
optional REST rest = 1; // REST服务
|
||||
optional GRPC grpc = 2; // gRPC服务
|
||||
optional GraphQL graphql = 3; // GraphQL服务
|
||||
optional Thrift thrift = 4; // Thrift服务
|
||||
optional KeepAlive keepalive = 5; // 保活服务
|
||||
|
||||
// Message Queue
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package conf;
|
||||
|
||||
option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1;conf";
|
||||
|
||||
// TLS配置
|
||||
message TLS {
|
||||
message File {
|
||||
optional string cert_path = 1;
|
||||
|
||||
@@ -2,9 +2,8 @@ syntax = "proto3";
|
||||
|
||||
package pagination;
|
||||
|
||||
option go_package = "github.com/tx7do/kratos-bootstrap/gen/api/go/pagination/v1;pagination";
|
||||
option go_package = "github.com/tx7do/kratos-bootstrap/api/gen/go/pagination/v1;pagination";
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "gnostic/openapi/v3/annotations.proto";
|
||||
|
||||
@@ -19,7 +18,7 @@ message PagingRequest {
|
||||
}
|
||||
];
|
||||
|
||||
// 每页的行数
|
||||
// 每一页的行数
|
||||
optional int32 page_size = 2 [
|
||||
json_name = "pageSize",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
@@ -28,47 +27,54 @@ message PagingRequest {
|
||||
}
|
||||
];
|
||||
|
||||
// 与过滤参数
|
||||
// AND过滤参数,其语法为json格式的字符串,如:{"key1":"val1","key2":"val2"},具体请参见:https://github.com/tx7do/go-utils/tree/main/entgo/query/README.md
|
||||
optional string query = 3 [
|
||||
json_name = "query",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
description: "与过滤参数",
|
||||
description: "AND过滤参数,其语法为json格式的字符串,如:{\"key1\":\"val1\",\"key2\":\"val2\"},具体请参见:https://github.com/tx7do/go-utils/tree/main/entgo/query/README.md",
|
||||
example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"}
|
||||
}
|
||||
];
|
||||
|
||||
// 或过滤参数
|
||||
// OR过滤参数,语法同AND过滤参数。
|
||||
optional string or_query = 4 [
|
||||
json_name = "or",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
description: "或过滤参数",
|
||||
description: "OR过滤参数",
|
||||
example: {yaml: "{\"key1\":\"val1\",\"key2\":\"val2\"}"}
|
||||
}
|
||||
];
|
||||
|
||||
// 排序条件
|
||||
// 排序条件,其语法为JSON字符串,例如:{"val1", "-val2"}。字段名前加'-'为降序,否则为升序。
|
||||
repeated string order_by = 5 [
|
||||
json_name = "orderBy",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
description: "排序条件,字段名前加'-'为降序,否则为升序。"
|
||||
description: "排序条件,其语法为JSON字符串,例如:{\"val1\", \"-val2\"}。字段名前加'-'为降序,否则为升序。"
|
||||
example: {yaml: "{\"val1\", \"-val2\"}"}
|
||||
}
|
||||
];
|
||||
|
||||
// 是否不分页
|
||||
// 是否不分页,如果为true,则page和pageSize参数无效。
|
||||
optional bool no_paging = 6 [
|
||||
json_name = "nopaging",
|
||||
(gnostic.openapi.v3.property) = {description: "是否不分页"}
|
||||
json_name = "noPaging",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
description: "是否不分页,如果为true,则page和pageSize参数无效。"
|
||||
}
|
||||
];
|
||||
|
||||
// 字段掩码
|
||||
google.protobuf.FieldMask field_mask = 7 [
|
||||
// 字段掩码,其作用为SELECT中的字段,其语法为使用逗号分隔字段名,例如:id,realName,userName。如果为空则选中所有字段,即SELECT *。
|
||||
optional google.protobuf.FieldMask field_mask = 7 [
|
||||
json_name = "fieldMask",
|
||||
(gnostic.openapi.v3.property) = {
|
||||
description: "字段掩码,如果为空则选中所有字段。",
|
||||
description: "字段掩码,其作用为SELECT中的字段,其语法为使用逗号分隔字段名,例如:id,realName,userName。如果为空则选中所有字段,即SELECT *。",
|
||||
example: {yaml : "id,realName,userName"}
|
||||
}
|
||||
];
|
||||
|
||||
optional uint32 tenant_id = 8 [
|
||||
(gnostic.openapi.v3.property) = {description: "租户ID"},
|
||||
json_name = "tenantId"
|
||||
]; // 租户ID
|
||||
}
|
||||
|
||||
// 分页通用结果
|
||||
@@ -77,5 +83,5 @@ message PagingResponse {
|
||||
int32 total = 1;
|
||||
|
||||
// 分页数据
|
||||
repeated google.protobuf.Any items = 2;
|
||||
repeated bytes items = 2;
|
||||
}
|
||||
|
||||
@@ -2,15 +2,14 @@ package bootstrap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/go-kratos/kratos/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
kratosRegistry "github.com/go-kratos/kratos/v2/registry"
|
||||
"github.com/go-kratos/kratos/v2/transport"
|
||||
|
||||
"github.com/tx7do/kratos-bootstrap/config"
|
||||
"github.com/tx7do/kratos-bootstrap/logger"
|
||||
"github.com/tx7do/kratos-bootstrap/registry"
|
||||
"github.com/tx7do/kratos-bootstrap/tracer"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
@@ -43,28 +42,28 @@ func NewApp(ll log.Logger, rr kratosRegistry.Registrar, srv ...transport.Server)
|
||||
// DoBootstrap 执行引导
|
||||
func DoBootstrap(serviceInfo *utils.ServiceInfo) (*conf.Bootstrap, log.Logger, kratosRegistry.Registrar) {
|
||||
// inject command flags
|
||||
Flags := config.NewCommandFlags()
|
||||
Flags := NewCommandFlags()
|
||||
Flags.Init()
|
||||
|
||||
var err error
|
||||
|
||||
// load configs
|
||||
if err = config.LoadBootstrapConfig(Flags.Conf); err != nil {
|
||||
if err = LoadBootstrapConfig(Flags.Conf); err != nil {
|
||||
panic(fmt.Sprintf("load config failed: %v", err))
|
||||
}
|
||||
|
||||
// init logger
|
||||
ll := logger.NewLoggerProvider(config.GetBootstrapConfig().Logger, serviceInfo)
|
||||
ll := logger.NewLoggerProvider(GetBootstrapConfig().Logger, serviceInfo)
|
||||
|
||||
// init registrar
|
||||
reg := registry.NewRegistry(config.GetBootstrapConfig().Registry)
|
||||
reg := NewRegistry(GetBootstrapConfig().Registry)
|
||||
|
||||
// init tracer
|
||||
if err = tracer.NewTracerProvider(config.GetBootstrapConfig().Trace, serviceInfo); err != nil {
|
||||
if err = tracer.NewTracerProvider(GetBootstrapConfig().Trace, serviceInfo); err != nil {
|
||||
panic(fmt.Sprintf("init tracer failed: %v", err))
|
||||
}
|
||||
|
||||
return config.GetBootstrapConfig(), ll, reg
|
||||
return GetBootstrapConfig(), ll, reg
|
||||
}
|
||||
|
||||
type InitApp func(logger log.Logger, registrar kratosRegistry.Registrar, bootstrap *conf.Bootstrap) (*kratos.App, func(), error)
|
||||
@@ -90,6 +89,8 @@ func Bootstrap(initApp InitApp, serviceName, version *string) {
|
||||
|
||||
// run the app.
|
||||
if err = app.Run(); err != nil {
|
||||
panic(err)
|
||||
buf := make([]byte, 1024)
|
||||
n := runtime.Stack(buf, false)
|
||||
panic(fmt.Sprintf("Panic: %v\nStack trace:\n%s", err, string(buf[:n])))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package config
|
||||
package bootstrap
|
||||
|
||||
import conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
|
||||
v1 "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"github.com/tx7do/kratos-bootstrap/config"
|
||||
)
|
||||
|
||||
func initApp(logger log.Logger, registrar registry.Registrar, _ *v1.Bootstrap) (*kratos.App, func(), error) {
|
||||
@@ -35,7 +34,7 @@ func initAppEx(logger log.Logger, registrar registry.Registrar, _ *v1.Bootstrap,
|
||||
|
||||
func TestCustomBootstrap(t *testing.T) {
|
||||
customCfg := &CustomConfig{}
|
||||
config.RegisterConfig(customCfg)
|
||||
RegisterConfig(customCfg)
|
||||
|
||||
Service.SetName("test")
|
||||
Service.SetVersion("v0.0.1")
|
||||
|
||||
@@ -1,43 +1,14 @@
|
||||
package config
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/config"
|
||||
fileKratos "github.com/go-kratos/kratos/v2/config/file"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
"github.com/tx7do/kratos-bootstrap/config/apollo"
|
||||
"github.com/tx7do/kratos-bootstrap/config/consul"
|
||||
"github.com/tx7do/kratos-bootstrap/config/etcd"
|
||||
"github.com/tx7do/kratos-bootstrap/config/kubernetes"
|
||||
"github.com/tx7do/kratos-bootstrap/config/nacos"
|
||||
"github.com/tx7do/kratos-bootstrap/config/polaris"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"github.com/tx7do/kratos-bootstrap/utils"
|
||||
)
|
||||
|
||||
// NewRemoteConfigSource 创建一个远程配置源
|
||||
func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source {
|
||||
switch Type(c.Type) {
|
||||
default:
|
||||
fallthrough
|
||||
case LocalFile:
|
||||
return nil
|
||||
case Nacos:
|
||||
return nacos.NewConfigSource(c)
|
||||
case Consul:
|
||||
return consul.NewConfigSource(c)
|
||||
case Etcd:
|
||||
return etcd.NewConfigSource(c)
|
||||
case Apollo:
|
||||
return apollo.NewConfigSource(c)
|
||||
case Kubernetes:
|
||||
return kubernetes.NewConfigSource(c)
|
||||
case Polaris:
|
||||
return polaris.NewConfigSource(c)
|
||||
}
|
||||
}
|
||||
|
||||
// NewFileConfigSource 创建一个本地文件配置源
|
||||
func NewFileConfigSource(filePath string) config.Source {
|
||||
return fileKratos.NewSource(filePath)
|
||||
@@ -1,6 +1,8 @@
|
||||
package config
|
||||
package bootstrap
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRegisterConfig(t *testing.T) {
|
||||
var cfg struct {
|
||||
@@ -1,4 +1,4 @@
|
||||
package config
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"flag"
|
||||
235
bootstrap/go.mod
235
bootstrap/go.mod
@@ -1,110 +1,144 @@
|
||||
module github.com/tx7do/kratos-bootstrap/bootstrap
|
||||
|
||||
go 1.23
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.23.3
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
github.com/imdario/mergo => dario.cat/mergo v0.3.16
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/api => ../api
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/config => ../config
|
||||
github.com/tx7do/kratos-bootstrap/logger => ../logger
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/registry => ../registry
|
||||
github.com/tx7do/kratos-bootstrap/registry/consul => ../registry/consul
|
||||
github.com/tx7do/kratos-bootstrap/registry/etcd => ../registry/etcd
|
||||
github.com/tx7do/kratos-bootstrap/registry/eureka => ../registry/eureka
|
||||
github.com/tx7do/kratos-bootstrap/registry/kubernetes => ../registry/kubernetes
|
||||
github.com/tx7do/kratos-bootstrap/registry/nacos => ../registry/nacos
|
||||
github.com/tx7do/kratos-bootstrap/registry/polaris => ../registry/polaris
|
||||
github.com/tx7do/kratos-bootstrap/registry/servicecomb => ../registry/servicecomb
|
||||
github.com/tx7do/kratos-bootstrap/registry/zookeeper => ../registry/zookeeper
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/apollo => ../remoteconfig/apollo
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/consul => ../remoteconfig/consul
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/etcd => ../remoteconfig/etcd
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/kubernetes => ../remoteconfig/kubernetes
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/nacos => ../remoteconfig/nacos
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/polaris => ../remoteconfig/polaris
|
||||
github.com/tx7do/kratos-bootstrap/tracer => ../tracer
|
||||
github.com/tx7do/kratos-bootstrap/utils => ../utils
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/google/subcommands v1.2.0
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
github.com/tx7do/kratos-bootstrap/config v0.0.5
|
||||
github.com/tx7do/kratos-bootstrap/logger v0.0.5
|
||||
github.com/tx7do/kratos-bootstrap/registry v0.0.5
|
||||
github.com/tx7do/kratos-bootstrap/tracer v0.0.5
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0
|
||||
golang.org/x/tools v0.27.0
|
||||
github.com/olekukonko/tablewriter v1.0.7
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/logger v0.0.10
|
||||
github.com/tx7do/kratos-bootstrap/registry v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/consul v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/etcd v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/eureka v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/kubernetes v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/nacos v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/servicecomb v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/registry/zookeeper v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/apollo v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/consul v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/etcd v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/kubernetes v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/nacos v0.1.1
|
||||
github.com/tx7do/kratos-bootstrap/remoteconfig/polaris v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/tracer v0.0.10
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3
|
||||
golang.org/x/tools v0.33.0
|
||||
)
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.63.51 // indirect
|
||||
dario.cat/mergo v1.0.2 // indirect
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.8 // indirect
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
|
||||
github.com/alibabacloud-go/darabonba-array v0.1.0 // indirect
|
||||
github.com/alibabacloud-go/darabonba-encode-util v0.0.2 // indirect
|
||||
github.com/alibabacloud-go/darabonba-map v0.0.2 // indirect
|
||||
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7 // indirect
|
||||
github.com/alibabacloud-go/darabonba-signature-util v0.0.7 // indirect
|
||||
github.com/alibabacloud-go/darabonba-string v1.0.2 // indirect
|
||||
github.com/alibabacloud-go/debug v1.0.1 // indirect
|
||||
github.com/alibabacloud-go/endpoint-util v1.1.1 // indirect
|
||||
github.com/alibabacloud-go/kms-20160120/v3 v3.2.3 // indirect
|
||||
github.com/alibabacloud-go/openapi-util v0.1.1 // indirect
|
||||
github.com/alibabacloud-go/tea v1.3.9 // indirect
|
||||
github.com/alibabacloud-go/tea-utils/v2 v2.0.7 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.63.107 // indirect
|
||||
github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1 // indirect
|
||||
github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.9 // indirect
|
||||
github.com/aliyun/aliyun-secretsmanager-client-go v1.1.5 // indirect
|
||||
github.com/aliyun/credentials-go v1.4.6 // indirect
|
||||
github.com/apolloconfig/agollo/v4 v4.4.0 // indirect
|
||||
github.com/armon/go-metrics v0.5.3 // indirect
|
||||
github.com/armon/go-metrics v0.5.4 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/deckarep/golang-set v1.8.0 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/fluent/fluent-logger-golang v1.9.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.8.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/fluent/fluent-logger-golang v1.10.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
||||
github.com/go-chassis/cari v0.9.0 // indirect
|
||||
github.com/go-chassis/foundation v0.4.0 // indirect
|
||||
github.com/go-chassis/openlog v1.1.3 // indirect
|
||||
github.com/go-chassis/sc-client v0.7.0 // indirect
|
||||
github.com/go-errors/errors v1.5.1 // indirect
|
||||
github.com/go-kratos/aegis v0.2.0 // indirect
|
||||
github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/eureka/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/kubernetes/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/servicecomb/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-kratos/kratos/contrib/registry/zookeeper/v2 v2.0.0-20241105072421-f8b97f675b32 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20250527152916-d6f5f00cf562 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20250527152916-d6f5f00cf562 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20250527152916-d6f5f00cf562 // indirect
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20250527152916-d6f5f00cf562 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.1 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.1 // indirect
|
||||
github.com/go-playground/form/v4 v4.2.1 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
|
||||
github.com/go-zookeeper/zk v1.0.4 // indirect
|
||||
github.com/gofrs/uuid v4.4.0+incompatible // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/mock v1.6.0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/gnostic-models v0.6.9 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
|
||||
github.com/hashicorp/consul/api v1.30.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
|
||||
github.com/hashicorp/consul/api v1.32.1 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.6.3 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-metrics v0.5.4 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/serf v0.10.1 // indirect
|
||||
github.com/imdario/mergo v1.0.1 // indirect
|
||||
github.com/hashicorp/serf v0.10.2 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/karlseguin/ccache/v2 v2.0.8 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/mailru/easyjson v0.9.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
@@ -112,67 +146,78 @@ require (
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.5 // indirect
|
||||
github.com/nacos-group/nacos-sdk-go/v2 v2.3.2 // indirect
|
||||
github.com/olekukonko/errors v1.1.0 // indirect
|
||||
github.com/olekukonko/ll v0.0.8 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
github.com/orcaman/concurrent-map v1.0.0 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.64.0 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/sagikazarmark/locafero v0.6.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.9.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.7.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.19.0 // indirect
|
||||
github.com/spf13/afero v1.14.0 // indirect
|
||||
github.com/spf13/cast v1.9.1 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/spf13/viper v1.20.1 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.11 // indirect
|
||||
github.com/tinylib/msgp v1.2.4 // indirect
|
||||
github.com/tinylib/msgp v1.3.0 // indirect
|
||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.17 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.17 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.6.0 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.0 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.6.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.31.0 // indirect
|
||||
golang.org/x/oauth2 v0.24.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
golang.org/x/term v0.26.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
golang.org/x/time v0.8.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
|
||||
google.golang.org/grpc v1.68.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/term v0.32.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
golang.org/x/time v0.11.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/grpc v1.72.2 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/api v0.31.2 // indirect
|
||||
k8s.io/apimachinery v0.31.2 // indirect
|
||||
k8s.io/client-go v0.31.2 // indirect
|
||||
k8s.io/api v0.33.1 // indirect
|
||||
k8s.io/apimachinery v0.33.1 // indirect
|
||||
k8s.io/client-go v0.33.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
|
||||
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
|
||||
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
)
|
||||
|
||||
586
bootstrap/go.sum
586
bootstrap/go.sum
File diff suppressed because it is too large
Load Diff
46
bootstrap/registry.go
Normal file
46
bootstrap/registry.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
kRegistry "github.com/go-kratos/kratos/v2/registry"
|
||||
"github.com/tx7do/kratos-bootstrap/registry"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/consul"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/etcd"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/eureka"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/kubernetes"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/nacos"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/servicecomb"
|
||||
_ "github.com/tx7do/kratos-bootstrap/registry/zookeeper"
|
||||
)
|
||||
|
||||
// NewRegistry 创建一个注册客户端
|
||||
func NewRegistry(cfg *conf.Registry) kRegistry.Registrar {
|
||||
if cfg == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
creator := registry.GetRegistrarCreator(cfg.GetType())
|
||||
if creator == nil {
|
||||
panic("registrar creator not found:" + cfg.GetType())
|
||||
return nil
|
||||
}
|
||||
|
||||
return creator(cfg)
|
||||
}
|
||||
|
||||
// NewDiscovery 创建一个发现客户端
|
||||
func NewDiscovery(cfg *conf.Registry) kRegistry.Discovery {
|
||||
if cfg == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
creator := registry.GetDiscoveryCreator(cfg.GetType())
|
||||
if creator == nil {
|
||||
panic("discovery creator not found:" + cfg.GetType())
|
||||
return nil
|
||||
}
|
||||
|
||||
return creator(cfg)
|
||||
}
|
||||
49
bootstrap/remote_config.go
Normal file
49
bootstrap/remote_config.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/config"
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/apollo"
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/consul"
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/etcd"
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/kubernetes"
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/nacos"
|
||||
"github.com/tx7do/kratos-bootstrap/remoteconfig/polaris"
|
||||
)
|
||||
|
||||
const remoteConfigSourceConfigFile = "remote.yaml"
|
||||
|
||||
type Type string
|
||||
|
||||
const (
|
||||
LocalFile Type = "file"
|
||||
Nacos Type = "nacos"
|
||||
Consul Type = "consul"
|
||||
Etcd Type = "etcd"
|
||||
Apollo Type = "apollo"
|
||||
Kubernetes Type = "kubernetes"
|
||||
Polaris Type = "polaris"
|
||||
)
|
||||
|
||||
// NewRemoteConfigSource 创建一个远程配置源
|
||||
func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source {
|
||||
switch Type(c.Type) {
|
||||
default:
|
||||
fallthrough
|
||||
case LocalFile:
|
||||
return nil
|
||||
case Nacos:
|
||||
return nacos.NewConfigSource(c)
|
||||
case Consul:
|
||||
return consul.NewConfigSource(c)
|
||||
case Etcd:
|
||||
return etcd.NewConfigSource(c)
|
||||
case Apollo:
|
||||
return apollo.NewConfigSource(c)
|
||||
case Kubernetes:
|
||||
return kubernetes.NewConfigSource(c)
|
||||
case Polaris:
|
||||
return polaris.NewConfigSource(c)
|
||||
}
|
||||
}
|
||||
25
cache/redis/go.mod
vendored
25
cache/redis/go.mod
vendored
@@ -1,26 +1,27 @@
|
||||
module github.com/tx7do/kratos-bootstrap/cache/redis
|
||||
|
||||
go 1.22.0
|
||||
go 1.23.0
|
||||
|
||||
toolchain go1.22.1
|
||||
toolchain go1.24.3
|
||||
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0
|
||||
github.com/redis/go-redis/v9 v9.7.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.10.0
|
||||
github.com/redis/go-redis/v9 v9.10.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.23
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.10.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
||||
46
cache/redis/go.sum
vendored
46
cache/redis/go.sum
vendored
@@ -8,38 +8,40 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0 h1:BIx9TNZH/Jsr4l1i7VVxnV0JPiwYj8qyrHyuL0fGZrk=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0/go.mod h1:eTg/YQtGYAZD5r3DlGlJptJ45AHA+/G+2NPn30PKzik=
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0 h1:bQk8xiVFw+3ln4pfELVktpWgYdFpgLLU+quwSoeIof0=
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0/go.mod h1:0LyN+GHLIJmKtjYRPF7nHyTTMV6E91YngoOopNifQRo=
|
||||
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
|
||||
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.10.0 h1:uTiEyEyfLhkw678n6EulHVto8AkcXVr8zUcBJNZ0ark=
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.10.0/go.mod h1:eFYL/99JvdLP4T9/3FZ5t2pClnv7mMskc+WstTcyVr4=
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.10.0 h1:4z7/hCJ9Jft8EBb2tDmK38p2WjyIEJ1ShhhwAhjOCps=
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.10.0/go.mod h1:B0thqLh4hB8MvvcUKSwyP5YiIcCCp8UrQ0cA9gEqyjk=
|
||||
github.com/redis/go-redis/v9 v9.10.0 h1:FxwK3eV8p/CQa0Ch276C7u2d0eNC9kCmAYQ7mCXCzVs=
|
||||
github.com/redis/go-redis/v9 v9.10.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
|
||||
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
|
||||
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
|
||||
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
|
||||
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
|
||||
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
|
||||
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
|
||||
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
||||
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
12
cache/redis/redis.go
vendored
12
cache/redis/redis.go
vendored
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// NewClient create go-redis client
|
||||
func NewClient(conf *conf.Data) (rdb *redis.Client) {
|
||||
func NewClient(conf *conf.Data, logger *log.Helper) (rdb *redis.Client) {
|
||||
if rdb = redis.NewClient(&redis.Options{
|
||||
Addr: conf.GetRedis().GetAddr(),
|
||||
Password: conf.GetRedis().GetPassword(),
|
||||
@@ -19,23 +19,23 @@ func NewClient(conf *conf.Data) (rdb *redis.Client) {
|
||||
WriteTimeout: conf.GetRedis().GetWriteTimeout().AsDuration(),
|
||||
ReadTimeout: conf.GetRedis().GetReadTimeout().AsDuration(),
|
||||
}); rdb == nil {
|
||||
log.Fatalf("failed opening connection to redis")
|
||||
logger.Fatalf("failed opening connection to redis")
|
||||
return nil
|
||||
}
|
||||
|
||||
// open tracing instrumentation.
|
||||
if conf.GetRedis().GetEnableTracing() {
|
||||
if err := redisotel.InstrumentTracing(rdb); err != nil {
|
||||
log.Fatalf("failed open tracing: %s", err.Error())
|
||||
panic(err)
|
||||
logger.Fatalf("failed open tracing: %s", err.Error())
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// open metrics instrumentation.
|
||||
if conf.GetRedis().GetEnableMetrics() {
|
||||
if err := redisotel.InstrumentMetrics(rdb); err != nil {
|
||||
log.Fatalf("failed open metrics: %s", err.Error())
|
||||
panic(err)
|
||||
logger.Fatalf("failed open metrics: %s", err.Error())
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package apollo
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/config"
|
||||
|
||||
// apollo
|
||||
apolloKratos "github.com/go-kratos/kratos/contrib/config/apollo/v2"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewConfigSource 创建一个远程配置源 - Apollo
|
||||
func NewConfigSource(c *conf.RemoteConfig) config.Source {
|
||||
source := apolloKratos.NewSource(
|
||||
apolloKratos.WithAppID(c.Apollo.AppId),
|
||||
apolloKratos.WithCluster(c.Apollo.Cluster),
|
||||
apolloKratos.WithEndpoint(c.Apollo.Endpoint),
|
||||
apolloKratos.WithNamespace(c.Apollo.Namespace),
|
||||
apolloKratos.WithSecret(c.Apollo.Secret),
|
||||
apolloKratos.WithEnableBackup(),
|
||||
)
|
||||
return source
|
||||
}
|
||||
115
config/go.mod
115
config/go.mod
@@ -1,115 +0,0 @@
|
||||
module github.com/tx7do/kratos-bootstrap/config
|
||||
|
||||
go 1.23
|
||||
|
||||
toolchain go1.23.2
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
github.com/imdario/mergo => dario.cat/mergo v0.3.16
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/api => ../api
|
||||
github.com/tx7do/kratos-bootstrap/utils => ../utils
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/config/kubernetes/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/config/nacos/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/hashicorp/consul/api v1.30.0
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.5
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
go.etcd.io/etcd/client/v3 v3.5.17
|
||||
google.golang.org/grpc v1.68.0
|
||||
k8s.io/client-go v0.31.2
|
||||
)
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
|
||||
github.com/apolloconfig/agollo/v4 v4.3.1 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||
github.com/fatih/color v1.16.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-errors/errors v1.0.1 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/serf v0.10.1 // indirect
|
||||
github.com/imdario/mergo v0.3.6 // indirect
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/spf13/afero v1.8.2 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.11.0 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.17 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.17.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.25.0 // indirect
|
||||
golang.org/x/term v0.24.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/api v0.31.2 // indirect
|
||||
k8s.io/apimachinery v0.31.2 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
package config
|
||||
|
||||
const remoteConfigSourceConfigFile = "remote.yaml"
|
||||
|
||||
type Type string
|
||||
|
||||
const (
|
||||
LocalFile Type = "file"
|
||||
Nacos Type = "nacos"
|
||||
Consul Type = "consul"
|
||||
Etcd Type = "etcd"
|
||||
Apollo Type = "apollo"
|
||||
Kubernetes Type = "kubernetes"
|
||||
Polaris Type = "polaris"
|
||||
)
|
||||
@@ -32,25 +32,8 @@ func NewCassandraClient(cfg *conf.Bootstrap, l *log.Helper) *gocql.Session {
|
||||
var tlsCfg *tls.Config
|
||||
var err error
|
||||
|
||||
if cfg.Data.Cassandra.Tls.File != nil {
|
||||
if tlsCfg, err = utils.LoadServerTlsConfigFile(
|
||||
cfg.Data.Cassandra.Tls.File.GetKeyPath(),
|
||||
cfg.Data.Cassandra.Tls.File.GetCertPath(),
|
||||
cfg.Data.Cassandra.Tls.File.GetCaPath(),
|
||||
cfg.Data.Cassandra.Tls.InsecureSkipVerify,
|
||||
); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
if tlsCfg == nil && cfg.Data.Cassandra.Tls.Config != nil {
|
||||
if tlsCfg, err = utils.LoadServerTlsConfig(
|
||||
cfg.Data.Cassandra.Tls.Config.GetKeyPem(),
|
||||
cfg.Data.Cassandra.Tls.Config.GetCertPem(),
|
||||
cfg.Data.Cassandra.Tls.Config.GetCaPem(),
|
||||
cfg.Data.Cassandra.Tls.InsecureSkipVerify,
|
||||
); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if tlsCfg, err = utils.LoadServerTlsConfig(cfg.Data.Cassandra.Tls); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if tlsCfg != nil {
|
||||
|
||||
@@ -7,17 +7,17 @@ toolchain go1.23.3
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/gocql/gocql v1.7.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.6
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/golang/snappy v1.0.0 // indirect
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
)
|
||||
|
||||
@@ -4,13 +4,13 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/gocql/gocql v1.7.0 h1:O+7U7/1gSN7QTEAaMEsJc1Oq2QHXvCWoF3DFK9HDHus=
|
||||
github.com/gocql/gocql v1.7.0/go.mod h1:vnlvXyFZeLBF0Wy+RS8hrOdbn0UWsWtdg07XJnFxZ+4=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
|
||||
@@ -27,11 +27,11 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0 h1:nY1VtIVnnGsOSj4HVhjFBk3qTxjIKDPV7lVR8ZT+gFk=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0/go.mod h1:AuXQsL0dtIoOKmAaxiJnBg/9inx7kXX/z7YQeLJ1qmw=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3 h1:1Ja6UTzWsfQWNLbaSCo9Of7yiJ+zQK+lMNceFCTD+wU=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3/go.mod h1:CXisY/y1eZIxesxuzLQs4z5AgXrYIijAmlAXf8dKZCo=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
|
||||
@@ -36,25 +36,8 @@ func NewClickHouseClient(cfg *conf.Bootstrap, l *log.Helper) clickhouse.Conn {
|
||||
var tlsCfg *tls.Config
|
||||
var err error
|
||||
|
||||
if cfg.Data.Clickhouse.Tls.File != nil {
|
||||
if tlsCfg, err = utils.LoadServerTlsConfigFile(
|
||||
cfg.Data.Clickhouse.Tls.File.GetKeyPath(),
|
||||
cfg.Data.Clickhouse.Tls.File.GetCertPath(),
|
||||
cfg.Data.Clickhouse.Tls.File.GetCaPath(),
|
||||
cfg.Data.Clickhouse.Tls.InsecureSkipVerify,
|
||||
); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
if tlsCfg == nil && cfg.Data.Clickhouse.Tls.Config != nil {
|
||||
if tlsCfg, err = utils.LoadServerTlsConfig(
|
||||
cfg.Data.Clickhouse.Tls.Config.GetKeyPem(),
|
||||
cfg.Data.Clickhouse.Tls.Config.GetCertPem(),
|
||||
cfg.Data.Clickhouse.Tls.Config.GetCaPem(),
|
||||
cfg.Data.Clickhouse.Tls.InsecureSkipVerify,
|
||||
); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if tlsCfg, err = utils.LoadServerTlsConfig(cfg.Data.Clickhouse.Tls); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if tlsCfg != nil {
|
||||
|
||||
@@ -7,27 +7,27 @@ toolchain go1.23.3
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.30.0
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.7
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.35.0
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/ClickHouse/ch-go v0.63.1 // indirect
|
||||
github.com/ClickHouse/ch-go v0.66.0 // indirect
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/go-faster/city v1.0.1 // indirect
|
||||
github.com/go-faster/errors v0.7.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/paulmach/orb v0.11.1 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
||||
github.com/segmentio/asm v1.2.0 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
go.opentelemetry.io/otel v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
github.com/ClickHouse/ch-go v0.63.1 h1:s2JyZvWLTCSAGdtjMBBmAgQQHMco6pawLJMOXi0FODM=
|
||||
github.com/ClickHouse/ch-go v0.63.1/go.mod h1:I1kJJCL3WJcBMGe1m+HVK0+nREaG+JOYYBWjrDrF3R0=
|
||||
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.30.0 h1:AG4D/hW39qa58+JHQIFOSnxyL46H6h2lrmGGk17dhFo=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.30.0/go.mod h1:i9ZQAojcayW3RsdCb3YR+n+wC2h65eJsZCscZ1Z1wyo=
|
||||
github.com/ClickHouse/ch-go v0.66.0 h1:hLslxxAVb2PHpbHr4n0d6aP8CEIpUYGMVT1Yj/Q5Img=
|
||||
github.com/ClickHouse/ch-go v0.66.0/go.mod h1:noiHWyLMJAZ5wYuq3R/K0TcRhrNA8h7o1AqHX0klEhM=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.35.0 h1:ZMLZqxu+NiW55f4JS32kzyEbMb7CthGn3ziCcULOvSE=
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.35.0/go.mod h1:O2FFT/rugdpGEW2VKyEGyMUWyQU0ahmenY9/emxLPxs=
|
||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -12,51 +11,51 @@ github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
|
||||
github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
|
||||
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
|
||||
github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
|
||||
github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
|
||||
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
|
||||
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
||||
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
||||
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
||||
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0 h1:nY1VtIVnnGsOSj4HVhjFBk3qTxjIKDPV7lVR8ZT+gFk=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0/go.mod h1:AuXQsL0dtIoOKmAaxiJnBg/9inx7kXX/z7YQeLJ1qmw=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3 h1:1Ja6UTzWsfQWNLbaSCo9Of7yiJ+zQK+lMNceFCTD+wU=
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3/go.mod h1:CXisY/y1eZIxesxuzLQs4z5AgXrYIijAmlAXf8dKZCo=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||
@@ -66,10 +65,10 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
|
||||
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
|
||||
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
|
||||
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@@ -85,16 +84,16 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
@@ -110,8 +109,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
|
||||
@@ -31,11 +31,15 @@ func NewEntClient[T ClientInterface](cfg *conf.Bootstrap, l *log.Helper, db T) *
|
||||
|
||||
wrapperClient := NewEntClientWrapper(db, drv)
|
||||
|
||||
wrapperClient.SetConnectionOption(
|
||||
int(cfg.Data.Database.GetMaxIdleConnections()),
|
||||
int(cfg.Data.Database.GetMaxOpenConnections()),
|
||||
cfg.Data.Database.GetConnectionMaxLifetime().AsDuration(),
|
||||
)
|
||||
if cfg.Data.Database.MaxIdleConnections != nil &&
|
||||
cfg.Data.Database.MaxOpenConnections != nil &&
|
||||
cfg.Data.Database.ConnectionMaxLifetime != nil {
|
||||
wrapperClient.SetConnectionOption(
|
||||
int(cfg.Data.Database.GetMaxIdleConnections()),
|
||||
int(cfg.Data.Database.GetMaxOpenConnections()),
|
||||
cfg.Data.Database.GetConnectionMaxLifetime().AsDuration(),
|
||||
)
|
||||
}
|
||||
|
||||
return wrapperClient
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@ toolchain go1.23.3
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
entgo.io/ent v0.14.1
|
||||
github.com/XSAM/otelsql v0.35.0
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
entgo.io/ent v0.14.4
|
||||
github.com/XSAM/otelsql v0.38.0
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/go-sql-driver/mysql v1.9.2
|
||||
github.com/jackc/pgx/v4 v4.18.3
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
go.opentelemetry.io/otel v1.32.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
go.opentelemetry.io/otel v1.36.0
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||
@@ -31,9 +31,10 @@ require (
|
||||
github.com/jackc/pgtype v1.14.4 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
golang.org/x/crypto v0.29.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
entgo.io/ent v0.14.1 h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s=
|
||||
entgo.io/ent v0.14.1/go.mod h1:MH6XLG0KXpkcDQhKiHfANZSzR55TJyPL5IGNpI8wpco=
|
||||
entgo.io/ent v0.14.4 h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=
|
||||
entgo.io/ent v0.14.4/go.mod h1:aDPE/OziPEu8+OWbzy4UlvWmD2/kbRuWfK2A40hcxJM=
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
@@ -7,8 +7,8 @@ github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20O
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
|
||||
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
||||
github.com/XSAM/otelsql v0.35.0 h1:nMdbU/XLmBIB6qZF61uDqy46E0LVA4ZgF/FCNw8Had4=
|
||||
github.com/XSAM/otelsql v0.35.0/go.mod h1:wO028mnLzmBpstK8XPsoeRLl/kgt417yjAwOGDIptTc=
|
||||
github.com/XSAM/otelsql v0.38.0 h1:zWU0/YM9cJhPE71zJcQ2EBHwQDp+G4AX2tPpljslaB8=
|
||||
github.com/XSAM/otelsql v0.38.0/go.mod h1:5ePOgcLEkWvZtN9H3GV4BUlPeM3p3pzLDCnRG73X8h8=
|
||||
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
|
||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
@@ -18,21 +18,21 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/go-sql-driver/mysql v1.9.2 h1:4cNKDYQ1I84SXslGddlsrMhc8k4LeDVj6Ad6WRjiHuU=
|
||||
github.com/go-sql-driver/mysql v1.9.2/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
@@ -134,20 +134,22 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
|
||||
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
|
||||
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
|
||||
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
|
||||
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
|
||||
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
|
||||
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
|
||||
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
@@ -171,8 +173,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
|
||||
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
||||
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
@@ -190,8 +192,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -209,8 +211,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -226,8 +228,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
@@ -244,8 +246,8 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package gorm
|
||||
|
||||
import (
|
||||
"gorm.io/driver/bigquery"
|
||||
"gorm.io/driver/clickhouse"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/driver/sqlserver"
|
||||
|
||||
"gorm.io/plugin/opentelemetry/tracing"
|
||||
"gorm.io/plugin/prometheus"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
@@ -40,9 +44,12 @@ func NewGormClient(cfg *conf.Bootstrap, l *log.Helper, migrates []interface{}) *
|
||||
case "sqlserver":
|
||||
driver = sqlserver.Open(cfg.Data.Database.Source)
|
||||
break
|
||||
case "bigquery":
|
||||
driver = bigquery.Open(cfg.Data.Database.Source)
|
||||
break
|
||||
}
|
||||
|
||||
client, err := gorm.Open(driver, &gorm.Config{})
|
||||
db, err := gorm.Open(driver, &gorm.Config{})
|
||||
if err != nil {
|
||||
l.Fatalf("failed opening connection to db: %v", err)
|
||||
return nil
|
||||
@@ -50,12 +57,46 @@ func NewGormClient(cfg *conf.Bootstrap, l *log.Helper, migrates []interface{}) *
|
||||
|
||||
// 运行数据库迁移工具
|
||||
if cfg.Data.Database.Migrate {
|
||||
if err = client.AutoMigrate(
|
||||
if err = db.AutoMigrate(
|
||||
migrates...,
|
||||
); err != nil {
|
||||
l.Fatalf("failed creating schema resources: %v", err)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return client
|
||||
|
||||
if cfg.Data.Database.GetEnableTrace() {
|
||||
if err = db.Use(tracing.NewPlugin()); err != nil {
|
||||
l.Fatalf("failed enable trace: %v", err)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Data.Database.GetEnableMetrics() {
|
||||
if err = db.Use(prometheus.New(prometheus.Config{
|
||||
RefreshInterval: 15, // refresh metrics interval (default 15 seconds)
|
||||
StartServer: true, // start http server to expose metrics
|
||||
DBName: cfg.Data.Database.GetPrometheusDbName(), // `DBName` as metrics label
|
||||
PushAddr: cfg.Data.Database.GetPrometheusPushAddr(), // push metrics if `PushAddr` configured
|
||||
HTTPServerPort: cfg.Data.Database.GetPrometheusHttpPort(), // configure http server port, default port 8080 (if you have configured multiple instances, only the first `HTTPServerPort` will be used to start server)
|
||||
})); err != nil {
|
||||
l.Fatalf("failed enable metrics: %v", err)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
sqlDB, err := db.DB()
|
||||
if sqlDB != nil {
|
||||
if cfg.Data.Database.MaxIdleConnections != nil {
|
||||
sqlDB.SetMaxIdleConns(int(cfg.Data.Database.GetMaxIdleConnections()))
|
||||
}
|
||||
if cfg.Data.Database.MaxOpenConnections != nil {
|
||||
sqlDB.SetMaxOpenConns(int(cfg.Data.Database.GetMaxOpenConnections()))
|
||||
}
|
||||
if cfg.Data.Database.ConnectionMaxLifetime != nil {
|
||||
sqlDB.SetConnMaxLifetime(cfg.Data.Database.GetConnectionMaxLifetime().AsDuration())
|
||||
}
|
||||
}
|
||||
|
||||
return db
|
||||
}
|
||||
|
||||
@@ -7,48 +7,91 @@ toolchain go1.23.3
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
gorm.io/driver/clickhouse v0.6.1
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
gorm.io/driver/bigquery v1.2.0
|
||||
gorm.io/driver/clickhouse v0.7.0
|
||||
gorm.io/driver/mysql v1.5.7
|
||||
gorm.io/driver/postgres v1.5.9
|
||||
gorm.io/driver/sqlite v1.5.6
|
||||
gorm.io/driver/sqlserver v1.5.4
|
||||
gorm.io/gorm v1.25.12
|
||||
gorm.io/driver/postgres v1.6.0
|
||||
gorm.io/driver/sqlite v1.5.7
|
||||
gorm.io/driver/sqlserver v1.6.0
|
||||
gorm.io/gorm v1.30.0
|
||||
gorm.io/plugin/opentelemetry v0.1.14
|
||||
gorm.io/plugin/prometheus v0.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.121.2 // indirect
|
||||
cloud.google.com/go/auth v0.16.1 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||
cloud.google.com/go/bigquery v1.69.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.7.0 // indirect
|
||||
cloud.google.com/go/iam v1.5.2 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/ClickHouse/ch-go v0.63.1 // indirect
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.30.0 // indirect
|
||||
github.com/ClickHouse/ch-go v0.66.0 // indirect
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.35.0 // indirect
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/apache/arrow/go/v15 v15.0.2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/go-faster/city v1.0.1 // indirect
|
||||
github.com/go-faster/errors v0.7.1 // indirect
|
||||
github.com/go-sql-driver/mysql v1.8.1 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-sql-driver/mysql v1.9.2 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
|
||||
github.com/golang-sql/sqlexp v0.1.0 // indirect
|
||||
github.com/google/flatbuffers v25.2.10+incompatible // indirect
|
||||
github.com/google/s2a-go v0.1.9 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
|
||||
github.com/hashicorp/go-version v1.7.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgx/v5 v5.7.1 // indirect
|
||||
github.com/jackc/pgx/v5 v5.7.5 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.24 // indirect
|
||||
github.com/microsoft/go-mssqldb v1.7.2 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
||||
github.com/microsoft/go-mssqldb v1.8.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/paulmach/orb v0.11.1 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.64.0 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/segmentio/asm v1.2.0 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
golang.org/x/crypto v0.29.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/zeebo/xxh3 v1.0.2 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
|
||||
go.opentelemetry.io/otel v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
golang.org/x/time v0.11.0 // indirect
|
||||
golang.org/x/tools v0.33.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.235.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/grpc v1.72.2 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
1205
database/gorm/go.sum
1205
database/gorm/go.sum
File diff suppressed because it is too large
Load Diff
@@ -8,29 +8,29 @@ replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/InfluxCommunity/influxdb3-go v0.14.0
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/apache/arrow/go/v15 v15.0.2 // indirect
|
||||
github.com/frankban/quicktest v1.14.0 // indirect
|
||||
github.com/goccy/go-json v0.10.3 // indirect
|
||||
github.com/google/flatbuffers v24.3.25+incompatible // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/google/flatbuffers v25.2.10+incompatible // indirect
|
||||
github.com/influxdata/line-protocol/v2 v2.2.1 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/zeebo/xxh3 v1.0.2 // indirect
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.31.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
golang.org/x/tools v0.27.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
golang.org/x/tools v0.33.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
|
||||
google.golang.org/grpc v1.68.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/grpc v1.72.2 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
||||
@@ -10,14 +10,18 @@ github.com/frankban/quicktest v1.11.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P
|
||||
github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU=
|
||||
github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss=
|
||||
github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
|
||||
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI=
|
||||
github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q=
|
||||
github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
@@ -32,10 +36,10 @@ github.com/influxdata/line-protocol/v2 v2.0.0-20210312151457-c52fdecb625a/go.mod
|
||||
github.com/influxdata/line-protocol/v2 v2.1.0/go.mod h1:QKw43hdUBg3GTk2iC3iyCxksNj7PX9aUSeYOYE/ceHY=
|
||||
github.com/influxdata/line-protocol/v2 v2.2.1 h1:EAPkqJ9Km4uAxtMRgUubJyqAr6zgWM0dznKMLRauQRE=
|
||||
github.com/influxdata/line-protocol/v2 v2.2.1/go.mod h1:DmB3Cnh+3oxmG6LOBIxce4oaL4CPj3OmMPgvauXh+tM=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
@@ -46,8 +50,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
||||
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
||||
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
@@ -59,31 +63,43 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
||||
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
||||
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
|
||||
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
|
||||
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
|
||||
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
|
||||
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
|
||||
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
|
||||
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
|
||||
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
|
||||
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
|
||||
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
|
||||
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b h1:QoALfVG9rhQ/M7vYDScfPdWjGL9dlsVVM5VGh7aKoAA=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
|
||||
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o=
|
||||
gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
|
||||
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
|
||||
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
|
||||
google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8=
|
||||
google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -7,21 +7,21 @@ toolchain go1.23.3
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
go.mongodb.org/mongo-driver v1.17.1
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
go.mongodb.org/mongo-driver v1.17.3
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/golang/snappy v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
golang.org/x/crypto v0.29.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
@@ -19,20 +19,20 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
|
||||
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
||||
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
|
||||
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
||||
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -44,11 +44,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
|
||||
4
go.mod
4
go.mod
@@ -1,5 +1,5 @@
|
||||
module github.com/tx7do/kratos-bootstrap
|
||||
|
||||
go 1.23
|
||||
go 1.23.0
|
||||
|
||||
toolchain go1.23.2
|
||||
toolchain go1.24.3
|
||||
|
||||
@@ -3,12 +3,17 @@ package aliyun
|
||||
import (
|
||||
aliyunLogger "github.com/go-kratos/kratos/contrib/log/aliyun/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Aliyun
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
wrapped := aliyunLogger.NewAliyunLog(
|
||||
if cfg == nil || cfg.Aliyun == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
wrapped, _ := aliyunLogger.NewAliyunLog(
|
||||
aliyunLogger.WithProject(cfg.Aliyun.Project),
|
||||
aliyunLogger.WithEndpoint(cfg.Aliyun.Endpoint),
|
||||
aliyunLogger.WithAccessKey(cfg.Aliyun.AccessKey),
|
||||
|
||||
@@ -3,11 +3,16 @@ package fluent
|
||||
import (
|
||||
fluentLogger "github.com/go-kratos/kratos/contrib/log/fluent/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Fluent
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
if cfg == nil || cfg.Fluent == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
wrapped, err := fluentLogger.NewLogger(cfg.Fluent.Endpoint)
|
||||
if err != nil {
|
||||
panic("create fluent logger failed")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module github.com/tx7do/kratos-bootstrap/logger
|
||||
|
||||
go 1.23
|
||||
go 1.23.5
|
||||
|
||||
toolchain go1.23.2
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
@@ -13,56 +13,64 @@ replace (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20241105072421-f8b97f675b32
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20250527152916-d6f5f00cf562
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20250527152916-d6f5f00cf562
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20250527152916-d6f5f00cf562
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20250527152916-d6f5f00cf562
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20250527152916-d6f5f00cf562
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.7
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/utils v0.1.3
|
||||
go.uber.org/zap v1.27.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.84 // indirect
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.101 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/fluent/fluent-logger-golang v1.9.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dennwc/varint v1.0.0 // indirect
|
||||
github.com/fluent/fluent-logger-golang v1.10.0 // indirect
|
||||
github.com/go-kit/kit v0.13.0 // indirect
|
||||
github.com/go-kit/log v0.2.1 // indirect
|
||||
github.com/go-kratos/aegis v0.2.0 // indirect
|
||||
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-playground/form/v4 v4.2.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.64.0 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/prometheus/prometheus v0.304.1 // indirect
|
||||
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.11 // indirect
|
||||
github.com/tinylib/msgp v1.2.4 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
github.com/tinylib/msgp v1.3.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.36.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.36.0 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/net v0.31.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
|
||||
google.golang.org/grpc v1.68.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/grpc v1.72.2 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
203
logger/go.sum
203
logger/go.sum
@@ -1,5 +1,21 @@
|
||||
cloud.google.com/go/auth v0.16.0 h1:Pd8P1s9WkcrBE2n/PhAwKsdrR35V3Sg2II9B+ndM3CU=
|
||||
cloud.google.com/go/auth v0.16.0/go.mod h1:1howDHJ5IETh/LwYs3ZxvlkXF48aSqqJUM+5o02dNOI=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c=
|
||||
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
|
||||
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 h1:Gt0j3wceWMwPmiazCa8MzMA0MfhmPIz0Qp0FJ6qcM0U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 h1:OVoM452qUFBrX+URdH3VpR299ma4kfom0yB0URYky9g=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0/go.mod h1:kUjrAo8bgEwLeZ/CmHqNl3Z/kPm7y6FKfxxK0izYUg4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
|
||||
github.com/Netflix/go-env v0.0.0-20220526054621-78278af1949d h1:wvStE9wLpws31NiWUx+38wny1msZ/tm+eL5xmm4Y7So=
|
||||
github.com/Netflix/go-env v0.0.0-20220526054621-78278af1949d/go.mod h1:9XMFaCeRyW7fC9XJOWQ+NdAv8VLG7ys7l3x4ozEGLUQ=
|
||||
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0=
|
||||
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs=
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo=
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc=
|
||||
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.4 h1:7Q2FEyqxeZeIkwYMwRC3uphxV4i7O2eV4ETe21d6lS4=
|
||||
@@ -20,14 +36,20 @@ github.com/alibabacloud-go/tea-utils/v2 v2.0.1 h1:K6kwgo+UiYx+/kr6CO0PN5ACZDzE3n
|
||||
github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4=
|
||||
github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M=
|
||||
github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8=
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.84 h1:7mMuHO/E3AtOM0P6HT62jJa6OnJRRXVWEWszaVThe4A=
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.84/go.mod h1:qNjBnTjQl8UeHhGmoZ7iredr2xyVBD1Ueu3JgOALR5U=
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.101 h1:bd+4FEhB33BLup4eG129J4fSDLqC2tAyU6mDrRCcKhU=
|
||||
github.com/aliyun/aliyun-log-go-sdk v0.1.101/go.mod h1:7QcyHasd4WLdC+lx4uCmdIBcl7WcgRHctwz8t1zAuPo=
|
||||
github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY=
|
||||
github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE=
|
||||
github.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
||||
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps=
|
||||
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3/go.mod h1:CIWtjkly68+yqLPbvwwR/fjNJA/idrtULjZWh2v1ys0=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
|
||||
github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E=
|
||||
github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
|
||||
@@ -36,8 +58,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fluent/fluent-logger-golang v1.9.0 h1:zUdY44CHX2oIUc7VTNZc+4m+ORuO/mldQDA7czhWXEg=
|
||||
github.com/fluent/fluent-logger-golang v1.9.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU=
|
||||
github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE=
|
||||
github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/fluent/fluent-logger-golang v1.10.0 h1:JcLj8u3WclQv2juHGKTSzBRM5vIZjEqbrmvn/n+m1W0=
|
||||
github.com/fluent/fluent-logger-golang v1.10.0/go.mod h1:UNyv8FAGmQcYJRtk+yfxhWqWUwsabTipgjXvBDR8kTs=
|
||||
github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss=
|
||||
github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og=
|
||||
github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU=
|
||||
@@ -46,23 +72,23 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
|
||||
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||
github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ=
|
||||
github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI=
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20241105072421-f8b97f675b32 h1:WyeJFqcon/Bl+CNgnwDd8TOGRxtbcmw4mfAXWFx5d54=
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20241105072421-f8b97f675b32/go.mod h1:9CH0XdDTKVnxVCd2kxGuEWqVusst2/igZmHtMnwld7M=
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20241105072421-f8b97f675b32 h1:y1iMjnjm7bUpJir3OzXrdYDhRC9+66l/yTpceeh5Hak=
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20241105072421-f8b97f675b32/go.mod h1:VRMY6Dwydf9GKHvb6nYwpWLKlSMm330xRpreMGaHUV8=
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20241105072421-f8b97f675b32 h1:5l1UoUjSCAX7wfHHT2ntZjbZWEfqI9gfE+f6ZLET8kI=
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20241105072421-f8b97f675b32/go.mod h1:N75qK1uUCbitb++n79dRnCj4M6GeOU9MpUH1mO3yvvE=
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20241105072421-f8b97f675b32 h1:yTNrTJe+R7+CENNOGltterymGPiIFcZt3b3xxMhsGEk=
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20241105072421-f8b97f675b32/go.mod h1:91Iwi+G+72M256UKXXHT4rsRJo686ADlCHZFPyK4Q80=
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20241105072421-f8b97f675b32 h1:Auyu3uKRKyu3rqf0JqnP0hP+VhQhB32USqpLYbVZdcA=
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20241105072421-f8b97f675b32/go.mod h1:fPWjHTVUaj0TGHA70pn+4o9q5jYNw4bQHRArS+OH74U=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20250527152916-d6f5f00cf562 h1:xeN6Y7xdPEnpawZMIKM9mGLVwRwNyBQEAU5YpPddwEo=
|
||||
github.com/go-kratos/kratos/contrib/log/aliyun/v2 v2.0.0-20250527152916-d6f5f00cf562/go.mod h1:PrGaLA8MWWzYTM49hWhwU5xUNcAsyfQVm0lVbRZ2X6c=
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20250527152916-d6f5f00cf562 h1:N/MmzEj8ZK4h7vgqE3uDBhpZplh4pQUduYjoE59DXe8=
|
||||
github.com/go-kratos/kratos/contrib/log/fluent/v2 v2.0.0-20250527152916-d6f5f00cf562/go.mod h1:xqm6njGv3+3iUFcwG4wTwxBBoZm9d6jyKQkKdZq3qjg=
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20250527152916-d6f5f00cf562 h1:veDgc15O0/hCotKvJFYkoxyoWCLBIo74ACI1G01viYg=
|
||||
github.com/go-kratos/kratos/contrib/log/logrus/v2 v2.0.0-20250527152916-d6f5f00cf562/go.mod h1:skIb7rx0uzhI70DH22glUX19M4h/C6gxt69+/nwwRgM=
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20250527152916-d6f5f00cf562 h1:0fmAxt+4twipHj6Ih7d3JRjTIkEapdkhPil1iJhoKHc=
|
||||
github.com/go-kratos/kratos/contrib/log/tencent/v2 v2.0.0-20250527152916-d6f5f00cf562/go.mod h1:DHq7E5ZLuhosKMbmC9T2Bww1Z28dgjXshUcZmvP0LA0=
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20250527152916-d6f5f00cf562 h1:PgtcB7Vs2pRmee3sw6PHX1cSNgg+ElaNLu/yvZphk+M=
|
||||
github.com/go-kratos/kratos/contrib/log/zap/v2 v2.0.0-20250527152916-d6f5f00cf562/go.mod h1:2dBRhAOrPQptII8Bv+ox5X9Ryx7xlPDK77ZD6Go8bqg=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
|
||||
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||
@@ -71,24 +97,42 @@ github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobq
|
||||
github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
|
||||
github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.6 h1:GW/XbdyBFQ8Qe+YAmFU9uHLo7OnF5tL52HFAgMmyrf4=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.6/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA=
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q=
|
||||
github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248=
|
||||
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk=
|
||||
github.com/jarcoal/httpmock v1.4.0 h1:BvhqnH0JAYbNudL2GMJKgOHe2CtKlzJ/5rWKyp+hc2k=
|
||||
github.com/jarcoal/httpmock v1.4.0/go.mod h1:ftW1xULwo+j0R0JJkJIIi7UKigZUXCLLanykgjwBXL0=
|
||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
@@ -97,19 +141,44 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
|
||||
github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU=
|
||||
github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY=
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
||||
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
|
||||
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
|
||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||
github.com/prometheus/common v0.64.0 h1:pdZeA+g617P7oGv1CzdTzyeShxAGrTBsolKNOLQPGO4=
|
||||
github.com/prometheus/common v0.64.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
|
||||
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
|
||||
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
|
||||
github.com/prometheus/prometheus v0.304.1 h1:e4kpJMb2Vh/PcR6LInake+ofcvFYHT+bCfmBvOkaZbY=
|
||||
github.com/prometheus/prometheus v0.304.1/go.mod h1:ioGx2SGKTY+fLnJSQCdTHqARVldGNS8OlIe3kvp98so=
|
||||
github.com/prometheus/sigv4 v0.1.2 h1:R7570f8AoM5YnTUPFm3mjZH5q2k4D+I/phCWvZ4PXG8=
|
||||
github.com/prometheus/sigv4 v0.1.2/go.mod h1:GF9fwrvLgkQwDdQ5BXeV9XUSCH/IPNqzvAoaohfjqMU=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
@@ -118,24 +187,28 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.11 h1:LJshkcQ14A/7XCgqalheBHv8qLwwOXr/xqttQbjWdHM=
|
||||
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.11/go.mod h1:WU+0TXfVbSctEsUUf4KmIKnfr+tknbjcsnx/TrEIPH4=
|
||||
github.com/tinylib/msgp v1.2.4 h1:yLFeUGostXXSGW5vxfT5dXG/qzkn4schv2I7at5+hVU=
|
||||
github.com/tinylib/msgp v1.2.4/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
|
||||
github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww=
|
||||
github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
|
||||
github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM=
|
||||
github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
|
||||
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
|
||||
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
|
||||
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
|
||||
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
|
||||
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
|
||||
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
|
||||
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
|
||||
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
@@ -148,29 +221,37 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b h1:QoALfVG9rhQ/M7vYDScfPdWjGL9dlsVVM5VGh7aKoAA=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
|
||||
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
|
||||
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
|
||||
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
@@ -179,25 +260,39 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
|
||||
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
|
||||
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
|
||||
google.golang.org/api v0.230.0 h1:2u1hni3E+UXAXrONrrkfWpi/V6cyKVAbfGVeGtC3OxM=
|
||||
google.golang.org/api v0.230.0/go.mod h1:aqvtoMk7YkiXx+6U12arQFExiRV9D/ekvMCwCd/TksQ=
|
||||
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
|
||||
google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8=
|
||||
google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
|
||||
gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
|
||||
k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
|
||||
k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
|
||||
k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
|
||||
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
|
||||
@@ -3,12 +3,18 @@ package logrus
|
||||
import (
|
||||
logrusLogger "github.com/go-kratos/kratos/contrib/log/logrus/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Logrus
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
if cfg == nil || cfg.Logrus == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
loggerLevel, err := logrus.ParseLevel(cfg.Logrus.Level)
|
||||
if err != nil {
|
||||
loggerLevel = logrus.InfoLevel
|
||||
|
||||
@@ -3,11 +3,16 @@ package tencent
|
||||
import (
|
||||
tencentLogger "github.com/go-kratos/kratos/contrib/log/tencent/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Tencent
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
if cfg == nil || cfg.Tencent == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
wrapped, err := tencentLogger.NewLogger(
|
||||
tencentLogger.WithTopicID(cfg.Tencent.TopicId),
|
||||
tencentLogger.WithEndpoint(cfg.Tencent.Endpoint),
|
||||
|
||||
@@ -2,18 +2,22 @@ package zap
|
||||
|
||||
import (
|
||||
zapLogger "github.com/go-kratos/kratos/contrib/log/zap/v2"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Zap
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
if cfg == nil || cfg.Zap == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
encoderConfig := zap.NewProductionEncoderConfig()
|
||||
encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||
encoderConfig.TimeKey = "time"
|
||||
|
||||
@@ -1,31 +1,34 @@
|
||||
module github.com/tx7do/kratos-bootstrap/oss/minio
|
||||
|
||||
go 1.22.0
|
||||
go 1.23.0
|
||||
|
||||
toolchain go1.22.1
|
||||
toolchain go1.24.3
|
||||
|
||||
replace github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.2
|
||||
github.com/minio/minio-go/v7 v7.0.80
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.5
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/minio/minio-go/v7 v7.0.92
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.19
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/goccy/go-json v0.10.3 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/minio/crc64nvme v1.0.2 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rs/xid v1.6.0 // indirect
|
||||
golang.org/x/crypto v0.29.0 // indirect
|
||||
golang.org/x/net v0.31.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
golang.org/x/text v0.20.0 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
github.com/tinylib/msgp v1.3.0 // indirect
|
||||
golang.org/x/crypto v0.38.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
||||
@@ -4,40 +4,46 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
|
||||
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2 h1:EsEA7AmPQ2YQQ0FZrDWO2HgBNqeWM8z/mWKzS5UkQaQ=
|
||||
github.com/go-kratos/kratos/v2 v2.8.2/go.mod h1:+Vfe3FzF0d+BfMdajA11jT0rAyJWublRE/seZQNZVxE=
|
||||
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
|
||||
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/minio/crc64nvme v1.0.2 h1:6uO1UxGAD+kwqWWp7mBFsi5gAse66C4NXO8cmcVculg=
|
||||
github.com/minio/crc64nvme v1.0.2/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
github.com/minio/minio-go/v7 v7.0.80 h1:2mdUHXEykRdY/BigLt3Iuu1otL0JTogT0Nmltg0wujk=
|
||||
github.com/minio/minio-go/v7 v7.0.80/go.mod h1:84gmIilaX4zcvAWWzJ5Z1WI5axN+hAbM5w25xf8xvC0=
|
||||
github.com/minio/minio-go/v7 v7.0.92 h1:jpBFWyRS3p8P/9tsRc+NuvqoFi7qAmTCFPoRFmobbVw=
|
||||
github.com/minio/minio-go/v7 v7.0.92/go.mod h1:vTIc8DNcnAZIhyFsk8EB90AbPjj3j68aWIEQCiPj7d0=
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY=
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
|
||||
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
||||
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
||||
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
|
||||
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww=
|
||||
github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
|
||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
@@ -1,27 +1,245 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
|
||||
consulKratos "github.com/go-kratos/kratos/contrib/registry/consul/v2"
|
||||
consulClient "github.com/hashicorp/consul/api"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"github.com/hashicorp/consul/api"
|
||||
)
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Consul
|
||||
func NewRegistry(c *conf.Registry) *consulKratos.Registry {
|
||||
cfg := consulClient.DefaultConfig()
|
||||
cfg.Address = c.Consul.GetAddress()
|
||||
cfg.Scheme = c.Consul.GetScheme()
|
||||
type Datacenter string
|
||||
|
||||
var cli *consulClient.Client
|
||||
var err error
|
||||
if cli, err = consulClient.NewClient(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
const (
|
||||
SingleDatacenter Datacenter = "SINGLE"
|
||||
MultiDatacenter Datacenter = "MULTI"
|
||||
)
|
||||
|
||||
// Client is consul client config
|
||||
type Client struct {
|
||||
dc Datacenter
|
||||
cli *api.Client
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
|
||||
// resolve service entry endpoints
|
||||
resolver ServiceResolver
|
||||
// healthcheck time interval in seconds
|
||||
healthcheckInterval int
|
||||
// heartbeat enable heartbeat
|
||||
heartbeat bool
|
||||
// deregisterCriticalServiceAfter time interval in seconds
|
||||
deregisterCriticalServiceAfter int
|
||||
// serviceChecks user custom checks
|
||||
serviceChecks api.AgentServiceChecks
|
||||
}
|
||||
|
||||
func defaultResolver(_ context.Context, entries []*api.ServiceEntry) []*registry.ServiceInstance {
|
||||
services := make([]*registry.ServiceInstance, 0, len(entries))
|
||||
for _, entry := range entries {
|
||||
var version string
|
||||
for _, tag := range entry.Service.Tags {
|
||||
ss := strings.SplitN(tag, "=", 2)
|
||||
if len(ss) == 2 && ss[0] == "version" {
|
||||
version = ss[1]
|
||||
}
|
||||
}
|
||||
endpoints := make([]string, 0)
|
||||
for scheme, addr := range entry.Service.TaggedAddresses {
|
||||
if scheme == "lan_ipv4" || scheme == "wan_ipv4" || scheme == "lan_ipv6" || scheme == "wan_ipv6" {
|
||||
continue
|
||||
}
|
||||
endpoints = append(endpoints, addr.Address)
|
||||
}
|
||||
if len(endpoints) == 0 && entry.Service.Address != "" && entry.Service.Port != 0 {
|
||||
endpoints = append(endpoints, fmt.Sprintf("http://%s:%d", entry.Service.Address, entry.Service.Port))
|
||||
}
|
||||
services = append(services, ®istry.ServiceInstance{
|
||||
ID: entry.Service.ID,
|
||||
Name: entry.Service.Service,
|
||||
Metadata: entry.Service.Meta,
|
||||
Version: version,
|
||||
Endpoints: endpoints,
|
||||
})
|
||||
}
|
||||
|
||||
reg := consulKratos.New(cli, consulKratos.WithHealthCheck(c.Consul.GetHealthCheck()))
|
||||
|
||||
return reg
|
||||
return services
|
||||
}
|
||||
|
||||
// ServiceResolver is used to resolve service endpoints
|
||||
type ServiceResolver func(ctx context.Context, entries []*api.ServiceEntry) []*registry.ServiceInstance
|
||||
|
||||
// Service get services from consul
|
||||
func (c *Client) Service(ctx context.Context, service string, index uint64, passingOnly bool) ([]*registry.ServiceInstance, uint64, error) {
|
||||
if c.dc == MultiDatacenter {
|
||||
return c.multiDCService(ctx, service, index, passingOnly)
|
||||
}
|
||||
|
||||
opts := &api.QueryOptions{
|
||||
WaitIndex: index,
|
||||
WaitTime: time.Second * 55,
|
||||
Datacenter: string(c.dc),
|
||||
}
|
||||
opts = opts.WithContext(ctx)
|
||||
|
||||
if c.dc == SingleDatacenter {
|
||||
opts.Datacenter = ""
|
||||
}
|
||||
|
||||
entries, meta, err := c.singleDCEntries(service, "", passingOnly, opts)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
return c.resolver(ctx, entries), meta.LastIndex, nil
|
||||
}
|
||||
|
||||
func (c *Client) multiDCService(ctx context.Context, service string, index uint64, passingOnly bool) ([]*registry.ServiceInstance, uint64, error) {
|
||||
opts := &api.QueryOptions{
|
||||
WaitIndex: index,
|
||||
WaitTime: time.Second * 55,
|
||||
}
|
||||
opts = opts.WithContext(ctx)
|
||||
|
||||
var instances []*registry.ServiceInstance
|
||||
|
||||
dcs, err := c.cli.Catalog().Datacenters()
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
for _, dc := range dcs {
|
||||
opts.Datacenter = dc
|
||||
e, m, err := c.singleDCEntries(service, "", passingOnly, opts)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
ins := c.resolver(ctx, e)
|
||||
for _, in := range ins {
|
||||
if in.Metadata == nil {
|
||||
in.Metadata = make(map[string]string, 1)
|
||||
}
|
||||
in.Metadata["dc"] = dc
|
||||
}
|
||||
|
||||
instances = append(instances, ins...)
|
||||
opts.WaitIndex = m.LastIndex
|
||||
}
|
||||
|
||||
return instances, opts.WaitIndex, nil
|
||||
}
|
||||
|
||||
func (c *Client) singleDCEntries(service, tag string, passingOnly bool, opts *api.QueryOptions) ([]*api.ServiceEntry, *api.QueryMeta, error) {
|
||||
return c.cli.Health().Service(service, tag, passingOnly, opts)
|
||||
}
|
||||
|
||||
// Register register service instance to consul
|
||||
func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enableHealthCheck bool) error {
|
||||
addresses := make(map[string]api.ServiceAddress, len(svc.Endpoints))
|
||||
checkAddresses := make([]string, 0, len(svc.Endpoints))
|
||||
for _, endpoint := range svc.Endpoints {
|
||||
raw, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
addr := raw.Hostname()
|
||||
port, _ := strconv.ParseUint(raw.Port(), 10, 16)
|
||||
|
||||
checkAddresses = append(checkAddresses, net.JoinHostPort(addr, strconv.FormatUint(port, 10)))
|
||||
addresses[raw.Scheme] = api.ServiceAddress{Address: endpoint, Port: int(port)}
|
||||
}
|
||||
asr := &api.AgentServiceRegistration{
|
||||
ID: svc.ID,
|
||||
Name: svc.Name,
|
||||
Meta: svc.Metadata,
|
||||
Tags: []string{fmt.Sprintf("version=%s", svc.Version)},
|
||||
TaggedAddresses: addresses,
|
||||
}
|
||||
if len(checkAddresses) > 0 {
|
||||
host, portRaw, _ := net.SplitHostPort(checkAddresses[0])
|
||||
port, _ := strconv.ParseInt(portRaw, 10, 32)
|
||||
asr.Address = host
|
||||
asr.Port = int(port)
|
||||
}
|
||||
if enableHealthCheck {
|
||||
for _, address := range checkAddresses {
|
||||
asr.Checks = append(asr.Checks, &api.AgentServiceCheck{
|
||||
TCP: address,
|
||||
Interval: fmt.Sprintf("%ds", c.healthcheckInterval),
|
||||
DeregisterCriticalServiceAfter: fmt.Sprintf("%ds", c.deregisterCriticalServiceAfter),
|
||||
Timeout: "5s",
|
||||
})
|
||||
}
|
||||
// custom checks
|
||||
asr.Checks = append(asr.Checks, c.serviceChecks...)
|
||||
}
|
||||
if c.heartbeat {
|
||||
asr.Checks = append(asr.Checks, &api.AgentServiceCheck{
|
||||
CheckID: "service:" + svc.ID,
|
||||
TTL: fmt.Sprintf("%ds", c.healthcheckInterval*2),
|
||||
DeregisterCriticalServiceAfter: fmt.Sprintf("%ds", c.deregisterCriticalServiceAfter),
|
||||
})
|
||||
}
|
||||
|
||||
err := c.cli.Agent().ServiceRegister(asr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if c.heartbeat {
|
||||
go func() {
|
||||
time.Sleep(time.Second)
|
||||
err = c.cli.Agent().UpdateTTL("service:"+svc.ID, "pass", "pass")
|
||||
if err != nil {
|
||||
log.Errorf("[Consul]update ttl heartbeat to consul failed!err:=%v", err)
|
||||
}
|
||||
ticker := time.NewTicker(time.Second * time.Duration(c.healthcheckInterval))
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-c.ctx.Done():
|
||||
_ = c.cli.Agent().ServiceDeregister(svc.ID)
|
||||
return
|
||||
default:
|
||||
}
|
||||
select {
|
||||
case <-c.ctx.Done():
|
||||
_ = c.cli.Agent().ServiceDeregister(svc.ID)
|
||||
return
|
||||
case <-ticker.C:
|
||||
// ensure that unregistered services will not be re-registered by mistake
|
||||
if errors.Is(c.ctx.Err(), context.Canceled) || errors.Is(c.ctx.Err(), context.DeadlineExceeded) {
|
||||
_ = c.cli.Agent().ServiceDeregister(svc.ID)
|
||||
return
|
||||
}
|
||||
err = c.cli.Agent().UpdateTTL("service:"+svc.ID, "pass", "pass")
|
||||
if err != nil {
|
||||
log.Errorf("[Consul] update ttl heartbeat to consul failed! err=%v", err)
|
||||
// when the previous report fails, try to re register the service
|
||||
time.Sleep(time.Duration(rand.Intn(5)) * time.Second)
|
||||
if err := c.cli.Agent().ServiceRegister(asr); err != nil {
|
||||
log.Errorf("[Consul] re registry service failed!, err=%v", err)
|
||||
} else {
|
||||
log.Warn("[Consul] re registry of service occurred success")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deregister service by service ID
|
||||
func (c *Client) Deregister(_ context.Context, serviceID string) error {
|
||||
defer c.cancel()
|
||||
return c.cli.Agent().ServiceDeregister(serviceID)
|
||||
}
|
||||
|
||||
41
registry/consul/client_creator.go
Normal file
41
registry/consul/client_creator.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
|
||||
consulClient "github.com/hashicorp/consul/api"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
r "github.com/tx7do/kratos-bootstrap/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
r.RegisterRegistrarCreator(string(r.Consul), func(c *conf.Registry) registry.Registrar {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
r.RegisterDiscoveryCreator(string(r.Consul), func(c *conf.Registry) registry.Discovery {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
}
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Consul
|
||||
func NewRegistry(c *conf.Registry) *Registry {
|
||||
if c == nil || c.Consul == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg := consulClient.DefaultConfig()
|
||||
cfg.Address = c.Consul.GetAddress()
|
||||
cfg.Scheme = c.Consul.GetScheme()
|
||||
|
||||
var cli *consulClient.Client
|
||||
var err error
|
||||
if cli, err = consulClient.NewClient(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
reg := New(cli, WithHealthCheck(c.Consul.GetHealthCheck()))
|
||||
|
||||
return reg
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewConsulRegistry(t *testing.T) {
|
||||
var cfg conf.Registry
|
||||
cfg.Consul.Scheme = "http"
|
||||
cfg.Consul.Address = "localhost:8500"
|
||||
cfg.Consul.HealthCheck = false
|
||||
cfg := conf.Registry{
|
||||
Consul: &conf.Registry_Consul{
|
||||
Scheme: "http",
|
||||
Address: "localhost:8500",
|
||||
HealthCheck: false,
|
||||
},
|
||||
}
|
||||
|
||||
reg := NewRegistry(&cfg)
|
||||
assert.Nil(t, reg)
|
||||
assert.NotNil(t, reg)
|
||||
}
|
||||
49
registry/consul/go.mod
Normal file
49
registry/consul/go.mod
Normal file
@@ -0,0 +1,49 @@
|
||||
module github.com/tx7do/kratos-bootstrap/registry/consul
|
||||
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
github.com/tx7do/kratos-bootstrap/registry => ../
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/hashicorp/consul/api v1.32.1
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/registry v0.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/armon/go-metrics v0.5.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.6.3 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-metrics v0.5.4 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/hashicorp/serf v0.10.2 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
244
registry/consul/go.sum
Normal file
244
registry/consul/go.sum
Normal file
@@ -0,0 +1,244 @@
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
|
||||
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
|
||||
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/hashicorp/consul/api v1.32.1 h1:0+osr/3t/aZNAdJX558crU3PEjVrG4x6715aZHRgceE=
|
||||
github.com/hashicorp/consul/api v1.32.1/go.mod h1:mXUWLnxftwTmDv4W3lzxYCPD199iNLLUyLfLGFJbtl4=
|
||||
github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg=
|
||||
github.com/hashicorp/consul/sdk v0.16.1/go.mod h1:fSXvwxB2hmh1FMZCNl6PwX0Q/1wdWtHJcZ7Ea5tns0s=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-metrics v0.4.1 h1:3CTMzft9hdMnx2CKrEPjJqwdMAN/ij7bjqzNo+JpVZ4=
|
||||
github.com/hashicorp/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||
github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY=
|
||||
github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI=
|
||||
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
||||
github.com/hashicorp/go-msgpack/v2 v2.1.2 h1:4Ee8FTp834e+ewB71RDrQ0VKpyFdrKOjvYtnQ/ltVj0=
|
||||
github.com/hashicorp/go-msgpack/v2 v2.1.2/go.mod h1:upybraOAblm4S7rx0+jeNy+CWWhzywQsSRV5033mMu4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-sockaddr v1.0.5 h1:dvk7TIXCZpmfOlM+9mlcrWmWjw/wlKT+VDq2wMvfPJU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.5/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
||||
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=
|
||||
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
|
||||
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/memberlist v0.5.2 h1:rJoNPWZ0juJBgqn48gjy59K5H4rNgvUoM1kUD7bXiuI=
|
||||
github.com/hashicorp/memberlist v0.5.2/go.mod h1:Ri9p/tRShbjYnpNf4FFPXG7wxEGY4Nrcn6E7jrVa//4=
|
||||
github.com/hashicorp/serf v0.10.2 h1:m5IORhuNSjaxeljg5DeQVDlQyVkhRIjJDimbkCa8aAc=
|
||||
github.com/hashicorp/serf v0.10.2/go.mod h1:T1CmSGfSeGfnfNy/w0odXQUR1rfECGd2Qdsp84DjOiY=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
|
||||
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
|
||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b h1:QoALfVG9rhQ/M7vYDScfPdWjGL9dlsVVM5VGh7aKoAA=
|
||||
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
|
||||
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
75
registry/consul/options.go
Normal file
75
registry/consul/options.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/api"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Option is consul registry option.
|
||||
type Option func(*Registry)
|
||||
|
||||
// WithHealthCheck with registry health check option.
|
||||
func WithHealthCheck(enable bool) Option {
|
||||
return func(o *Registry) {
|
||||
o.enableHealthCheck = enable
|
||||
}
|
||||
}
|
||||
|
||||
// WithTimeout with get services timeout option.
|
||||
func WithTimeout(timeout time.Duration) Option {
|
||||
return func(o *Registry) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
}
|
||||
|
||||
// WithDatacenter with registry datacenter option
|
||||
func WithDatacenter(dc Datacenter) Option {
|
||||
return func(o *Registry) {
|
||||
o.cli.dc = dc
|
||||
}
|
||||
}
|
||||
|
||||
// WithHeartbeat enable or disable heartbeat
|
||||
func WithHeartbeat(enable bool) Option {
|
||||
return func(o *Registry) {
|
||||
if o.cli != nil {
|
||||
o.cli.heartbeat = enable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithServiceResolver with endpoint function option.
|
||||
func WithServiceResolver(fn ServiceResolver) Option {
|
||||
return func(o *Registry) {
|
||||
if o.cli != nil {
|
||||
o.cli.resolver = fn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithHealthCheckInterval with healthcheck interval in seconds.
|
||||
func WithHealthCheckInterval(interval int) Option {
|
||||
return func(o *Registry) {
|
||||
if o.cli != nil {
|
||||
o.cli.healthcheckInterval = interval
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithDeregisterCriticalServiceAfter with deregister-critical-service-after in seconds.
|
||||
func WithDeregisterCriticalServiceAfter(interval int) Option {
|
||||
return func(o *Registry) {
|
||||
if o.cli != nil {
|
||||
o.cli.deregisterCriticalServiceAfter = interval
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithServiceCheck with service checks
|
||||
func WithServiceCheck(checks ...*api.AgentServiceCheck) Option {
|
||||
return func(o *Registry) {
|
||||
if o.cli != nil {
|
||||
o.cli.serviceChecks = checks
|
||||
}
|
||||
}
|
||||
}
|
||||
189
registry/consul/registry.go
Normal file
189
registry/consul/registry.go
Normal file
@@ -0,0 +1,189 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/consul/api"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var (
|
||||
_ registry.Registrar = (*Registry)(nil)
|
||||
_ registry.Discovery = (*Registry)(nil)
|
||||
)
|
||||
|
||||
// Config is consul registry config
|
||||
type Config struct {
|
||||
*api.Config
|
||||
}
|
||||
|
||||
// Registry is consul registry
|
||||
type Registry struct {
|
||||
cli *Client
|
||||
enableHealthCheck bool
|
||||
registry map[string]*serviceSet
|
||||
lock sync.RWMutex
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
// New creates consul registry
|
||||
func New(apiClient *api.Client, opts ...Option) *Registry {
|
||||
r := &Registry{
|
||||
registry: make(map[string]*serviceSet),
|
||||
enableHealthCheck: true,
|
||||
timeout: 10 * time.Second,
|
||||
cli: &Client{
|
||||
dc: SingleDatacenter,
|
||||
cli: apiClient,
|
||||
resolver: defaultResolver,
|
||||
healthcheckInterval: 10,
|
||||
heartbeat: true,
|
||||
deregisterCriticalServiceAfter: 600,
|
||||
},
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(r)
|
||||
}
|
||||
r.cli.ctx, r.cli.cancel = context.WithCancel(context.Background())
|
||||
return r
|
||||
}
|
||||
|
||||
// Register register service
|
||||
func (r *Registry) Register(ctx context.Context, svc *registry.ServiceInstance) error {
|
||||
return r.cli.Register(ctx, svc, r.enableHealthCheck)
|
||||
}
|
||||
|
||||
// Deregister deregister service
|
||||
func (r *Registry) Deregister(ctx context.Context, svc *registry.ServiceInstance) error {
|
||||
return r.cli.Deregister(ctx, svc.ID)
|
||||
}
|
||||
|
||||
// GetService return service by name
|
||||
func (r *Registry) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error) {
|
||||
r.lock.RLock()
|
||||
defer r.lock.RUnlock()
|
||||
set := r.registry[name]
|
||||
|
||||
getRemote := func() []*registry.ServiceInstance {
|
||||
services, _, err := r.cli.Service(ctx, name, 0, true)
|
||||
if err == nil && len(services) > 0 {
|
||||
return services
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if set == nil {
|
||||
if s := getRemote(); len(s) > 0 {
|
||||
return s, nil
|
||||
}
|
||||
return nil, fmt.Errorf("service %s not resolved in registry", name)
|
||||
}
|
||||
ss, _ := set.services.Load().([]*registry.ServiceInstance)
|
||||
if ss == nil {
|
||||
if s := getRemote(); len(s) > 0 {
|
||||
return s, nil
|
||||
}
|
||||
return nil, fmt.Errorf("service %s not found in registry", name)
|
||||
}
|
||||
return ss, nil
|
||||
}
|
||||
|
||||
// ListServices return service list.
|
||||
func (r *Registry) ListServices() (allServices map[string][]*registry.ServiceInstance, err error) {
|
||||
r.lock.RLock()
|
||||
defer r.lock.RUnlock()
|
||||
allServices = make(map[string][]*registry.ServiceInstance)
|
||||
for name, set := range r.registry {
|
||||
var services []*registry.ServiceInstance
|
||||
ss, _ := set.services.Load().([]*registry.ServiceInstance)
|
||||
if ss == nil {
|
||||
continue
|
||||
}
|
||||
services = append(services, ss...)
|
||||
allServices[name] = services
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Watch resolve service by name
|
||||
func (r *Registry) Watch(ctx context.Context, name string) (registry.Watcher, error) {
|
||||
r.lock.Lock()
|
||||
defer r.lock.Unlock()
|
||||
set, ok := r.registry[name]
|
||||
if !ok {
|
||||
set = &serviceSet{
|
||||
watcher: make(map[*watcher]struct{}),
|
||||
services: &atomic.Value{},
|
||||
serviceName: name,
|
||||
}
|
||||
r.registry[name] = set
|
||||
}
|
||||
|
||||
// init watcher
|
||||
w := &watcher{
|
||||
event: make(chan struct{}, 1),
|
||||
}
|
||||
w.ctx, w.cancel = context.WithCancel(ctx)
|
||||
w.set = set
|
||||
set.lock.Lock()
|
||||
set.watcher[w] = struct{}{}
|
||||
set.lock.Unlock()
|
||||
ss, _ := set.services.Load().([]*registry.ServiceInstance)
|
||||
if len(ss) > 0 {
|
||||
// If the service has a value, it needs to be pushed to the watcher,
|
||||
// otherwise the initial data may be blocked forever during the watch.
|
||||
w.event <- struct{}{}
|
||||
}
|
||||
|
||||
if !ok {
|
||||
err := r.resolve(ctx, set)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return w, nil
|
||||
}
|
||||
|
||||
func (r *Registry) resolve(ctx context.Context, ss *serviceSet) error {
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, r.timeout)
|
||||
defer cancel()
|
||||
|
||||
services, idx, err := r.cli.Service(timeoutCtx, ss.serviceName, 0, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(services) > 0 {
|
||||
ss.broadcast(services)
|
||||
}
|
||||
|
||||
go func() {
|
||||
ticker := time.NewTicker(time.Second)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
timeoutCtx, cancel := context.WithTimeout(context.Background(), r.timeout)
|
||||
tmpService, tmpIdx, err := r.cli.Service(timeoutCtx, ss.serviceName, idx, true)
|
||||
cancel()
|
||||
if err != nil {
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
if len(tmpService) != 0 && tmpIdx != idx {
|
||||
services = tmpService
|
||||
ss.broadcast(services)
|
||||
}
|
||||
idx = tmpIdx
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
430
registry/consul/registry_test.go
Normal file
430
registry/consul/registry_test.go
Normal file
@@ -0,0 +1,430 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/consul/api"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
func tcpServer(lis net.Listener) {
|
||||
for {
|
||||
conn, err := lis.Accept()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("get tcp")
|
||||
conn.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegistry_Register(t *testing.T) {
|
||||
opts := []Option{
|
||||
WithHealthCheck(false),
|
||||
}
|
||||
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
serverName string
|
||||
server []*registry.ServiceInstance
|
||||
}
|
||||
|
||||
test := []struct {
|
||||
name string
|
||||
args args
|
||||
want []*registry.ServiceInstance
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "normal",
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
serverName: "server-1",
|
||||
server: []*registry.ServiceInstance{
|
||||
{
|
||||
ID: "1",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Metadata: nil,
|
||||
Endpoints: []string{"http://127.0.0.1:8000"},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: []*registry.ServiceInstance{
|
||||
{
|
||||
ID: "1",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Metadata: nil,
|
||||
Endpoints: []string{"http://127.0.0.1:8000"},
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "registry new service replace old service",
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
serverName: "server-1",
|
||||
server: []*registry.ServiceInstance{
|
||||
{
|
||||
ID: "2",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Metadata: nil,
|
||||
Endpoints: []string{"http://127.0.0.1:8000"},
|
||||
},
|
||||
{
|
||||
ID: "2",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.2",
|
||||
Metadata: nil,
|
||||
Endpoints: []string{"http://127.0.0.1:8000"},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: []*registry.ServiceInstance{
|
||||
{
|
||||
ID: "2",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.2",
|
||||
Metadata: nil,
|
||||
Endpoints: []string{"http://127.0.0.1:8000"},
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range test {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cli, err := api.NewClient(&api.Config{Address: "127.0.0.1:8500"})
|
||||
if err != nil {
|
||||
t.Fatalf("create consul client failed: %v", err)
|
||||
}
|
||||
|
||||
r := New(cli, opts...)
|
||||
|
||||
for _, instance := range tt.args.server {
|
||||
err = r.Register(tt.args.ctx, instance)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
watch, err := r.Watch(tt.args.ctx, tt.args.serverName)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
got, err := watch.Next()
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("GetService() error = %v, wantErr %v", err, tt.wantErr)
|
||||
t.Errorf("GetService() got = %v", got)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("GetService() got = %v, want %v", got, tt.want)
|
||||
}
|
||||
|
||||
for _, instance := range tt.args.server {
|
||||
_ = r.Deregister(tt.args.ctx, instance)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegistry_GetService(t *testing.T) {
|
||||
addr := fmt.Sprintf("%s:9091", getIntranetIP())
|
||||
lis, err := net.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
t.Errorf("listen tcp %s failed!", addr)
|
||||
t.Fail()
|
||||
}
|
||||
defer lis.Close()
|
||||
go tcpServer(lis)
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
cli, err := api.NewClient(&api.Config{Address: "127.0.0.1:8500"})
|
||||
if err != nil {
|
||||
t.Fatalf("create consul client failed: %v", err)
|
||||
}
|
||||
opts := []Option{
|
||||
WithHeartbeat(true),
|
||||
WithHealthCheck(true),
|
||||
WithHealthCheckInterval(5),
|
||||
}
|
||||
r := New(cli, opts...)
|
||||
|
||||
instance1 := ®istry.ServiceInstance{
|
||||
ID: "1",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Endpoints: []string{fmt.Sprintf("tcp://%s?isSecure=false", addr)},
|
||||
}
|
||||
|
||||
instance2 := ®istry.ServiceInstance{
|
||||
ID: "2",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Endpoints: []string{fmt.Sprintf("tcp://%s?isSecure=false", addr)},
|
||||
}
|
||||
|
||||
type fields struct {
|
||||
registry *Registry
|
||||
}
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
serviceName string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
args args
|
||||
want []*registry.ServiceInstance
|
||||
wantErr bool
|
||||
preFunc func(t *testing.T)
|
||||
deferFunc func(t *testing.T)
|
||||
}{
|
||||
{
|
||||
name: "normal",
|
||||
fields: fields{r},
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
serviceName: "server-1",
|
||||
},
|
||||
want: []*registry.ServiceInstance{instance1},
|
||||
wantErr: false,
|
||||
preFunc: func(t *testing.T) {
|
||||
if err := r.Register(context.Background(), instance1); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
watch, err := r.Watch(context.Background(), instance1.Name)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
_, err = watch.Next()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
},
|
||||
deferFunc: func(t *testing.T) {
|
||||
err := r.Deregister(context.Background(), instance1)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "can't get any",
|
||||
fields: fields{r},
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
serviceName: "server-x",
|
||||
},
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
preFunc: func(t *testing.T) {
|
||||
if err := r.Register(context.Background(), instance2); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
watch, err := r.Watch(context.Background(), instance2.Name)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
_, err = watch.Next()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
},
|
||||
deferFunc: func(t *testing.T) {
|
||||
err := r.Deregister(context.Background(), instance2)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if test.preFunc != nil {
|
||||
test.preFunc(t)
|
||||
}
|
||||
if test.deferFunc != nil {
|
||||
defer test.deferFunc(t)
|
||||
}
|
||||
|
||||
service, err := test.fields.registry.GetService(context.Background(), test.args.serviceName)
|
||||
if (err != nil) != test.wantErr {
|
||||
t.Errorf("GetService() error = %v, wantErr %v", err, test.wantErr)
|
||||
t.Errorf("GetService() got = %v", service)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(service, test.want) {
|
||||
t.Errorf("GetService() got = %v, want %v", service, test.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegistry_Watch(t *testing.T) {
|
||||
addr := fmt.Sprintf("%s:9091", getIntranetIP())
|
||||
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
cli, err := api.NewClient(&api.Config{Address: "127.0.0.1:8500", WaitTime: 2 * time.Second})
|
||||
if err != nil {
|
||||
t.Fatalf("create consul client failed: %v", err)
|
||||
}
|
||||
|
||||
instance1 := ®istry.ServiceInstance{
|
||||
ID: "1",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Endpoints: []string{fmt.Sprintf("tcp://%s?isSecure=false", addr)},
|
||||
}
|
||||
|
||||
instance2 := ®istry.ServiceInstance{
|
||||
ID: "2",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Endpoints: []string{fmt.Sprintf("tcp://%s?isSecure=false", addr)},
|
||||
}
|
||||
|
||||
instance3 := ®istry.ServiceInstance{
|
||||
ID: "3",
|
||||
Name: "server-1",
|
||||
Version: "v0.0.1",
|
||||
Endpoints: []string{fmt.Sprintf("tcp://%s?isSecure=false", addr)},
|
||||
}
|
||||
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
cancel func()
|
||||
opts []Option
|
||||
instance *registry.ServiceInstance
|
||||
}
|
||||
canceledCtx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want []*registry.ServiceInstance
|
||||
wantErr bool
|
||||
preFunc func(t *testing.T)
|
||||
}{
|
||||
{
|
||||
name: "normal",
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
instance: instance1,
|
||||
opts: []Option{
|
||||
WithHealthCheck(false),
|
||||
},
|
||||
},
|
||||
want: []*registry.ServiceInstance{instance1},
|
||||
wantErr: false,
|
||||
preFunc: func(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ctx has been cancelled",
|
||||
args: args{
|
||||
ctx: canceledCtx,
|
||||
cancel: cancel,
|
||||
instance: instance2,
|
||||
opts: []Option{
|
||||
WithHealthCheck(false),
|
||||
},
|
||||
},
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
preFunc: func(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "register with healthCheck",
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
instance: instance3,
|
||||
opts: []Option{
|
||||
WithHeartbeat(true),
|
||||
WithHealthCheck(true),
|
||||
WithHealthCheckInterval(5),
|
||||
},
|
||||
},
|
||||
want: []*registry.ServiceInstance{instance3},
|
||||
wantErr: false,
|
||||
preFunc: func(t *testing.T) {
|
||||
lis, err := net.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
t.Errorf("listen tcp %s failed!", addr)
|
||||
return
|
||||
}
|
||||
go tcpServer(lis)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if tt.preFunc != nil {
|
||||
tt.preFunc(t)
|
||||
}
|
||||
|
||||
r := New(cli, tt.args.opts...)
|
||||
|
||||
err := r.Register(tt.args.ctx, tt.args.instance)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
defer func() {
|
||||
err = r.Deregister(tt.args.ctx, tt.args.instance)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}()
|
||||
|
||||
watch, err := r.Watch(tt.args.ctx, tt.args.instance.Name)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if tt.args.cancel != nil {
|
||||
tt.args.cancel()
|
||||
}
|
||||
|
||||
service, err := watch.Next()
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("GetService() error = %v, wantErr %v", err, tt.wantErr)
|
||||
t.Errorf("GetService() got = %v", service)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(service, tt.want) {
|
||||
t.Errorf("GetService() got = %v, want %v", service, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func getIntranetIP() string {
|
||||
addrs, err := net.InterfaceAddrs()
|
||||
if err != nil {
|
||||
return "127.0.0.1"
|
||||
}
|
||||
|
||||
for _, address := range addrs {
|
||||
if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
|
||||
if ipnet.IP.To4() != nil {
|
||||
return ipnet.IP.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
return "127.0.0.1"
|
||||
}
|
||||
27
registry/consul/service.go
Normal file
27
registry/consul/service.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
type serviceSet struct {
|
||||
serviceName string
|
||||
watcher map[*watcher]struct{}
|
||||
services *atomic.Value
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
func (s *serviceSet) broadcast(ss []*registry.ServiceInstance) {
|
||||
s.services.Store(ss)
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
for k := range s.watcher {
|
||||
select {
|
||||
case k.event <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
40
registry/consul/watcher.go
Normal file
40
registry/consul/watcher.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package consul
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
type watcher struct {
|
||||
event chan struct{}
|
||||
set *serviceSet
|
||||
|
||||
// for cancel
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
}
|
||||
|
||||
func (w *watcher) Next() (services []*registry.ServiceInstance, err error) {
|
||||
select {
|
||||
case <-w.ctx.Done():
|
||||
err = w.ctx.Err()
|
||||
return
|
||||
case <-w.event:
|
||||
}
|
||||
|
||||
ss, ok := w.set.services.Load().([]*registry.ServiceInstance)
|
||||
|
||||
if ok {
|
||||
services = append(services, ss...)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (w *watcher) Stop() error {
|
||||
w.cancel()
|
||||
w.set.lock.Lock()
|
||||
defer w.set.lock.Unlock()
|
||||
delete(w.set.watcher, w)
|
||||
return nil
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
etcdKratos "github.com/go-kratos/kratos/contrib/registry/etcd/v2"
|
||||
etcdClient "go.etcd.io/etcd/client/v3"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Etcd
|
||||
func NewRegistry(c *conf.Registry) *etcdKratos.Registry {
|
||||
cfg := etcdClient.Config{
|
||||
Endpoints: c.Etcd.Endpoints,
|
||||
}
|
||||
|
||||
var err error
|
||||
var cli *etcdClient.Client
|
||||
if cli, err = etcdClient.New(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
reg := etcdKratos.New(cli)
|
||||
|
||||
return reg
|
||||
}
|
||||
41
registry/etcd/client_creator.go
Normal file
41
registry/etcd/client_creator.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
|
||||
etcdClient "go.etcd.io/etcd/client/v3"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
r "github.com/tx7do/kratos-bootstrap/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
r.RegisterRegistrarCreator(string(r.Etcd), func(c *conf.Registry) registry.Registrar {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
r.RegisterDiscoveryCreator(string(r.Etcd), func(c *conf.Registry) registry.Discovery {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
}
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Etcd
|
||||
func NewRegistry(c *conf.Registry) *Registry {
|
||||
if c == nil || c.Etcd == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg := etcdClient.Config{
|
||||
Endpoints: c.Etcd.Endpoints,
|
||||
}
|
||||
|
||||
var err error
|
||||
var cli *etcdClient.Client
|
||||
if cli, err = etcdClient.New(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
reg := New(cli)
|
||||
|
||||
return reg
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewEtcdRegistry(t *testing.T) {
|
||||
var cfg conf.Registry
|
||||
cfg.Etcd.Endpoints = []string{"127.0.0.1:2379"}
|
||||
cfg := conf.Registry{
|
||||
Etcd: &conf.Registry_Etcd{
|
||||
Endpoints: []string{"127.0.0.1:2379"},
|
||||
},
|
||||
}
|
||||
|
||||
reg := NewRegistry(&cfg)
|
||||
assert.Nil(t, reg)
|
||||
assert.NotNil(t, reg)
|
||||
}
|
||||
43
registry/etcd/go.mod
Normal file
43
registry/etcd/go.mod
Normal file
@@ -0,0 +1,43 @@
|
||||
module github.com/tx7do/kratos-bootstrap/registry/etcd
|
||||
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
github.com/tx7do/kratos-bootstrap/registry => ../
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/registry v0.1.0
|
||||
go.etcd.io/etcd/client/v3 v3.6.0
|
||||
google.golang.org/grpc v1.72.2
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.6.0 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
107
registry/etcd/go.sum
Normal file
107
registry/etcd/go.sum
Normal file
@@ -0,0 +1,107 @@
|
||||
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
|
||||
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.etcd.io/etcd/api/v3 v3.6.0 h1:vdbkcUBGLf1vfopoGE/uS3Nv0KPyIpUV/HM6w9yx2kM=
|
||||
go.etcd.io/etcd/api/v3 v3.6.0/go.mod h1:Wt5yZqEmxgTNJGHob7mTVBJDZNXiHPtXTcPab37iFOw=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.0 h1:nchnPqpuxvv3UuGGHaz0DQKYi5EIW5wOYsgUNRc365k=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.0/go.mod h1:Jv5SFWMnGvIBn8o3OaBq/PnT0jjsX8iNokAUessNjoA=
|
||||
go.etcd.io/etcd/client/v3 v3.6.0 h1:/yjKzD+HW5v/3DVj9tpwFxzNbu8hjcKID183ug9duWk=
|
||||
go.etcd.io/etcd/client/v3 v3.6.0/go.mod h1:Jzk/Knqe06pkOZPHXsQ0+vNDvMQrgIqJ0W8DwPdMJMg=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
|
||||
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
|
||||
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
|
||||
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
|
||||
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
|
||||
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
|
||||
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
|
||||
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a h1:SGktgSolFCo75dnHJF2yMvnns6jCmHFJ0vE4Vn2JKvQ=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a/go.mod h1:a77HrdMjoeKbnd2jmgcWdaS++ZLZAEq3orIOAEIKiVw=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
|
||||
google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8=
|
||||
google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
35
registry/etcd/options.go
Normal file
35
registry/etcd/options.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Option is etcd registry option.
|
||||
type Option func(o *options)
|
||||
|
||||
type options struct {
|
||||
ctx context.Context
|
||||
namespace string
|
||||
ttl time.Duration
|
||||
maxRetry int
|
||||
}
|
||||
|
||||
// Context with registry context.
|
||||
func Context(ctx context.Context) Option {
|
||||
return func(o *options) { o.ctx = ctx }
|
||||
}
|
||||
|
||||
// Namespace with registry namespace.
|
||||
func Namespace(ns string) Option {
|
||||
return func(o *options) { o.namespace = ns }
|
||||
}
|
||||
|
||||
// RegisterTTL with register ttl.
|
||||
func RegisterTTL(ttl time.Duration) Option {
|
||||
return func(o *options) { o.ttl = ttl }
|
||||
}
|
||||
|
||||
func MaxRetry(num int) Option {
|
||||
return func(o *options) { o.maxRetry = num }
|
||||
}
|
||||
184
registry/etcd/registry.go
Normal file
184
registry/etcd/registry.go
Normal file
@@ -0,0 +1,184 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var (
|
||||
_ registry.Registrar = (*Registry)(nil)
|
||||
_ registry.Discovery = (*Registry)(nil)
|
||||
)
|
||||
|
||||
// Registry is etcd registry.
|
||||
type Registry struct {
|
||||
opts *options
|
||||
client *clientv3.Client
|
||||
kv clientv3.KV
|
||||
lease clientv3.Lease
|
||||
}
|
||||
|
||||
// New creates etcd registry
|
||||
func New(client *clientv3.Client, opts ...Option) (r *Registry) {
|
||||
op := &options{
|
||||
ctx: context.Background(),
|
||||
namespace: "/microservices",
|
||||
ttl: time.Second * 15,
|
||||
maxRetry: 5,
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(op)
|
||||
}
|
||||
return &Registry{
|
||||
opts: op,
|
||||
client: client,
|
||||
kv: clientv3.NewKV(client),
|
||||
}
|
||||
}
|
||||
|
||||
// Register the registration.
|
||||
func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error {
|
||||
key := fmt.Sprintf("%s/%s/%s", r.opts.namespace, service.Name, service.ID)
|
||||
value, err := marshal(service)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if r.lease != nil {
|
||||
r.lease.Close()
|
||||
}
|
||||
r.lease = clientv3.NewLease(r.client)
|
||||
leaseID, err := r.registerWithKV(ctx, key, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go r.heartBeat(r.opts.ctx, leaseID, key, value)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deregister the registration.
|
||||
func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error {
|
||||
defer func() {
|
||||
if r.lease != nil {
|
||||
r.lease.Close()
|
||||
}
|
||||
}()
|
||||
key := fmt.Sprintf("%s/%s/%s", r.opts.namespace, service.Name, service.ID)
|
||||
_, err := r.client.Delete(ctx, key)
|
||||
return err
|
||||
}
|
||||
|
||||
// GetService return the service instances in memory according to the service name.
|
||||
func (r *Registry) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error) {
|
||||
key := fmt.Sprintf("%s/%s", r.opts.namespace, name)
|
||||
resp, err := r.kv.Get(ctx, key, clientv3.WithPrefix())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items := make([]*registry.ServiceInstance, 0, len(resp.Kvs))
|
||||
for _, kv := range resp.Kvs {
|
||||
si, err := unmarshal(kv.Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if si.Name != name {
|
||||
continue
|
||||
}
|
||||
items = append(items, si)
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// Watch creates a watcher according to the service name.
|
||||
func (r *Registry) Watch(ctx context.Context, name string) (registry.Watcher, error) {
|
||||
key := fmt.Sprintf("%s/%s", r.opts.namespace, name)
|
||||
return newWatcher(ctx, key, name, r.client)
|
||||
}
|
||||
|
||||
// registerWithKV create a new lease, return current leaseID
|
||||
func (r *Registry) registerWithKV(ctx context.Context, key string, value string) (clientv3.LeaseID, error) {
|
||||
grant, err := r.lease.Grant(ctx, int64(r.opts.ttl.Seconds()))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
_, err = r.client.Put(ctx, key, value, clientv3.WithLease(grant.ID))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return grant.ID, nil
|
||||
}
|
||||
|
||||
func (r *Registry) heartBeat(ctx context.Context, leaseID clientv3.LeaseID, key string, value string) {
|
||||
curLeaseID := leaseID
|
||||
kac, err := r.client.KeepAlive(ctx, leaseID)
|
||||
if err != nil {
|
||||
curLeaseID = 0
|
||||
}
|
||||
rand.Seed(time.Now().Unix())
|
||||
|
||||
for {
|
||||
if curLeaseID == 0 {
|
||||
// try to registerWithKV
|
||||
var retreat []int
|
||||
for retryCnt := 0; retryCnt < r.opts.maxRetry; retryCnt++ {
|
||||
if ctx.Err() != nil {
|
||||
return
|
||||
}
|
||||
// prevent infinite blocking
|
||||
idChan := make(chan clientv3.LeaseID, 1)
|
||||
errChan := make(chan error, 1)
|
||||
cancelCtx, cancel := context.WithCancel(ctx)
|
||||
go func() {
|
||||
defer cancel()
|
||||
id, registerErr := r.registerWithKV(cancelCtx, key, value)
|
||||
if registerErr != nil {
|
||||
errChan <- registerErr
|
||||
} else {
|
||||
idChan <- id
|
||||
}
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-time.After(3 * time.Second):
|
||||
cancel()
|
||||
continue
|
||||
case <-errChan:
|
||||
continue
|
||||
case curLeaseID = <-idChan:
|
||||
}
|
||||
|
||||
kac, err = r.client.KeepAlive(ctx, curLeaseID)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
retreat = append(retreat, 1<<retryCnt)
|
||||
time.Sleep(time.Duration(retreat[rand.Intn(len(retreat))]) * time.Second)
|
||||
}
|
||||
if _, ok := <-kac; !ok {
|
||||
// retry failed
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
case _, ok := <-kac:
|
||||
if !ok {
|
||||
if ctx.Err() != nil {
|
||||
// channel closed due to context cancel
|
||||
return
|
||||
}
|
||||
// need to retry registration
|
||||
curLeaseID = 0
|
||||
continue
|
||||
}
|
||||
case <-r.opts.ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
154
registry/etcd/registry_test.go
Normal file
154
registry/etcd/registry_test.go
Normal file
@@ -0,0 +1,154 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
func TestRegistry(t *testing.T) {
|
||||
client, err := clientv3.New(clientv3.Config{
|
||||
Endpoints: []string{"127.0.0.1:2379"},
|
||||
DialTimeout: time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
ctx := context.Background()
|
||||
s := ®istry.ServiceInstance{
|
||||
ID: "0",
|
||||
Name: "helloworld",
|
||||
}
|
||||
|
||||
r := New(client)
|
||||
w, err := r.Watch(ctx, s.Name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = w.Stop()
|
||||
}()
|
||||
go func() {
|
||||
for {
|
||||
res, err1 := w.Next()
|
||||
if err1 != nil {
|
||||
return
|
||||
}
|
||||
t.Logf("watch: %d", len(res))
|
||||
for _, r := range res {
|
||||
t.Logf("next: %+v", r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
time.Sleep(time.Second)
|
||||
|
||||
if err1 := r.Register(ctx, s); err1 != nil {
|
||||
t.Fatal(err1)
|
||||
}
|
||||
time.Sleep(time.Second)
|
||||
|
||||
res, err := r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(res) != 1 && res[0].Name != s.Name {
|
||||
t.Errorf("not expected: %+v", res)
|
||||
}
|
||||
|
||||
if err1 := r.Deregister(ctx, s); err1 != nil {
|
||||
t.Fatal(err1)
|
||||
}
|
||||
time.Sleep(time.Second)
|
||||
|
||||
res, err = r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(res) != 0 {
|
||||
t.Errorf("not expected empty")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHeartBeat(t *testing.T) {
|
||||
client, err := clientv3.New(clientv3.Config{
|
||||
Endpoints: []string{"127.0.0.1:2379"},
|
||||
DialTimeout: time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
ctx := context.Background()
|
||||
s := ®istry.ServiceInstance{
|
||||
ID: "0",
|
||||
Name: "helloworld",
|
||||
}
|
||||
|
||||
go func() {
|
||||
r := New(client)
|
||||
w, err1 := r.Watch(ctx, s.Name)
|
||||
if err1 != nil {
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
_ = w.Stop()
|
||||
}()
|
||||
for {
|
||||
res, err2 := w.Next()
|
||||
if err2 != nil {
|
||||
return
|
||||
}
|
||||
t.Logf("watch: %d", len(res))
|
||||
for _, r := range res {
|
||||
t.Logf("next: %+v", r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
time.Sleep(time.Second)
|
||||
|
||||
// new a server
|
||||
r := New(client,
|
||||
RegisterTTL(2*time.Second),
|
||||
MaxRetry(5),
|
||||
)
|
||||
|
||||
key := fmt.Sprintf("%s/%s/%s", r.opts.namespace, s.Name, s.ID)
|
||||
value, _ := marshal(s)
|
||||
r.lease = clientv3.NewLease(r.client)
|
||||
leaseID, err := r.registerWithKV(ctx, key, value)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// wait for lease expired
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
res, err := r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(res) != 0 {
|
||||
t.Errorf("not expected empty")
|
||||
}
|
||||
|
||||
go r.heartBeat(ctx, leaseID, key, value)
|
||||
|
||||
time.Sleep(time.Second)
|
||||
res, err = r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(res) == 0 {
|
||||
t.Errorf("reconnect failed")
|
||||
}
|
||||
}
|
||||
20
registry/etcd/service.go
Normal file
20
registry/etcd/service.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
func marshal(si *registry.ServiceInstance) (string, error) {
|
||||
data, err := json.Marshal(si)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(data), nil
|
||||
}
|
||||
|
||||
func unmarshal(data []byte) (si *registry.ServiceInstance, err error) {
|
||||
err = json.Unmarshal(data, &si)
|
||||
return
|
||||
}
|
||||
95
registry/etcd/watcher.go
Normal file
95
registry/etcd/watcher.go
Normal file
@@ -0,0 +1,95 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var _ registry.Watcher = (*watcher)(nil)
|
||||
|
||||
type watcher struct {
|
||||
key string
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
client *clientv3.Client
|
||||
watchChan clientv3.WatchChan
|
||||
watcher clientv3.Watcher
|
||||
kv clientv3.KV
|
||||
first bool
|
||||
serviceName string
|
||||
}
|
||||
|
||||
func newWatcher(ctx context.Context, key, name string, client *clientv3.Client) (*watcher, error) {
|
||||
w := &watcher{
|
||||
key: key,
|
||||
client: client,
|
||||
watcher: clientv3.NewWatcher(client),
|
||||
kv: clientv3.NewKV(client),
|
||||
first: true,
|
||||
serviceName: name,
|
||||
}
|
||||
w.ctx, w.cancel = context.WithCancel(ctx)
|
||||
w.watchChan = w.watcher.Watch(w.ctx, key, clientv3.WithPrefix(), clientv3.WithRev(0), clientv3.WithKeysOnly())
|
||||
err := w.watcher.RequestProgress(w.ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return w, nil
|
||||
}
|
||||
|
||||
func (w *watcher) Next() ([]*registry.ServiceInstance, error) {
|
||||
if w.first {
|
||||
item, err := w.getInstance()
|
||||
w.first = false
|
||||
return item, err
|
||||
}
|
||||
|
||||
select {
|
||||
case <-w.ctx.Done():
|
||||
return nil, w.ctx.Err()
|
||||
case watchResp, ok := <-w.watchChan:
|
||||
if !ok || watchResp.Err() != nil {
|
||||
time.Sleep(time.Second)
|
||||
err := w.reWatch()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return w.getInstance()
|
||||
}
|
||||
}
|
||||
|
||||
func (w *watcher) Stop() error {
|
||||
w.cancel()
|
||||
return w.watcher.Close()
|
||||
}
|
||||
|
||||
func (w *watcher) getInstance() ([]*registry.ServiceInstance, error) {
|
||||
resp, err := w.kv.Get(w.ctx, w.key, clientv3.WithPrefix())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items := make([]*registry.ServiceInstance, 0, len(resp.Kvs))
|
||||
for _, kv := range resp.Kvs {
|
||||
si, err := unmarshal(kv.Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if si.Name != w.serviceName {
|
||||
continue
|
||||
}
|
||||
items = append(items, si)
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
func (w *watcher) reWatch() error {
|
||||
w.watcher.Close()
|
||||
w.watcher = clientv3.NewWatcher(w.client)
|
||||
w.watchChan = w.watcher.Watch(w.ctx, w.key, clientv3.WithPrefix(), clientv3.WithRev(0), clientv3.WithKeysOnly())
|
||||
return w.watcher.RequestProgress(w.ctx)
|
||||
}
|
||||
@@ -1,25 +1,357 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
|
||||
eurekaKratos "github.com/go-kratos/kratos/contrib/registry/eureka/v2"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Eureka
|
||||
func NewRegistry(c *conf.Registry) *eurekaKratos.Registry {
|
||||
var opts []eurekaKratos.Option
|
||||
opts = append(opts, eurekaKratos.WithHeartbeat(c.Eureka.HeartbeatInterval.AsDuration()))
|
||||
opts = append(opts, eurekaKratos.WithRefresh(c.Eureka.RefreshInterval.AsDuration()))
|
||||
opts = append(opts, eurekaKratos.WithEurekaPath(c.Eureka.Path))
|
||||
const (
|
||||
statusUp = "UP"
|
||||
statusDown = "DOWN"
|
||||
statusOutOfService = "OUT_OF_SERVICE"
|
||||
heartbeatRetry = 3
|
||||
maxIdleConns = 100
|
||||
heartbeatTime = 10 * time.Second
|
||||
httpTimeout = 3 * time.Second
|
||||
refreshTime = 30 * time.Second
|
||||
)
|
||||
|
||||
var err error
|
||||
var reg *eurekaKratos.Registry
|
||||
if reg, err = eurekaKratos.New(c.Eureka.Endpoints, opts...); err != nil {
|
||||
log.Fatal(err)
|
||||
type Endpoint struct {
|
||||
InstanceID string
|
||||
IP string
|
||||
AppID string
|
||||
Port int
|
||||
SecurePort int
|
||||
HomePageURL string
|
||||
StatusPageURL string
|
||||
HealthCheckURL string
|
||||
MetaData map[string]string
|
||||
}
|
||||
|
||||
// ApplicationsRootResponse for /eureka/apps
|
||||
type ApplicationsRootResponse struct {
|
||||
ApplicationsResponse `json:"applications"`
|
||||
}
|
||||
|
||||
type ApplicationsResponse struct {
|
||||
Version string `json:"versions__delta"`
|
||||
AppsHashcode string `json:"apps__hashcode"`
|
||||
Applications []Application `json:"application"`
|
||||
}
|
||||
|
||||
type Application struct {
|
||||
Name string `json:"name"`
|
||||
Instance []Instance `json:"instance"`
|
||||
}
|
||||
|
||||
type RequestInstance struct {
|
||||
Instance Instance `json:"instance"`
|
||||
}
|
||||
|
||||
type Instance struct {
|
||||
InstanceID string `json:"instanceId"`
|
||||
HostName string `json:"hostName"`
|
||||
Port Port `json:"port"`
|
||||
App string `json:"app"`
|
||||
IPAddr string `json:"ipAddr"`
|
||||
VipAddress string `json:"vipAddress"`
|
||||
Status string `json:"status"`
|
||||
SecurePort Port `json:"securePort"`
|
||||
HomePageURL string `json:"homePageUrl"`
|
||||
StatusPageURL string `json:"statusPageUrl"`
|
||||
HealthCheckURL string `json:"healthCheckUrl"`
|
||||
DataCenterInfo DataCenterInfo `json:"dataCenterInfo"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
type Port struct {
|
||||
Port int `json:"$"`
|
||||
Enabled string `json:"@enabled"`
|
||||
}
|
||||
|
||||
type DataCenterInfo struct {
|
||||
Name string `json:"name"`
|
||||
Class string `json:"@class"`
|
||||
}
|
||||
|
||||
var _ APIInterface = (*Client)(nil)
|
||||
|
||||
type APIInterface interface {
|
||||
Register(ctx context.Context, ep Endpoint) error
|
||||
Deregister(ctx context.Context, appID, instanceID string) error
|
||||
Heartbeat(ep Endpoint)
|
||||
FetchApps(ctx context.Context) []Application
|
||||
FetchAllUpInstances(ctx context.Context) []Instance
|
||||
FetchAppInstances(ctx context.Context, appID string) (m Application, err error)
|
||||
FetchAppUpInstances(ctx context.Context, appID string) []Instance
|
||||
FetchAppInstance(ctx context.Context, appID string, instanceID string) (m Instance, err error)
|
||||
FetchInstance(ctx context.Context, instanceID string) (m Instance, err error)
|
||||
Out(ctx context.Context, appID, instanceID string) error
|
||||
Down(ctx context.Context, appID, instanceID string) error
|
||||
}
|
||||
|
||||
type ClientOption func(e *Client)
|
||||
|
||||
func WithMaxRetry(maxRetry int) ClientOption {
|
||||
return func(e *Client) { e.maxRetry = maxRetry }
|
||||
}
|
||||
|
||||
func WithHeartbeatInterval(interval time.Duration) ClientOption {
|
||||
return func(e *Client) {
|
||||
e.heartbeatInterval = interval
|
||||
}
|
||||
}
|
||||
|
||||
func WithClientContext(ctx context.Context) ClientOption {
|
||||
return func(e *Client) { e.ctx = ctx }
|
||||
}
|
||||
|
||||
func WithNamespace(path string) ClientOption {
|
||||
return func(e *Client) { e.eurekaPath = path }
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
ctx context.Context
|
||||
urls []string
|
||||
eurekaPath string
|
||||
maxRetry int
|
||||
heartbeatInterval time.Duration
|
||||
client *http.Client
|
||||
keepalive map[string]chan struct{}
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
func NewClient(urls []string, opts ...ClientOption) *Client {
|
||||
tr := &http.Transport{
|
||||
MaxIdleConns: maxIdleConns,
|
||||
}
|
||||
|
||||
return reg
|
||||
e := &Client{
|
||||
ctx: context.Background(),
|
||||
urls: urls,
|
||||
eurekaPath: "eureka/v2",
|
||||
maxRetry: len(urls),
|
||||
heartbeatInterval: heartbeatTime,
|
||||
client: &http.Client{Transport: tr, Timeout: httpTimeout},
|
||||
keepalive: make(map[string]chan struct{}),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(e)
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *Client) FetchApps(ctx context.Context) []Application {
|
||||
var m ApplicationsRootResponse
|
||||
if err := e.do(ctx, http.MethodGet, []string{"apps"}, nil, &m); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return m.Applications
|
||||
}
|
||||
|
||||
func (e *Client) FetchAppInstances(ctx context.Context, appID string) (m Application, err error) {
|
||||
err = e.do(ctx, http.MethodGet, []string{"apps", appID}, nil, &m)
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Client) FetchAppUpInstances(ctx context.Context, appID string) []Instance {
|
||||
app, err := e.FetchAppInstances(ctx, appID)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return e.filterUp(app)
|
||||
}
|
||||
|
||||
func (e *Client) FetchAppInstance(ctx context.Context, appID string, instanceID string) (m Instance, err error) {
|
||||
err = e.do(ctx, http.MethodGet, []string{"apps", appID, instanceID}, nil, &m)
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Client) FetchInstance(ctx context.Context, instanceID string) (m Instance, err error) {
|
||||
err = e.do(ctx, http.MethodGet, []string{"instances", instanceID}, nil, &m)
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Client) Out(ctx context.Context, appID, instanceID string) error {
|
||||
return e.do(ctx, http.MethodPut, []string{"apps", appID, instanceID, fmt.Sprintf("status?value=%s", statusOutOfService)}, nil, nil)
|
||||
}
|
||||
|
||||
func (e *Client) Down(ctx context.Context, appID, instanceID string) error {
|
||||
return e.do(ctx, http.MethodPut, []string{"apps", appID, instanceID, fmt.Sprintf("status?value=%s", statusDown)}, nil, nil)
|
||||
}
|
||||
|
||||
func (e *Client) FetchAllUpInstances(ctx context.Context) []Instance {
|
||||
return e.filterUp(e.FetchApps(ctx)...)
|
||||
}
|
||||
|
||||
func (e *Client) Register(ctx context.Context, ep Endpoint) error {
|
||||
return e.registerEndpoint(ctx, ep)
|
||||
}
|
||||
|
||||
func (e *Client) Deregister(ctx context.Context, appID, instanceID string) error {
|
||||
if err := e.do(ctx, http.MethodDelete, []string{"apps", appID, instanceID}, nil, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
go e.cancelHeartbeat(appID)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *Client) registerEndpoint(ctx context.Context, ep Endpoint) error {
|
||||
instance := RequestInstance{
|
||||
Instance: Instance{
|
||||
InstanceID: ep.InstanceID,
|
||||
HostName: ep.AppID,
|
||||
Port: Port{
|
||||
Port: ep.Port,
|
||||
Enabled: "true",
|
||||
},
|
||||
App: ep.AppID,
|
||||
IPAddr: ep.IP,
|
||||
VipAddress: ep.AppID,
|
||||
Status: statusUp,
|
||||
SecurePort: Port{
|
||||
Port: ep.SecurePort,
|
||||
Enabled: "false",
|
||||
},
|
||||
HomePageURL: ep.HomePageURL,
|
||||
StatusPageURL: ep.StatusPageURL,
|
||||
HealthCheckURL: ep.HealthCheckURL,
|
||||
DataCenterInfo: DataCenterInfo{
|
||||
Name: "MyOwn",
|
||||
Class: "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
|
||||
},
|
||||
Metadata: ep.MetaData,
|
||||
},
|
||||
}
|
||||
|
||||
body, err := json.Marshal(instance)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return e.do(ctx, http.MethodPost, []string{"apps", ep.AppID}, bytes.NewReader(body), nil)
|
||||
}
|
||||
|
||||
func (e *Client) Heartbeat(ep Endpoint) {
|
||||
e.lock.Lock()
|
||||
e.keepalive[ep.AppID] = make(chan struct{})
|
||||
e.lock.Unlock()
|
||||
|
||||
ticker := time.NewTicker(e.heartbeatInterval)
|
||||
defer ticker.Stop()
|
||||
retryCount := 0
|
||||
for {
|
||||
select {
|
||||
case <-e.ctx.Done():
|
||||
return
|
||||
case <-e.keepalive[ep.AppID]:
|
||||
return
|
||||
case <-ticker.C:
|
||||
if err := e.do(e.ctx, http.MethodPut, []string{"apps", ep.AppID, ep.InstanceID}, nil, nil); err != nil {
|
||||
if retryCount++; retryCount > heartbeatRetry {
|
||||
_ = e.registerEndpoint(e.ctx, ep)
|
||||
retryCount = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Client) cancelHeartbeat(appID string) {
|
||||
e.lock.Lock()
|
||||
defer e.lock.Unlock()
|
||||
if ch, ok := e.keepalive[appID]; ok {
|
||||
ch <- struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Client) filterUp(apps ...Application) (res []Instance) {
|
||||
for _, app := range apps {
|
||||
for _, ins := range app.Instance {
|
||||
if ins.Status == statusUp {
|
||||
res = append(res, ins)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Client) pickServer(currentTimes int) string {
|
||||
return e.urls[currentTimes%e.maxRetry]
|
||||
}
|
||||
|
||||
func (e *Client) shuffle() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
rand.Shuffle(len(e.urls), func(i, j int) {
|
||||
e.urls[i], e.urls[j] = e.urls[j], e.urls[i]
|
||||
})
|
||||
}
|
||||
|
||||
func (e *Client) buildAPI(currentTimes int, params ...string) string {
|
||||
if currentTimes == 0 {
|
||||
e.shuffle()
|
||||
}
|
||||
server := e.pickServer(currentTimes)
|
||||
params = append([]string{server, e.eurekaPath}, params...)
|
||||
return strings.Join(params, "/")
|
||||
}
|
||||
|
||||
func (e *Client) request(ctx context.Context, method string, params []string, input io.Reader, output interface{}, i int) (bool, error) {
|
||||
request, err := http.NewRequestWithContext(ctx, method, e.buildAPI(i, params...), input)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
request.Header.Add("User-Agent", "go-eureka-client")
|
||||
request.Header.Add("Accept", "application/json;charset=UTF-8")
|
||||
request.Header.Add("Content-Type", "application/json;charset=UTF-8")
|
||||
resp, err := e.client.Do(request)
|
||||
if err != nil {
|
||||
return true, err
|
||||
}
|
||||
defer func() {
|
||||
_, _ = io.Copy(io.Discard, resp.Body)
|
||||
_ = resp.Body.Close()
|
||||
}()
|
||||
|
||||
if output != nil && resp.StatusCode/100 == 2 {
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
err = json.Unmarshal(data, output)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
|
||||
if resp.StatusCode >= http.StatusBadRequest {
|
||||
return false, fmt.Errorf("response Error %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (e *Client) do(ctx context.Context, method string, params []string, input io.Reader, output interface{}) error {
|
||||
for i := 0; i < e.maxRetry; i++ {
|
||||
retry, err := e.request(ctx, method, params, input, output, i)
|
||||
if retry {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("retry after %d times", e.maxRetry)
|
||||
}
|
||||
|
||||
44
registry/eureka/client_creator.go
Normal file
44
registry/eureka/client_creator.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
r "github.com/tx7do/kratos-bootstrap/registry"
|
||||
)
|
||||
|
||||
func init() {
|
||||
r.RegisterRegistrarCreator(string(r.Eureka), func(c *conf.Registry) registry.Registrar {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
r.RegisterDiscoveryCreator(string(r.Eureka), func(c *conf.Registry) registry.Discovery {
|
||||
return NewRegistry(c)
|
||||
})
|
||||
}
|
||||
|
||||
// NewRegistry 创建一个注册发现客户端 - Eureka
|
||||
func NewRegistry(c *conf.Registry) *Registry {
|
||||
if c == nil || c.Eureka == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var opts []Option
|
||||
if c.Eureka.HeartbeatInterval != nil {
|
||||
opts = append(opts, WithHeartbeat(c.Eureka.HeartbeatInterval.AsDuration()))
|
||||
}
|
||||
if c.Eureka.RefreshInterval != nil {
|
||||
opts = append(opts, WithRefresh(c.Eureka.RefreshInterval.AsDuration()))
|
||||
}
|
||||
if c.Eureka.Path != "" {
|
||||
opts = append(opts, WithEurekaPath(c.Eureka.Path))
|
||||
}
|
||||
|
||||
var err error
|
||||
var reg *Registry
|
||||
if reg, err = New(c.Eureka.Endpoints, opts...); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return reg
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewEurekaRegistry(t *testing.T) {
|
||||
var cfg conf.Registry
|
||||
cfg.Eureka.Endpoints = []string{"https://127.0.0.1:18761"}
|
||||
cfg := conf.Registry{
|
||||
Eureka: &conf.Registry_Eureka{
|
||||
Endpoints: []string{"https://127.0.0.1:18761"},
|
||||
},
|
||||
}
|
||||
|
||||
reg := NewRegistry(&cfg)
|
||||
assert.Nil(t, reg)
|
||||
assert.NotNil(t, reg)
|
||||
}
|
||||
137
registry/eureka/eureka.go
Normal file
137
registry/eureka/eureka.go
Normal file
@@ -0,0 +1,137 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type subscriber struct {
|
||||
appID string
|
||||
callBack func()
|
||||
}
|
||||
|
||||
type API struct {
|
||||
cli *Client
|
||||
allInstances map[string][]Instance
|
||||
subscribers map[string]*subscriber
|
||||
refreshInterval time.Duration
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
func NewAPI(ctx context.Context, client *Client, refreshInterval time.Duration) *API {
|
||||
e := &API{
|
||||
cli: client,
|
||||
allInstances: make(map[string][]Instance),
|
||||
subscribers: make(map[string]*subscriber),
|
||||
refreshInterval: refreshInterval,
|
||||
}
|
||||
|
||||
// it is required to broadcast for the first time
|
||||
go e.broadcast()
|
||||
|
||||
go e.refresh(ctx)
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *API) refresh(ctx context.Context) {
|
||||
ticker := time.NewTicker(e.refreshInterval)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-ticker.C:
|
||||
e.broadcast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *API) broadcast() {
|
||||
instances := e.cacheAllInstances()
|
||||
if instances == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, subscriber := range e.subscribers {
|
||||
go subscriber.callBack()
|
||||
}
|
||||
defer e.lock.Unlock()
|
||||
e.lock.Lock()
|
||||
e.allInstances = instances
|
||||
}
|
||||
|
||||
func (e *API) cacheAllInstances() map[string][]Instance {
|
||||
items := make(map[string][]Instance)
|
||||
instances := e.cli.FetchAllUpInstances(context.Background())
|
||||
for _, instance := range instances {
|
||||
items[e.ToAppID(instance.App)] = append(items[instance.App], instance)
|
||||
}
|
||||
|
||||
return items
|
||||
}
|
||||
|
||||
func (e *API) Register(ctx context.Context, serviceName string, endpoints ...Endpoint) error {
|
||||
appID := e.ToAppID(serviceName)
|
||||
upInstances := make(map[string]struct{})
|
||||
|
||||
for _, ins := range e.GetService(ctx, appID) {
|
||||
upInstances[ins.InstanceID] = struct{}{}
|
||||
}
|
||||
|
||||
for _, ep := range endpoints {
|
||||
if _, ok := upInstances[ep.InstanceID]; !ok {
|
||||
if err := e.cli.Register(ctx, ep); err != nil {
|
||||
return err
|
||||
}
|
||||
go e.cli.Heartbeat(ep)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deregister ctx is the same as register ctx
|
||||
func (e *API) Deregister(ctx context.Context, endpoints []Endpoint) error {
|
||||
for _, ep := range endpoints {
|
||||
if err := e.cli.Deregister(ctx, ep.AppID, ep.InstanceID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *API) Subscribe(serverName string, fn func()) error {
|
||||
e.lock.Lock()
|
||||
defer e.lock.Unlock()
|
||||
appID := e.ToAppID(serverName)
|
||||
e.subscribers[appID] = &subscriber{
|
||||
appID: appID,
|
||||
callBack: fn,
|
||||
}
|
||||
go e.broadcast()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *API) GetService(ctx context.Context, serverName string) []Instance {
|
||||
appID := e.ToAppID(serverName)
|
||||
if ins, ok := e.allInstances[appID]; ok {
|
||||
return ins
|
||||
}
|
||||
|
||||
// if not in allInstances of API, you can try to obtain it separately again
|
||||
return e.cli.FetchAppUpInstances(ctx, appID)
|
||||
}
|
||||
|
||||
func (e *API) Unsubscribe(serverName string) {
|
||||
e.lock.Lock()
|
||||
defer e.lock.Unlock()
|
||||
delete(e.subscribers, e.ToAppID(serverName))
|
||||
}
|
||||
|
||||
func (e *API) ToAppID(serverName string) string {
|
||||
return strings.ToUpper(serverName)
|
||||
}
|
||||
30
registry/eureka/go.mod
Normal file
30
registry/eureka/go.mod
Normal file
@@ -0,0 +1,30 @@
|
||||
module github.com/tx7do/kratos-bootstrap/registry/eureka
|
||||
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.4.1
|
||||
|
||||
github.com/tx7do/kratos-bootstrap/api => ../../api
|
||||
github.com/tx7do/kratos-bootstrap/registry => ../
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-kratos/kratos/v2 v2.8.4
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/tx7do/kratos-bootstrap/api v0.0.21
|
||||
github.com/tx7do/kratos-bootstrap/registry v0.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
26
registry/eureka/go.sum
Normal file
26
registry/eureka/go.sum
Normal file
@@ -0,0 +1,26 @@
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4 h1:eIJLE9Qq9WSoKx+Buy2uPyrahtF/lPh+Xf4MTpxhmjs=
|
||||
github.com/go-kratos/kratos/v2 v2.8.4/go.mod h1:mq62W2101a5uYyRxe+7IdWubu7gZCGYqSNKwGFiiRcw=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
25
registry/eureka/options.go
Normal file
25
registry/eureka/options.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Option func(o *Registry)
|
||||
|
||||
// WithContext with registry context.
|
||||
func WithContext(ctx context.Context) Option {
|
||||
return func(o *Registry) { o.ctx = ctx }
|
||||
}
|
||||
|
||||
func WithHeartbeat(interval time.Duration) Option {
|
||||
return func(o *Registry) { o.heartbeatInterval = interval }
|
||||
}
|
||||
|
||||
func WithRefresh(interval time.Duration) Option {
|
||||
return func(o *Registry) { o.refreshInterval = interval }
|
||||
}
|
||||
|
||||
func WithEurekaPath(path string) Option {
|
||||
return func(o *Registry) { o.eurekaPath = path }
|
||||
}
|
||||
124
registry/eureka/register.go
Normal file
124
registry/eureka/register.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var (
|
||||
_ registry.Registrar = (*Registry)(nil)
|
||||
_ registry.Discovery = (*Registry)(nil)
|
||||
)
|
||||
|
||||
type Registry struct {
|
||||
ctx context.Context
|
||||
api *API
|
||||
heartbeatInterval time.Duration
|
||||
refreshInterval time.Duration
|
||||
eurekaPath string
|
||||
}
|
||||
|
||||
func New(eurekaUrls []string, opts ...Option) (*Registry, error) {
|
||||
r := &Registry{
|
||||
ctx: context.Background(),
|
||||
heartbeatInterval: heartbeatTime,
|
||||
refreshInterval: refreshTime,
|
||||
eurekaPath: "eureka/v2",
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(r)
|
||||
}
|
||||
|
||||
client := NewClient(eurekaUrls, WithHeartbeatInterval(r.heartbeatInterval), WithClientContext(r.ctx), WithNamespace(r.eurekaPath))
|
||||
r.api = NewAPI(r.ctx, client, r.refreshInterval)
|
||||
return r, nil
|
||||
}
|
||||
|
||||
// Register 这里的Context是每个注册器独享的
|
||||
func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error {
|
||||
return r.api.Register(ctx, service.Name, r.Endpoints(service)...)
|
||||
}
|
||||
|
||||
// Deregister registry service to zookeeper.
|
||||
func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error {
|
||||
return r.api.Deregister(ctx, r.Endpoints(service))
|
||||
}
|
||||
|
||||
// GetService get services from zookeeper
|
||||
func (r *Registry) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error) {
|
||||
instances := r.api.GetService(ctx, serviceName)
|
||||
items := make([]*registry.ServiceInstance, 0, len(instances))
|
||||
for _, instance := range instances {
|
||||
items = append(items, ®istry.ServiceInstance{
|
||||
ID: instance.Metadata["ID"],
|
||||
Name: instance.Metadata["Name"],
|
||||
Version: instance.Metadata["Version"],
|
||||
Endpoints: []string{instance.Metadata["Endpoints"]},
|
||||
Metadata: instance.Metadata,
|
||||
})
|
||||
}
|
||||
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// Watch 是独立的ctx
|
||||
func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error) {
|
||||
return newWatch(ctx, r.api, serviceName)
|
||||
}
|
||||
|
||||
func (r *Registry) Endpoints(service *registry.ServiceInstance) []Endpoint {
|
||||
res := make([]Endpoint, 0, len(service.Endpoints))
|
||||
for _, ep := range service.Endpoints {
|
||||
start := strings.Index(ep, "//")
|
||||
end := strings.LastIndex(ep, ":")
|
||||
appID := strings.ToUpper(service.Name)
|
||||
ip := ep[start+2 : end]
|
||||
sport := ep[end+1:]
|
||||
port, _ := strconv.Atoi(sport)
|
||||
securePort := 443
|
||||
homePageURL := fmt.Sprintf("%s/", ep)
|
||||
statusPageURL := fmt.Sprintf("%s/info", ep)
|
||||
healthCheckURL := fmt.Sprintf("%s/health", ep)
|
||||
instanceID := strings.Join([]string{ip, appID, sport}, ":")
|
||||
metadata := make(map[string]string)
|
||||
if len(service.Metadata) > 0 {
|
||||
metadata = service.Metadata
|
||||
}
|
||||
if s, ok := service.Metadata["securePort"]; ok {
|
||||
securePort, _ = strconv.Atoi(s)
|
||||
}
|
||||
if s, ok := service.Metadata["homePageURL"]; ok {
|
||||
homePageURL = s
|
||||
}
|
||||
if s, ok := service.Metadata["statusPageURL"]; ok {
|
||||
statusPageURL = s
|
||||
}
|
||||
if s, ok := service.Metadata["healthCheckURL"]; ok {
|
||||
healthCheckURL = s
|
||||
}
|
||||
metadata["ID"] = service.ID
|
||||
metadata["Name"] = service.Name
|
||||
metadata["Version"] = service.Version
|
||||
metadata["Endpoints"] = ep
|
||||
metadata["agent"] = "go-eureka-client"
|
||||
res = append(res, Endpoint{
|
||||
AppID: appID,
|
||||
IP: ip,
|
||||
Port: port,
|
||||
SecurePort: securePort,
|
||||
HomePageURL: homePageURL,
|
||||
StatusPageURL: statusPageURL,
|
||||
HealthCheckURL: healthCheckURL,
|
||||
InstanceID: instanceID,
|
||||
MetaData: metadata,
|
||||
})
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
114
registry/eureka/register_test.go
Normal file
114
registry/eureka/register_test.go
Normal file
@@ -0,0 +1,114 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
func TestRegistry(_ *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
s1 := ®istry.ServiceInstance{
|
||||
ID: "0",
|
||||
Name: "helloworld",
|
||||
Endpoints: []string{"http://127.0.0.1:1111"},
|
||||
}
|
||||
s2 := ®istry.ServiceInstance{
|
||||
ID: "0",
|
||||
Name: "helloworld2",
|
||||
Endpoints: []string{"http://127.0.0.1:222"},
|
||||
}
|
||||
|
||||
r, _ := New([]string{"https://127.0.0.1:18761"}, WithContext(ctx), WithHeartbeat(time.Second), WithRefresh(time.Second), WithEurekaPath("eureka"))
|
||||
|
||||
go do(r, s1)
|
||||
go do(r, s2)
|
||||
|
||||
time.Sleep(time.Second * 20)
|
||||
cancel()
|
||||
time.Sleep(time.Second * 1)
|
||||
}
|
||||
|
||||
func do(r *Registry, s *registry.ServiceInstance) {
|
||||
w, err := r.Watch(context.Background(), s.Name)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = w.Stop()
|
||||
}()
|
||||
go func() {
|
||||
for {
|
||||
res, nextErr := w.Next()
|
||||
if nextErr != nil {
|
||||
return
|
||||
}
|
||||
log.Printf("watch: %d", len(res))
|
||||
for _, r := range res {
|
||||
log.Printf("next: %+v", r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
if err = r.Register(ctx, s); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
time.Sleep(time.Second * 10)
|
||||
res, err := r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for i, re := range res {
|
||||
log.Printf("first %d re:%v\n", i, re)
|
||||
}
|
||||
|
||||
if len(res) != 1 && res[0].Name != s.Name {
|
||||
log.Fatalf("not expected: %+v", res)
|
||||
}
|
||||
|
||||
if err = r.Deregister(ctx, s); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cancel()
|
||||
time.Sleep(time.Second * 10)
|
||||
|
||||
res, err = r.GetService(ctx, s.Name)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for i, re := range res {
|
||||
log.Printf("second %d re:%v\n", i, re)
|
||||
}
|
||||
if len(res) != 0 {
|
||||
log.Fatalf("not expected empty")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLock(_ *testing.T) {
|
||||
type me struct {
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
a := &me{}
|
||||
go func() {
|
||||
defer a.lock.Unlock()
|
||||
a.lock.Lock()
|
||||
fmt.Println("This is fmt first.")
|
||||
time.Sleep(time.Second * 5)
|
||||
}()
|
||||
go func() {
|
||||
defer a.lock.Unlock()
|
||||
a.lock.Lock()
|
||||
fmt.Println("This is fmt second.")
|
||||
time.Sleep(time.Second * 5)
|
||||
}()
|
||||
time.Sleep(time.Second * 10)
|
||||
}
|
||||
60
registry/eureka/watcher.go
Normal file
60
registry/eureka/watcher.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package eureka
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var _ registry.Watcher = (*watcher)(nil)
|
||||
|
||||
type watcher struct {
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
cli *API
|
||||
watchChan chan struct{}
|
||||
serverName string
|
||||
}
|
||||
|
||||
func newWatch(ctx context.Context, cli *API, serverName string) (*watcher, error) {
|
||||
w := &watcher{
|
||||
ctx: ctx,
|
||||
cli: cli,
|
||||
serverName: serverName,
|
||||
watchChan: make(chan struct{}, 1),
|
||||
}
|
||||
w.ctx, w.cancel = context.WithCancel(ctx)
|
||||
e := w.cli.Subscribe(
|
||||
serverName,
|
||||
func() {
|
||||
w.watchChan <- struct{}{}
|
||||
},
|
||||
)
|
||||
return w, e
|
||||
}
|
||||
|
||||
func (w *watcher) Next() (services []*registry.ServiceInstance, err error) {
|
||||
select {
|
||||
case <-w.ctx.Done():
|
||||
return nil, w.ctx.Err()
|
||||
case <-w.watchChan:
|
||||
instances := w.cli.GetService(w.ctx, w.serverName)
|
||||
services = make([]*registry.ServiceInstance, 0, len(instances))
|
||||
for _, instance := range instances {
|
||||
services = append(services, ®istry.ServiceInstance{
|
||||
ID: instance.Metadata["ID"],
|
||||
Name: instance.Metadata["Name"],
|
||||
Version: instance.Metadata["Version"],
|
||||
Endpoints: []string{instance.Metadata["Endpoints"]},
|
||||
Metadata: instance.Metadata,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (w *watcher) Stop() error {
|
||||
w.cancel()
|
||||
w.cli.Unsubscribe(w.serverName)
|
||||
return nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user