first commit

v2.6.3-h v2.6.30
nikkiing 1 year ago
parent 32b1d13f90
commit c7a428cae1
  1. 2
      README.md
  2. 8
      README_zh.md
  3. 2
      api/metadata/metadata.proto
  4. 4
      api/metadata/metadata_http.pb.go
  5. 2
      api/metadata/server.go
  6. 6
      app.go
  7. 6
      app_test.go
  8. 2
      cmd/kratos/internal/base/mod.go
  9. 6
      cmd/kratos/internal/base/mod_test.go
  10. 2
      cmd/protoc-gen-go-errors/errors.go
  11. 2
      cmd/protoc-gen-go-errors/errors/errors.proto
  12. 4
      cmd/protoc-gen-go-http/http.go
  13. 10
      config/config.go
  14. 2
      config/env/env.go
  15. 4
      config/env/env_test.go
  16. 2
      config/env/watcher.go
  17. 2
      config/file/file.go
  18. 2
      config/file/file_test.go
  19. 2
      config/file/watcher.go
  20. 4
      config/options.go
  21. 2
      config/reader.go
  22. 2
      config/reader_test.go
  23. 2
      config/value.go
  24. 2
      contrib/config/apollo/README.md
  25. 7
      contrib/config/apollo/apollo.go
  26. 4
      contrib/config/apollo/go.mod
  27. 6
      contrib/config/apollo/watcher.go
  28. 2
      contrib/config/consul/config.go
  29. 2
      contrib/config/consul/config_test.go
  30. 4
      contrib/config/consul/go.mod
  31. 2
      contrib/config/consul/watcher.go
  32. 2
      contrib/config/etcd/README.md
  33. 2
      contrib/config/etcd/config.go
  34. 4
      contrib/config/etcd/go.mod
  35. 2
      contrib/config/etcd/watcher.go
  36. 2
      contrib/config/kubernetes/config.go
  37. 2
      contrib/config/kubernetes/config_test.go
  38. 4
      contrib/config/kubernetes/go.mod
  39. 2
      contrib/config/kubernetes/watcher.go
  40. 2
      contrib/config/nacos/README.md
  41. 2
      contrib/config/nacos/config.go
  42. 2
      contrib/config/nacos/config_test.go
  43. 4
      contrib/config/nacos/go.mod
  44. 2
      contrib/config/nacos/watcher.go
  45. 4
      contrib/config/polaris/config.go
  46. 4
      contrib/config/polaris/go.mod
  47. 5
      contrib/config/polaris/watcher.go
  48. 4
      contrib/encoding/msgpack/go.mod
  49. 4
      contrib/encoding/msgpack/msgpack.go
  50. 2
      contrib/log/aliyun/aliyun.go
  51. 2
      contrib/log/aliyun/aliyun_test.go
  52. 4
      contrib/log/aliyun/go.mod
  53. 2
      contrib/log/fluent/fluent.go
  54. 2
      contrib/log/fluent/fluent_test.go
  55. 4
      contrib/log/fluent/go.mod
  56. 4
      contrib/log/logrus/go.mod
  57. 2
      contrib/log/logrus/logrus.go
  58. 2
      contrib/log/logrus/logrus_test.go
  59. 4
      contrib/log/tencent/go.mod
  60. 2
      contrib/log/tencent/tencent.go
  61. 2
      contrib/log/tencent/tencent_test.go
  62. 4
      contrib/log/zap/go.mod
  63. 2
      contrib/log/zap/zap.go
  64. 2
      contrib/log/zap/zap_test.go
  65. 2
      contrib/metrics/datadog/counter.go
  66. 2
      contrib/metrics/datadog/gauge.go
  67. 4
      contrib/metrics/datadog/go.mod
  68. 2
      contrib/metrics/datadog/observer.go
  69. 2
      contrib/metrics/prometheus/counter.go
  70. 2
      contrib/metrics/prometheus/gauge.go
  71. 4
      contrib/metrics/prometheus/go.mod
  72. 2
      contrib/metrics/prometheus/histogram.go
  73. 2
      contrib/metrics/prometheus/summary.go
  74. 4
      contrib/opensergo/go.mod
  75. 2
      contrib/opensergo/opensergo.go
  76. 5
      contrib/polaris/config.go
  77. 4
      contrib/polaris/config_test.go
  78. 4
      contrib/polaris/go.mod
  79. 3
      contrib/polaris/polaris.go
  80. 8
      contrib/polaris/ratelimit.go
  81. 3
      contrib/polaris/registry.go
  82. 4
      contrib/polaris/registry_test.go
  83. 10
      contrib/polaris/router.go
  84. 7
      contrib/polaris/router_test.go
  85. 4
      contrib/registry/consul/client.go
  86. 4
      contrib/registry/consul/go.mod
  87. 2
      contrib/registry/consul/registry.go
  88. 2
      contrib/registry/consul/registry_test.go
  89. 2
      contrib/registry/consul/service.go
  90. 2
      contrib/registry/consul/watcher.go
  91. 2
      contrib/registry/discovery/README.md
  92. 3
      contrib/registry/discovery/discovery.go
  93. 2
      contrib/registry/discovery/discovery_helper.go
  94. 4
      contrib/registry/discovery/go.mod
  95. 2
      contrib/registry/discovery/impl_discover.go
  96. 4
      contrib/registry/discovery/impl_registrar.go
  97. 4
      contrib/registry/etcd/go.mod
  98. 2
      contrib/registry/etcd/registry.go
  99. 2
      contrib/registry/etcd/registry_test.go
  100. 2
      contrib/registry/etcd/service.go
  101. Some files were not shown because too many files have changed in this diff Show More

