摘要: 下载插件 go get github.com/micro/go-plugins 导包 myhttp"github.com/micro/go-plugins/client/http"1.注册服务 import ( "github.com/gin-gonic/gin" "github.com/micro 阅读全文
posted @ 2021-02-08 16:46 动力起点 阅读(137) 评论(0) 推荐(0)
摘要: import ( "fmt" "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/registry" "github.com/micro/go-plugins/registry/consul" "io/iout 阅读全文
posted @ 2021-02-08 15:24 动力起点 阅读(86) 评论(0) 推荐(0)
摘要: 1.服务注册 import ( "github.com/gin-gonic/gin" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/web" "github.com/micro/go-plugins/registry/ 阅读全文
posted @ 2021-02-08 14:47 动力起点 阅读(302) 评论(0) 推荐(0)
摘要: windows在gitbash中输入,linux直接项目目录输入 go run *.go 阅读全文
posted @ 2021-02-08 14:32 动力起点 阅读(492) 评论(0) 推荐(0)
摘要: package main import "strconv" type ProdModel struct { ProdID int ProdName string } func NewProd(id int,pName string) *ProdModel{ // 结构体变量声明方式1 /* var 阅读全文
posted @ 2021-02-08 14:22 动力起点 阅读(79) 评论(0) 推荐(0)