diff --git a/README.md b/README.md index a1c09fc3ca4414188f42e8e5433b33b90d959865..7df7e7973a7e3e808f4b8feb4f26b98c0f21e9ef 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Both extension module and layered project architecture is according to Apache Du  -If you wanna know more about dubbo-go, please visit this reference [Project Architeture design](https://github.com/apache/dubbo-go/wiki/dubbo-go-V1.0-design) +If you wanna know more about dubbo-go, please visit this reference [Project Architecture design](https://github.com/apache/dubbo-go/wiki/dubbo-go-V1.0-design) ## Feature list ## diff --git a/cluster/loadbalance/consistent_hash.go b/cluster/loadbalance/consistent_hash.go index 84fbb268c7a8ec32f007a734e2d6da56ef3c6d25..36d93d224e16b7fd7f4236bbbbfc3caf75493250 100644 --- a/cluster/loadbalance/consistent_hash.go +++ b/cluster/loadbalance/consistent_hash.go @@ -42,7 +42,7 @@ const ( ConsistentHash = "consistenthash" // HashNodes ... HashNodes = "hash.nodes" - // HashArguments key of hash arguments in url + // HashArguments key of hash arguments in url HashArguments = "hash.arguments" ) diff --git a/cluster/router/condition/router.go b/cluster/router/condition/router.go index 40a251573f5e73d40032972313565d98b288b1b1..11e56cc8a5494594702edd12f29e3f40d3ffc1d4 100644 --- a/cluster/router/condition/router.go +++ b/cluster/router/condition/router.go @@ -288,7 +288,7 @@ func matchCondition(pairs map[string]MatchPair, url *common.URL, param *common.U return result } -// MatchPair Match key pair , condition process +// MatchPair Match key pair, condition process type MatchPair struct { Matches *gxset.HashSet Mismatches *gxset.HashSet @@ -314,7 +314,7 @@ func (pair MatchPair) isMatch(value string, param *common.URL) bool { return true } if !pair.Mismatches.Empty() && !pair.Matches.Empty() { - //when both mismatches and matches contain the same value, then using mismatches first + // when both mismatches and matches contain the same value, then using mismatches first for mismatch := range pair.Mismatches.Items { if isMatchGlobalPattern(mismatch.(string), value, param) { return false diff --git a/cluster/router/healthcheck/default_health_check.go b/cluster/router/healthcheck/default_health_check.go index a26f86ddac45aa6e999cd4453aa296d0786a02ba..c693b86ecdab7b32936185fe4bd614bd0f83fbeb 100644 --- a/cluster/router/healthcheck/default_health_check.go +++ b/cluster/router/healthcheck/default_health_check.go @@ -49,7 +49,7 @@ type DefaultHealthChecker struct { // and the current active request func (c *DefaultHealthChecker) IsHealthy(invoker protocol.Invoker) bool { urlStatus := protocol.GetURLStatus(invoker.GetUrl()) - if c.isCircuitBreakerTripped(urlStatus) || urlStatus.GetActive() > c.GetOutStandingRequestConutLimit() { + if c.isCircuitBreakerTripped(urlStatus) || urlStatus.GetActive() > c.GetOutStandingRequestCountLimit() { logger.Debugf("Invoker [%s] is currently in circuitbreaker tripped state", invoker.GetUrl().Key()) return false } @@ -92,18 +92,18 @@ func (c *DefaultHealthChecker) getCircuitBreakerSleepWindowTime(status *protocol return int64(sleepWindow) } -// GetOutStandingRequestConutLimit return the requestSuccessiveFailureThreshold bound to this DefaultHealthChecker +// GetRequestSuccessiveFailureThreshold return the requestSuccessiveFailureThreshold bound to this DefaultHealthChecker func (c *DefaultHealthChecker) GetRequestSuccessiveFailureThreshold() int32 { return c.requestSuccessiveFailureThreshold } -// GetOutStandingRequestConutLimit return the circuitTrippedTimeoutFactor bound to this DefaultHealthChecker +// GetCircuitTrippedTimeoutFactor return the circuitTrippedTimeoutFactor bound to this DefaultHealthChecker func (c *DefaultHealthChecker) GetCircuitTrippedTimeoutFactor() int32 { return c.circuitTrippedTimeoutFactor } -// GetOutStandingRequestConutLimit return the outStandingRequestConutLimit bound to this DefaultHealthChecker -func (c *DefaultHealthChecker) GetOutStandingRequestConutLimit() int32 { +// GetOutStandingRequestCountLimit return the outStandingRequestConutLimit bound to this DefaultHealthChecker +func (c *DefaultHealthChecker) GetOutStandingRequestCountLimit() int32 { return c.outStandingRequestConutLimit } diff --git a/filter/filter.go b/filter/filter.go index d20ca72c345c6812f4bce6df5dbaf683429a9874..804bf3b9df8040c6377648f150c25d421b29b93d 100644 --- a/filter/filter.go +++ b/filter/filter.go @@ -27,7 +27,7 @@ import ( // Filter interface defines the functions of a filter // Extension - Filter type Filter interface { - // Invoke is the core function of a filter, it determins the process of the filter + // Invoke is the core function of a filter, it determines the process of the filter Invoke(context.Context, protocol.Invoker, protocol.Invocation) protocol.Result // OnResponse updates the results from Invoke and then returns the modified results. OnResponse(context.Context, protocol.Result, protocol.Invoker, protocol.Invocation) protocol.Result diff --git a/protocol/dubbo/client.go b/protocol/dubbo/client.go index 6d1b771bf4108d17372e0ceb5ca818323278afd2..54752ee5fa5f5d095e29fe91f0ee4959423f127a 100644 --- a/protocol/dubbo/client.go +++ b/protocol/dubbo/client.go @@ -193,7 +193,7 @@ type Response struct { atta map[string]string } -// NewResponse create a new Response. +// NewResponse create a new Response. func NewResponse(reply interface{}, atta map[string]string) *Response { return &Response{ reply: reply, diff --git a/protocol/dubbo/codec.go b/protocol/dubbo/codec.go index 1f7d107544a06d0ef83bcb54ff6f03daf2dc517b..ef71e93040afc2b7b57273593f4bde1a5a9c7c75 100644 --- a/protocol/dubbo/codec.go +++ b/protocol/dubbo/codec.go @@ -82,7 +82,7 @@ func (p *DubboPackage) Marshal() (*bytes.Buffer, error) { return bytes.NewBuffer(pkg), nil } -// Unmarshal dncode hessian package. +// Unmarshal decode hessian package. func (p *DubboPackage) Unmarshal(buf *bytes.Buffer, opts ...interface{}) error { // fix issue https://github.com/apache/dubbo-go/issues/380 bufLen := buf.Len() diff --git a/protocol/grpc/server.go b/protocol/grpc/server.go index 4017b65dd5c35ef19795b390e40d7afff6699306..2b7b1adddf573e3b84db32a11cfc286ff22a0276 100644 --- a/protocol/grpc/server.go +++ b/protocol/grpc/server.go @@ -69,7 +69,7 @@ func (s *Server) Start(url common.URL) { panic(err) } - // if global trace instance was set , then server tracer instance can be get. If not , will return Nooptracer + // if global trace instance was set, then server tracer instance can be get. If not , will return Nooptracer tracer := opentracing.GlobalTracer() server := grpc.NewServer( grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer))) diff --git a/protocol/invocation/rpcinvocation.go b/protocol/invocation/rpcinvocation.go index b8b5b509702ea5ee62df83eb55bf7f1c86625b26..74511bb4a67de32db942a18195598b1b1f68522b 100644 --- a/protocol/invocation/rpcinvocation.go +++ b/protocol/invocation/rpcinvocation.go @@ -27,7 +27,7 @@ import ( ) // /////////////////////////// -// Invocation Impletment of RPC +// Invocation Implement of RPC // /////////////////////////// // todo: is it necessary to separate fields of consumer(provider) from RPCInvocation @@ -103,7 +103,7 @@ func (r *RPCInvocation) Attachments() map[string]string { return r.attachments } -// AttachmentsByKey gets RPC attachment by key , if nil then return default value. +// AttachmentsByKey gets RPC attachment by key, if nil then return default value. func (r *RPCInvocation) AttachmentsByKey(key string, defaultValue string) string { r.lock.RLock() defer r.lock.RUnlock() diff --git a/protocol/result.go b/protocol/result.go index 2e7a6e492a60888ec9d9f420c77e6b77aee6aa70..2a33be612fd1f319c8c46cbd480865d5564b189d 100644 --- a/protocol/result.go +++ b/protocol/result.go @@ -38,7 +38,7 @@ type Result interface { } ///////////////////////////// -// Result Impletment of RPC +// Result Implement of RPC ///////////////////////////// // RPCResult is default RPC result. diff --git a/registry/etcdv3/service_discovery.go b/registry/etcdv3/service_discovery.go index 10396049fb6bb7a5a5935ce21639dc5a78a56b0b..4bef2ef4d1c7c4b8a748204458ec7fc1eb43e3fd 100644 --- a/registry/etcdv3/service_discovery.go +++ b/registry/etcdv3/service_discovery.go @@ -71,7 +71,7 @@ func (e *etcdV3ServiceDiscovery) String() string { return e.descriptor } -// Destory service discovery +// Destroy service discovery func (e *etcdV3ServiceDiscovery) Destroy() error { if e.client != nil { e.client.Close() diff --git a/registry/nacos/listener.go b/registry/nacos/listener.go index 36f733df5a32f57e3410a2f31f9ab4b0af735d49..4282bf86be0bb566c415a6614e34526517576650 100644 --- a/registry/nacos/listener.go +++ b/registry/nacos/listener.go @@ -132,7 +132,7 @@ func (nl *nacosListener) Callback(services []model.SubscribeService, err error) instance := generateInstance(services[i]) newInstanceMap[host] = instance if old, ok := nl.instanceMap[host]; !ok { - //instance is not exsit in cache,add it to cache + //instance is not exist in cache,add it to cache addInstances = append(addInstances, instance) } else { //instance is not different from cache,update it to cache @@ -144,7 +144,7 @@ func (nl *nacosListener) Callback(services []model.SubscribeService, err error) for host, inst := range nl.instanceMap { if _, ok := newInstanceMap[host]; !ok { - //cache instance is not exsit in new instance list, remove it from cache + //cache instance is not exist in new instance list, remove it from cache delInstances = append(delInstances, inst) } } diff --git a/registry/registry.go b/registry/registry.go index bb09ead7ef2af6707345086f8695b35286d76a10..5e77eab186680671f27b44bbe2e6a6b964a28721 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -46,7 +46,7 @@ type Registry interface { //Deprecated! //subscribe(event.URL) (Listener, error) - //Will relace mode1 in dubbogo version v1.1.0 + //Will replace mode1 in dubbogo version v1.1.0 //mode2 : callback mode, subscribe with notify(notify listener). Subscribe(*common.URL, NotifyListener) error diff --git a/remoting/etcdv3/client.go b/remoting/etcdv3/client.go index 7632a7cd042d36db5e02280a14224b83e8736e6c..89c3c5d91cf43b4dcbc0608aed2e9469d9e3ce9f 100644 --- a/remoting/etcdv3/client.go +++ b/remoting/etcdv3/client.go @@ -35,7 +35,7 @@ import ( ) const ( - // ConnDelay connection dalay + // ConnDelay connection delay ConnDelay = 3 // MaxFailTimes max failure times MaxFailTimes = 15 diff --git a/remoting/kubernetes/registry_controller.go b/remoting/kubernetes/registry_controller.go index f93a00a6f2df6022d0436f56e8c719f108be66f3..20be0d72ec1ce4c379f44d3218ffbd0cfd3d2a63 100644 --- a/remoting/kubernetes/registry_controller.go +++ b/remoting/kubernetes/registry_controller.go @@ -567,7 +567,7 @@ func (c *dubboRegistryController) addAnnotationForCurrentPod(k string, v string) c.lock.Lock() defer c.lock.Unlock() - // 1. accord old pod && (k, v) assemble new pod dubbo annotion v + // 1. accord old pod && (k, v) assemble new pod dubbo annotation v // 2. get patch data // 3. PATCH the pod currentPod, err := c.readCurrentPod() diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go index 4ca34a6aeccf7b588a96edb44b4d5913a3e0fd8e..186f9261a9b8f2b4579c7122b81b70817c517d41 100644 --- a/remoting/zookeeper/client.go +++ b/remoting/zookeeper/client.go @@ -190,7 +190,7 @@ func NewZookeeperClient(name string, zkAddrs []string, timeout time.Duration) (* return z, nil } -// WithTestCluster sets test cluser for zk client +// WithTestCluster sets test cluster for zk client func WithTestCluster(ts *zk.TestCluster) Option { return func(opt *Options) { opt.ts = ts