@ -2,7 +2,7 @@
<p align="center">
<a href="https://github.com/go-kratos/kratos/actions"><img src="https://github.com/go-kratos/kratos/workflows/Go/badge.svg" alt="Build Status"></a>
<a href="https://pkg.go.dev/github.com/go-kratos/kratos/v2"><img src="https://pkg.go.dev/badge/github.com/go-kratos/kratos/v2" alt="GoDoc"></a>
<a href="https://pkg.go.dev/gitea.drugeyes.vip/pharnexbase/kratos/v2"><img src="https://pkg.go.dev/badge/gitea.drugeyes.vip/pharnexbase/kratos/v2" alt="GoDoc"></a>
<a href="https://codecov.io/gh/go-kratos/kratos"><img src="https://codecov.io/gh/go-kratos/kratos/master/graph/badge.svg" alt="codeCov"></a>
<a href="https://goreportcard.com/report/github.com/go-kratos/kratos"><img src="https://goreportcard.com/badge/github.com/go-kratos/kratos" alt="Go Report Card"></a>
<a href="https://github.com/go-kratos/kratos/blob/main/LICENSE"><img src="https://img.shields.io/github/license/go-kratos/kratos" alt="License"></a>

@ -2,7 +2,7 @@
<p align="center">
<a href="https://github.com/go-kratos/kratos/actions"><img src="https://github.com/go-kratos/kratos/workflows/Go/badge.svg" alt="Build Status"></a>
<a href="https://pkg.go.dev/github.com/go-kratos/kratos/v2"><img src="https://pkg.go.dev/badge/github.com/go-kratos/kratos/v2" alt="GoDoc"></a>
<a href="https://pkg.go.dev/gitea.drugeyes.vip/pharnexbase/kratos/v2"><img src="https://pkg.go.dev/badge/gitea.drugeyes.vip/pharnexbase/kratos/v2" alt="GoDoc"></a>
<a href="https://codecov.io/gh/go-kratos/kratos"><img src="https://codecov.io/gh/go-kratos/kratos/master/graph/badge.svg" alt="codeCov"></a>
<a href="https://goreportcard.com/report/github.com/go-kratos/kratos"><img src="https://goreportcard.com/badge/github.com/go-kratos/kratos" alt="Go Report Card"></a>
<a href="https://github.com/go-kratos/kratos/blob/main/LICENSE"><img src="https://img.shields.io/github/license/go-kratos/kratos" alt="License"></a>
@ -95,9 +95,9 @@ kratos run
### Kratos Boot
```
import "github.com/go-kratos/kratos/v2"
import "github.com/go-kratos/kratos/v2/transport/grpc"
import "github.com/go-kratos/kratos/v2/transport/http"
import "gitea.drugeyes.vip/pharnexbase/kratos/v2"
import "gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/grpc"
import "gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http"
httpSrv := http.NewServer(http.Address(":8000"))
grpcSrv := grpc.NewServer(grpc.Address(":9000"))

@ -5,7 +5,7 @@ package kratos.api;
import "google/protobuf/descriptor.proto";
import "google/api/annotations.proto";
option go_package = "github.com/go-kratos/kratos/v2/api/proto/kratos/api;metadata";
option go_package = "gitea.drugeyes.vip/pharnexbase/kratos/v2/api/proto/kratos/api;metadata";
option java_multiple_files = true;
option java_package = "com.github.kratos.api";
option objc_class_prefix = "KratosAPI";

@ -6,8 +6,8 @@ package metadata
import (
context "context"
http "github.com/go-kratos/kratos/v2/transport/http"
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
http "gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http"
binding "gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http/binding"
)
// This is a compile-time assertion to ensure that this generated file

@ -19,7 +19,7 @@ import (
"google.golang.org/protobuf/reflect/protoregistry"
dpb "google.golang.org/protobuf/types/descriptorpb"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
// Server is api meta server

@ -9,9 +9,9 @@ import (
"syscall"
"time"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/transport"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport"
"github.com/google/uuid"
"golang.org/x/sync/errgroup"

@ -9,9 +9,9 @@ import (
"testing"
"time"
"github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/go-kratos/kratos/v2/transport/http"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/grpc"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http"
)
type mockRegistry struct {

@ -53,7 +53,7 @@ func KratosMod() string {
if cachePath == "" {
cachePath = filepath.Join(gopath, "pkg", "mod")
}
if path, err := ModuleVersion("github.com/go-kratos/kratos/v2"); err == nil {
if path, err := ModuleVersion("gitea.drugeyes.vip/pharnexbase/kratos/v2"); err == nil {
// $GOPATH/pkg/mod/github.com/go-kratos/kratos@v2
return filepath.Join(cachePath, path)
}

@ -23,7 +23,7 @@ func TestModulePath(t *testing.T) {
t.Fatal(err)
}
mod := `module github.com/go-kratos/kratos/v2
mod := `module gitea.drugeyes.vip/pharnexbase/kratos/v2
go 1.16`
_, err = f.WriteString(mod)
@ -35,8 +35,8 @@ go 1.16`
if err != nil {
t.Fatal(err)
}
if p != "github.com/go-kratos/kratos/v2" {
t.Fatalf("want: %s, got: %s", "github.com/go-kratos/kratos/v2", p)
if p != "gitea.drugeyes.vip/pharnexbase/kratos/v2" {
t.Fatalf("want: %s, got: %s", "gitea.drugeyes.vip/pharnexbase/kratos/v2", p)
}
t.Cleanup(func() { os.RemoveAll("/tmp/test_mod") })

@ -15,7 +15,7 @@ import (
)
const (
errorsPackage = protogen.GoImportPath("github.com/go-kratos/kratos/v2/errors")
errorsPackage = protogen.GoImportPath("gitea.drugeyes.vip/pharnexbase/kratos/v2/errors")
fmtPackage = protogen.GoImportPath("fmt")
)

@ -2,7 +2,7 @@ syntax = "proto3";
package errors;
option go_package = "github.com/go-kratos/kratos/v2/errors;errors";
option go_package = "gitea.drugeyes.vip/pharnexbase/kratos/v2/errors;errors";
option java_multiple_files = true;
option java_package = "com.github.kratos.errors";
option objc_class_prefix = "KratosErrors";

@ -17,8 +17,8 @@ import (
const (
contextPackage = protogen.GoImportPath("context")
transportHTTPPackage = protogen.GoImportPath("github.com/go-kratos/kratos/v2/transport/http")
bindingPackage = protogen.GoImportPath("github.com/go-kratos/kratos/v2/transport/http/binding")
transportHTTPPackage = protogen.GoImportPath("gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http")
bindingPackage = protogen.GoImportPath("gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http/binding")
)
var methodSets = make(map[string]int)

@ -8,11 +8,11 @@ import (
"time"
// init encoding
_ "github.com/go-kratos/kratos/v2/encoding/json"
_ "github.com/go-kratos/kratos/v2/encoding/proto"
_ "github.com/go-kratos/kratos/v2/encoding/xml"
_ "github.com/go-kratos/kratos/v2/encoding/yaml"
"github.com/go-kratos/kratos/v2/log"
_ "gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding/json"
_ "gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding/proto"
_ "gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding/xml"
_ "gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding/yaml"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
var _ Config = (*config)(nil)

2
config/env/env.go vendored

@ -4,7 +4,7 @@ import (
"os"
"strings"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type env struct {

@ -6,8 +6,8 @@ import (
"reflect"
"testing"
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/config/file"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config/file"
)
const _testJSON = `

