Skip to content
Snippets Groups Projects
Commit 50854c38 authored by cjp's avatar cjp
Browse files

delete unused variable

parent 1c4a4efc
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,6 @@ const (
var (
zkFormat = "zookeeper://%s:%d"
conditionFormat = "condition://%s/com.foo.BarService"
)
// MockInvoker is only mock the Invoker to support test tagRouter
......
......@@ -18,7 +18,6 @@
package nacos
import (
"path/filepath"
"strconv"
"strings"
"sync"
......@@ -38,9 +37,6 @@ import (
"github.com/apache/dubbo-go/common/logger"
)
// Nacos Log dir, it can be override when creating client by config_center.log_dir
var logDir = filepath.Join("logs", "nacos", "log")
// NacosClient Nacos client
type NacosClient struct {
name string
......
......@@ -28,11 +28,6 @@ import (
perrors "github.com/pkg/errors"
)
const (
mask = byte(127)
flag = byte(128)
)
const (
// Zero : byte zero
Zero = byte(0x00)
......@@ -84,10 +79,6 @@ const (
BC_LIST_FIXED = byte('V')
BC_LIST_VARIABLE_UNTYPED = byte(0x57)
BC_LIST_FIXED_UNTYPED = byte(0x58)
_listFixedTypedLenTagMin = byte(0x70)
_listFixedTypedLenTagMax = byte(0x77)
_listFixedUntypedLenTagMin = byte(0x78)
_listFixedUntypedLenTagMax = byte(0x7f)
BC_LIST_DIRECT = byte(0x70)
BC_LIST_DIRECT_UNTYPED = byte(0x78)
......
......@@ -28,11 +28,6 @@ const (
DUBBO = "dubbo"
)
const (
mask = byte(127)
flag = byte(128)
)
const (
// Zero : byte zero
Zero = byte(0x00)
......@@ -84,10 +79,6 @@ const (
BC_LIST_FIXED = byte('V')
BC_LIST_VARIABLE_UNTYPED = byte(0x57)
BC_LIST_FIXED_UNTYPED = byte(0x58)
_listFixedTypedLenTagMin = byte(0x70)
_listFixedTypedLenTagMax = byte(0x77)
_listFixedUntypedLenTagMin = byte(0x78)
_listFixedUntypedLenTagMax = byte(0x7f)
BC_LIST_DIRECT = byte(0x70)
BC_LIST_DIRECT_UNTYPED = byte(0x78)
......
......@@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca
return err
}
func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) {
traceAttachments := filterContext(inv.Attachments())
// actually, if user do not use any opentracing framework, the err will not be nil.
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap,
opentracing.TextMapCarrier(traceAttachments))
return spanCtx, err
}
func filterContext(attachments map[string]interface{}) map[string]string {
var traceAttchment = make(map[string]string)
for k, v := range attachments {
......
......@@ -28,19 +28,11 @@ import (
"github.com/golang/protobuf/protoc-gen-go/generator"
)
// generatedCodeVersion indicates a version of the generated code.
// It is incremented whenever an incompatibility between the generated code and
// the grpc package is introduced; the generated code references
// a constant, grpc.SupportPackageIsVersionN (where N is generatedCodeVersion).
const generatedCodeVersion = 4
// Paths for packages used by code generated in this file,
// relative to the import_prefix of the generator.Generator.
const (
contextPkgPath = "context"
grpcPkgPath = "google.golang.org/grpc"
codePkgPath = "google.golang.org/grpc/codes"
statusPkgPath = "google.golang.org/grpc/status"
)
func init() {
......
......@@ -53,8 +53,6 @@ const (
CodeMethodNotFound = -32601
CodeInvalidParams = -32602
CodeInternalError = -32603
codeServerErrorStart = -32099
codeServerErrorEnd = -32000
)
// Error response Error
......
......@@ -31,138 +31,6 @@ import (
"github.com/apache/dubbo-go/remoting"
)
var clientPodJsonData = `{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"dubbo.io/annotation": "W3siayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvcHJvdmlkZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzL2NvbnN1bWVyJTNBJTJGJTJGMTcyLjE3LjAuOCUyRlVzZXJQcm92aWRlciUzRmNhdGVnb3J5JTNEY29uc3VtZXJzJTI2ZHViYm8lM0RkdWJib2dvLWNvbnN1bWVyLTIuNi4wJTI2cHJvdG9jb2wlM0RkdWJibyIsInYiOiIifV0="
},
"creationTimestamp": "2020-03-13T03:38:57Z",
"labels": {
"dubbo.io/label": "dubbo.io-value"
},
"name": "client",
"namespace": "default",
"resourceVersion": "2449700",
"selfLink": "/api/v1/namespaces/default/pods/client",
"uid": "3ec394f5-dcc6-49c3-8061-57b4b2b41344"
},
"spec": {
"containers": [
{
"env": [
{
"name": "NAMESPACE",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
}
],
"image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client",
"imagePullPolicy": "Always",
"name": "client",
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"name": "dubbo-sa-token-l2lzh",
"readOnly": true
}
]
}
],
"dnsPolicy": "ClusterFirst",
"enableServiceLinks": true,
"nodeName": "minikube",
"priority": 0,
"restartPolicy": "Never",
"schedulerName": "default-scheduler",
"securityContext": {},
"serviceAccount": "dubbo-sa",
"serviceAccountName": "dubbo-sa",
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 300
},
{
"effect": "NoExecute",
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"tolerationSeconds": 300
}
],
"volumes": [
{
"name": "dubbo-sa-token-l2lzh",
"secret": {
"defaultMode": 420,
"secretName": "dubbo-sa-token-l2lzh"
}
}
]
},
"status": {
"conditions": [
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:38:57Z",
"status": "True",
"type": "Initialized"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:40:18Z",
"status": "True",
"type": "Ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:40:18Z",
"status": "True",
"type": "ContainersReady"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:38:57Z",
"status": "True",
"type": "PodScheduled"
}
],
"containerStatuses": [
{
"containerID": "docker://2870d6abc19ca7fe22ca635ebcfac5d48c6d5550a659bafd74fb48104f6dfe3c",
"image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client:latest",
"imageID": "docker-pullable://registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client@sha256:1f075131f708a0d400339e81549d7c4d4ed917ab0b6bd38ef458dd06ad25a559",
"lastState": {},
"name": "client",
"ready": true,
"restartCount": 0,
"state": {
"running": {
"startedAt": "2020-03-13T03:40:17Z"
}
}
}
],
"hostIP": "10.0.2.15",
"phase": "Running",
"podIP": "172.17.0.8",
"qosClass": "BestEffort",
"startTime": "2020-03-13T03:38:57Z"
}
}
`
func Test_DataChange(t *testing.T) {
listener := NewRegistryDataListener(&MockDataListener{})
url, _ := common.NewURL("jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-2.6.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100")
......
......@@ -38,8 +38,6 @@ import (
)
var (
errInvalidCodecType = perrors.New("illegal CodecType")
errInvalidAddress = perrors.New("remote address invalid or empty")
errSessionNotExist = perrors.New("session not exist")
errClientClosed = perrors.New("client closed")
errClientReadTimeout = perrors.New("client read timeout")
......
......@@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca
return err
}
func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) {
traceAttachments := filterContext(inv.Attachments())
// actually, if user do not use any opentracing framework, the err will not be nil.
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap,
opentracing.TextMapCarrier(traceAttachments))
return spanCtx, err
}
func filterContext(attachments map[string]interface{}) map[string]string {
var traceAttchment = make(map[string]string)
for k, v := range attachments {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment