摘要: 看下面的代码调用了server.Init()之后就支持命令行读取配置了 package main import ( "github.com/gin-gonic/gin" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/w 阅读全文
posted @ 2019-12-25 16:23 离地最远的星 阅读(558) 评论(0) 推荐(0) 编辑
摘要: 我们会使用主站api调用商品api 使用go-micro访问consul获取服务信息 package main import ( "fmt" "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/registry 阅读全文
posted @ 2019-12-25 16:09 离地最远的星 阅读(2616) 评论(0) 推荐(0) 编辑
摘要: 安装go-plugins go get -v github.com/micro/go-plugins,原来go-micro consul的支持已经迁移到了go-plugins里面 package main import ( "github.com/gin-gonic/gin" "github.com 阅读全文
posted @ 2019-12-25 15:52 离地最远的星 阅读(1498) 评论(0) 推荐(0) 编辑
摘要: package main import ( "github.com/gin-gonic/gin" "github.com/micro/go-micro/web" ) func main() { ginRouter := gin.Default() ginRouter.Handle("GET", "/ 阅读全文
posted @ 2019-12-25 15:08 离地最远的星 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 先下载Go Micro框架 go get -v github.com/micro/go-micro 启动一个简单的Server package main import ( "github.com/micro/go-micro/web" "net/http" ) func main() { /*第一种 阅读全文
posted @ 2019-12-25 14:55 离地最远的星 阅读(403) 评论(0) 推荐(0) 编辑