@ -3,7 +3,7 @@ package env
import (
"context"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
var _ config.Watcher = (*watcher)(nil)

@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
var _ config.Source = (*file)(nil)

@ -9,7 +9,7 @@ import (
"testing"
"time"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
const (

@ -7,7 +7,7 @@ import (
"github.com/fsnotify/fsnotify"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
var _ config.Watcher = (*watcher)(nil)

@ -5,8 +5,8 @@ import (
"regexp"
"strings"
"github.com/go-kratos/kratos/v2/encoding"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
// Decoder is config decoder.

@ -12,7 +12,7 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
// Reader is config reader.

@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"github.com/go-kratos/kratos/v2/encoding"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding"
)
func TestReader_Merge(t *testing.T) {

@ -10,7 +10,7 @@ import (
"google.golang.org/protobuf/proto"
kratosjson "github.com/go-kratos/kratos/v2/encoding/json"
kratosjson "gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding/json"
)
var (

@ -12,7 +12,7 @@ import (
"log"
"github.com/go-kratos/kratos/contrib/config/apollo/v2"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
func main() {

@ -3,14 +3,13 @@ package apollo
import (
"strings"
"github.com/apolloconfig/agollo/v4"
"github.com/apolloconfig/agollo/v4/constant"
apolloconfig "github.com/apolloconfig/agollo/v4/env/config"
"github.com/apolloconfig/agollo/v4/extension"
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/encoding"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type apollo struct {

@ -4,9 +4,9 @@ go 1.16
require (
github.com/apolloconfig/agollo/v4 v4.3.0
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
)
require github.com/spf13/viper v1.11.0 // indirect
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -6,9 +6,9 @@ import (
"github.com/apolloconfig/agollo/v4/storage"
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/encoding"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type watcher struct {

@ -8,7 +8,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
// Option is etcd config option.

@ -7,7 +7,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
const testPath = "kratos/test/config"

@ -4,7 +4,7 @@ go 1.15
require (
github.com/armon/go-metrics v0.3.10 // indirect
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/hashicorp/consul/api v1.20.0
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
@ -12,4 +12,4 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -6,7 +6,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/api/watch"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type watcher struct {

@ -8,7 +8,7 @@ import (
"google.golang.org/grpc"
cfg "github.com/go-kratos/kratos/contrib/config/etcd/v2"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
// create an etcd client

@ -8,7 +8,7 @@ import (
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
// Option is etcd config option.

@ -3,9 +3,9 @@ module github.com/go-kratos/kratos/contrib/config/etcd/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
go.etcd.io/etcd/client/v3 v3.5.8
google.golang.org/grpc v1.56.1
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -5,7 +5,7 @@ import (
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type watcher struct {

@ -13,7 +13,7 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
// Option is kubernetes option.

@ -15,7 +15,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
const (

@ -3,10 +3,10 @@ module github.com/go-kratos/kratos/contrib/config/kubernetes/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -8,7 +8,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type watcher struct {

@ -5,7 +5,7 @@ import (
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/common/constant"
kconfig "github.com/go-kratos/kratos/v2/config"
kconfig "gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)

@ -8,7 +8,7 @@ import (
"github.com/nacos-group/nacos-sdk-go/clients/config_client"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type Option func(*options)

@ -9,7 +9,7 @@ import (
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
func TestConfig_Load(t *testing.T) {

@ -3,10 +3,10 @@ module github.com/go-kratos/kratos/contrib/config/nacos/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/nacos-group/nacos-sdk-go v1.0.9
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../
replace github.com/buger/jsonparser => github.com/buger/jsonparser v1.1.1

@ -7,7 +7,7 @@ import (
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type Watcher struct {

@ -6,9 +6,7 @@ import (
"path/filepath"
"strings"
"github.com/polarismesh/polaris-go"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
// Option is polaris config option.

@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/config/polaris/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/polarismesh/polaris-go v1.1.0
)
@ -16,4 +16,4 @@ require (
go.uber.org/zap v1.21.0 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -5,11 +5,10 @@ import (
"path/filepath"
"strings"
"github.com/polarismesh/polaris-go"
"github.com/polarismesh/polaris-go/pkg/model"
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type Watcher struct {

@ -3,8 +3,8 @@ module github.com/go-kratos/kratos/contrib/encoding/msgpack/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/vmihailenco/msgpack/v5 v5.3.5
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -1,9 +1,7 @@
package msgpack
import (
"github.com/vmihailenco/msgpack/v5"
"github.com/go-kratos/kratos/v2/encoding"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/encoding"
)
// Name is the name registered for the msgpack compressor.

@ -10,7 +10,7 @@ import (
"github.com/aliyun/aliyun-log-go-sdk/producer"
"google.golang.org/protobuf/proto"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
// Logger see more detail https://github.com/aliyun/aliyun-log-go-sdk

@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
func TestWithEndpoint(t *testing.T) {

@ -4,11 +4,11 @@ go 1.16
require (
github.com/aliyun/aliyun-log-go-sdk v0.1.44
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
google.golang.org/protobuf v1.31.0
)
replace (
github.com/go-kratos/kratos/v2 => ../../../
gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../
github.com/gogo/protobuf v1.3.1 => github.com/gogo/protobuf v1.3.2
)

@ -9,7 +9,7 @@ import (
"github.com/fluent/fluent-logger-golang/fluent"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
var _ log.Logger = (*Logger)(nil)

@ -7,7 +7,7 @@ import (
"testing"
"time"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
func TestMain(m *testing.M) {

@ -5,8 +5,8 @@ go 1.16
require (
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/fluent/fluent-logger-golang v1.9.0
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/tinylib/msgp v1.1.6 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -3,8 +3,8 @@ module github.com/go-kratos/kratos/contrib/log/logrus/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/sirupsen/logrus v1.8.1
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -3,7 +3,7 @@ package logrus
import (
"github.com/sirupsen/logrus"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
var _ log.Logger = (*Logger)(nil)

@ -7,7 +7,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
func TestLoggerLog(t *testing.T) {

@ -3,9 +3,9 @@ module github.com/go-kratos/kratos/contrib/log/tencent/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2
google.golang.org/protobuf v1.31.0
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -9,7 +9,7 @@ import (
cls "github.com/tencentcloud/tencentcloud-cls-sdk-go"
"google.golang.org/protobuf/proto"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type Logger interface {

@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
func TestWithEndpoint(t *testing.T) {

@ -3,8 +3,8 @@ module github.com/go-kratos/kratos/contrib/log/zap/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
go.uber.org/zap v1.23.0
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -5,7 +5,7 @@ import (
"go.uber.org/zap"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
var _ log.Logger = (*Logger)(nil)

@ -6,7 +6,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type testWriteSyncer struct {

@ -1,7 +1,7 @@
package datadog
import (
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Counter = (*counter)(nil)

@ -1,7 +1,7 @@
package datadog
import (
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Gauge = (*gauge)(nil)

@ -4,9 +4,9 @@ go 1.16
require (
github.com/DataDog/datadog-go v4.8.3+incompatible
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
)
require github.com/Microsoft/go-winio v0.5.2 // indirect
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -3,7 +3,7 @@ package datadog
import (
"time"
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Observer = (*timing)(nil)

@ -3,7 +3,7 @@ package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Counter = (*counter)(nil)

@ -3,7 +3,7 @@ package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Gauge = (*gauge)(nil)

@ -3,9 +3,9 @@ module github.com/go-kratos/kratos/contrib/metrics/prometheus/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/common v0.44.0
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -3,7 +3,7 @@ package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Observer = (*histogram)(nil)

@ -3,7 +3,7 @@ package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/go-kratos/kratos/v2/metrics"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/metrics"
)
var _ metrics.Observer = (*summary)(nil)

@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/opensergo/v2
go 1.17
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/opensergo/opensergo-go v0.0.0-20220331070310-e5b01fee4d1c
golang.org/x/net v0.10.0
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc
@ -24,4 +24,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../

@ -17,8 +17,6 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
"github.com/go-kratos/kratos/v2"
)
type Option func(*options)

@ -4,11 +4,10 @@ import (
"path/filepath"
"strings"
"github.com/polarismesh/polaris-go"
"github.com/polarismesh/polaris-go/pkg/model"
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
// ConfigOption is polaris config option.

@ -10,9 +10,7 @@ import (
"testing"
"time"
"github.com/go-kratos/kratos/v2/config"
"github.com/polarismesh/polaris-go"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
var (

@ -4,7 +4,7 @@ go 1.18
require (
github.com/go-kratos/aegis v0.2.0
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/google/uuid v1.3.0
github.com/polarismesh/polaris-go v1.3.0
google.golang.org/protobuf v1.31.0
@ -42,4 +42,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../

@ -3,10 +3,9 @@ package polaris
import (
"errors"
"github.com/polarismesh/polaris-go"
"github.com/polarismesh/polaris-go/api"
"github.com/go-kratos/kratos/v2/config"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/config"
)
type Polaris struct {

@ -6,10 +6,10 @@ import (
"github.com/go-kratos/aegis/ratelimit"
"github.com/go-kratos/kratos/v2/errors"
"github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/transport"
"github.com/go-kratos/kratos/v2/transport/http"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/errors"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/middleware"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http"
"github.com/polarismesh/polaris-go/pkg/model"
)

@ -9,10 +9,9 @@ import (
"time"
"github.com/google/uuid"
"github.com/polarismesh/polaris-go"
"github.com/polarismesh/polaris-go/pkg/model"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
var (

@ -5,9 +5,7 @@ import (
"testing"
"time"
"github.com/polarismesh/polaris-go"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
// TestRegistry

@ -7,18 +7,16 @@ import (
"strconv"
"strings"
"github.com/polarismesh/polaris-go"
"github.com/polarismesh/polaris-go/pkg/model"
"github.com/polarismesh/polaris-go/pkg/model/local"
"github.com/polarismesh/polaris-go/pkg/model/pb"
v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
"google.golang.org/protobuf/types/known/wrapperspb"
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/selector"
"github.com/go-kratos/kratos/v2/transport"
"github.com/go-kratos/kratos/v2/transport/http"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/selector"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/http"
)
type router struct {

@ -8,11 +8,8 @@ import (
"testing"
"time"
"github.com/polarismesh/polaris-go"
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/selector"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/selector"
)
func TestRouter(t *testing.T) {

@ -11,8 +11,8 @@ import (
"strings"
"time"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
"github.com/hashicorp/consul/api"
)

@ -4,7 +4,7 @@ go 1.16
require (
github.com/armon/go-metrics v0.3.10 // indirect
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/hashicorp/consul/api v1.20.0
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
@ -12,4 +12,4 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -9,7 +9,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
var (

@ -10,7 +10,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
func tcpServer(lis net.Listener) {

@ -4,7 +4,7 @@ import (
"sync"
"sync/atomic"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
type serviceSet struct {

@ -3,7 +3,7 @@ package consul
import (
"context"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
type watcher struct {

@ -48,7 +48,7 @@ func main() {
```go
import (
"github.com/go-kratos/kratos/contrib/registry/discovery/v2"
"github.com/go-kratos/kratos/v2/transport/grpc"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/transport/grpc"
)
func main() {

@ -10,10 +10,9 @@ import (
"sync/atomic"
"time"
"github.com/go-resty/resty/v2"
"github.com/pkg/errors"
"github.com/go-kratos/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
)
type Discovery struct {

@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
var (

@ -3,9 +3,9 @@ module github.com/go-kratos/kratos/contrib/registry/discovery/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
github.com/go-resty/resty/v2 v2.7.0
github.com/pkg/errors v0.9.1
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
func filterInstancesByZone(ins *disInstancesInfo, zone string) []*registry.ServiceInstance {

@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/log"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
func (d *Discovery) Register(ctx context.Context, service *registry.ServiceInstance) (err error) {

@ -3,9 +3,9 @@ module github.com/go-kratos/kratos/contrib/registry/etcd/v2
go 1.16
require (
github.com/go-kratos/kratos/v2 v2.6.3
gitea.drugeyes.vip/pharnexbase/kratos/v2 v2.6.3
go.etcd.io/etcd/client/v3 v3.5.8
google.golang.org/grpc v1.56.1
)
replace github.com/go-kratos/kratos/v2 => ../../../
replace gitea.drugeyes.vip/pharnexbase/kratos/v2 => ../../../

@ -8,7 +8,7 @@ import (
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
var (

@ -10,7 +10,7 @@ import (
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
func TestRegistry(t *testing.T) {

@ -3,7 +3,7 @@ package etcd
import (
"encoding/json"
"github.com/go-kratos/kratos/v2/registry"
"gitea.drugeyes.vip/pharnexbase/kratos/v2/registry"
)
func marshal(si *registry.ServiceInstance) (string, error) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save