wanghongfei / gogate Goto Github PK
View Code? Open in Web Editor NEWGo实现的高性能Spring Cloud网关(支持Consul和Eureka), 路由配置热更新、负载均衡、灰度、服务粒度的流量控制、服务粒度的流量统计
License: MIT License
Go实现的高性能Spring Cloud网关(支持Consul和Eureka), 路由配置热更新、负载均衡、灰度、服务粒度的流量控制、服务粒度的流量统计
License: MIT License
当传递的参数类型是multipart data 文件类型就有问题。好像类型不支持
ArthurHlt/go-eureka-clientd的代码放入docker之后,出现EOF的错误,请问知道什么原因吗
Great job!
Do you have a plan to support Consul
?
是否考虑增加 API 失败重试 功能
某个服务有3个instance,但是路由的时候发现这个服务只有一个instance,groupByService获取的newRegistryMap中的value值一直是一个元素的slice。
// 将所有实例按服务名进行分组
func groupByService(instances []*discovery.InstanceInfo) *sync.Map {
servMap := new(sync.Map)
for _, ins := range instances {
infosGeneric, exist := servMap.Load(ins.ServiceName)
if !exist {
infosGeneric = make([]*discovery.InstanceInfo, 0, 5)
infos, _ := infosGeneric.([]*discovery.InstanceInfo)
infos = append(infos, ins)
servMap.Store(ins.ServiceName, infos)
} else {
infos, _ := infosGeneric.([]*discovery.InstanceInfo)
infos = append(infos, ins)
}
}
return servMap
}
这个方法中的
infos, _ := infosGeneric.([]*discovery.InstanceInfo)
infos = append(infos, ins)
infos append之后是一个新的slice引用和infosGeneric不一样(虽然两个%p输出的指针一样,因为底层公用的同一个数组,但是还是两个不同的引用)
测试代码
Great job!
Do you have a plan to support Etcd?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.