序本文主要研究一下storagetapper的poolThreadstoragetapper/pool/pool.go {代码...} Thread接口定义了Start、Adjust、Terminate、NumProcs方法poolstoragetapper/pool/pool.go {代码...} poolImpl定义了mutex、n...
序本文主要研究一下storagetapper的pipePipestoragetapper/pipe/pipe.go {代码...} Pipe接口定义了NewConsumer、NewProducer、Type、Config、Close方法Consumerstoragetapper/pipe/pipe.go {代码...} Consumer接...
序本文主要研究一下storagetapper的LockLockstoragetapper/lock/lock.go {代码...} Lock接口定义了TryLock、TryLockShared、Lock、Refresh、Unlock、Close方法myLockstoragetapper/lock/lock.go {代码...} myLock...
storagetapper的server提供了StartHTTPServer、Shutdown方法;其init方法注册了/health,/schema,/cluster,/table,/config,/这几个url
序本文主要研究一下nacos-coredns-plugin的UDPServerUDPServernacos-coredns-plugin/nacos/udp_server.go {代码...} UDPServer定义了port、host、vipClient属性StartServernacos-coredns-plugin/nacos/udp_server...
ServerManager定义了serverList、lastRefreshTime、cursor属性;它提供了RefreshServerListIfNeed、NextServer、SetServers、GetServerList方法;其中NextServer会先执行RefreshServerListIfNeed在返回随机的serv...
Domain定义了Name、Clusters、CacheMillis、LastRefMillis、Instances、Env、TTL属性;它提供了getInstances、String、SrvInstances方法;其中SrvInstances方法根据instance的权重来返回对应个数的instance
序本文主要研究一下gost的DeltaCompareDeltaComparegost/math/compare.go {代码...} DeltaCompareFloat64及DeltaCompareFloat32对比两个float类型的差值是否小于等于指定的delta实例gost/math/compare_test.go {...
HashSet定义了Items属性;NewSet根据values来创建HashSet;它提供了Add、Remove、Contains、Empty、Size、Clear、Values、String方法
CountWatch定义了start属性,它提供了Start、Reset、Count方法;其中Start方法判断start为初始值的时候设置为time.Now;Reset设置start为time.Now;Count计算当前时间距离start的纳秒数
GenericTaskPool接口定义了AddTask、AddTaskAlways、AddTaskBalance、Close、IsClosed接口
ObjectPool定义了New及sync.Pool属性,它提供了Get、Put方法,同时还有NewObjectPool工程方法;New是一个func,返回PoolObject;PoolObject接口定义了Reset方法
Pager接口定义了GetOffset、GetPageSize、GetTotalPages、GetData、GetDataSize、HasNext、HasData方法
GoUnterminated方法提供handle、WaitGroup、ignoreRecover、period参数,其内部使用的是GoSafely,只是catchFunc是内置的;catchFunc对于period大于0的会sleep一下,之后还是执行GoUnterminated,这样子在handle...
GoSafely接收WaitGroup、ignoreRecover、handler、catchFunc参数,其大致的模板是,首先对WaitGroup进行add(1),然后一步执行带defer的handler
序本文主要研究一下dubbo-go-proxy的ZookeeperRegistryLoadLoaderdubbo-go-proxy/pkg/registry/load.go {代码...} Loader接口定义了LoadAllServices、GetCluster方法ZookeeperRegistryLoaddubbo-go-proxy/pkg/reg...
序本文主要研究一下dubbo-go-proxy的ConsulRegistryLoadLoaderdubbo-go-proxy/pkg/registry/load.go {代码...} Loader接口定义了LoadAllServices、GetCluster方法ConsulRegistryLoaddubbo-go-proxy/pkg/registry/...
序本文主要研究一下dubbo-go-proxy的RouteRoutedubbo-go-proxy/pkg/router/route.go {代码...} Route定义了lock、tree、wildcardTree属性,其NewRoute方法用于创建RoutePutAPIdubbo-go-proxy/pkg/router/route.go...
discovery_service.go定义了四种DiscoveryService接口,分别是APIDiscoveryService、ListenerDiscoveryService、RouteDiscoveryService、ClusterDiscoveryService、EndpointDiscoveryService
序本文主要研究一下dubbo-go-proxy的apiFilterapiFilterdubbo-go-proxy/pkg/filter/api/api.go {代码...} Init方法往extension设置了名为dgp.filters.http.api的apiFilterFuncapiFilterFuncdubbo-go-proxy/pkg/fi...
当一个代码的工匠回首往事时,不因虚度年华而悔...