Go-Micro注册到etcd
简介Go-Micro注册到etcd
1、新版go-micro命令行已经废弃了consul,支持了etcd
2、安装etcd
参考网址:https://www.cnblogs.com/chenqionghe/p/10503840.html
3、注册更换成etcd
package main
import (
"github.com/micro/go-micro"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/registry/etcd"
"micro-api/service/controller"
services "micro-api/service/model"
)
func main() {
registerEtcd := etcd.NewRegistry(func(options *registry.Options) {
options.Addrs = []string{
"192.168.1.171:2379",
}
})
service := micro.NewService(
micro.Name("student-service"),
micro.Registry(registerEtcd),
)
if err := services.RegisterStudentListServiceHandler(service.Server(), new(controller.StudentService)); err != nil {
}
service.Init()
service.Run()
}
4、使用micro工具包查看服务列表
#1、查看服务
> micro --registry=etcd --registry_address=192.168.1.171:2379 list services
go.micro.http.broker
student-service
#2、获取服务
> micro --registry=etcd --registry_address=192.168.1.171:2379 list services
go.micro.http.broker
student-service
E:\go\micro-student>micro --registry=etcd --registry_address=192.168.1.171:2379 get service student-service
service student-service
version 2020.03.14.14.01
ID Address Metadata
student-service-5b943dd6-3c6a-420f-b171-a2dbfc5ca88f 192.168.1.61:57953 transport=http,broker=http,protocol=mucp,registry=etcd,server=mucp
Endpoint: StudentListService.GetStudentListService
Request: {
num int32
}
Response: {
status int32
data []StudentModel
}
#3、调用服务
> micro --registry=etcd --registry_address=192.168.1.171:2379 call student-service StudentListService.GetStudentListService "{\"num\":3}"
{
"status": 200,
"data": [
{
"id": 1,
"name": "name_1",
"sex": "男"
},
{
"id": 2,
"name": "name_2",
"sex": "男"
},
{
"id": 3,
"name": "name_3",
"sex": "男"
}
]
}
5、使用micro工具的Dashboard
micro --registry=etcd --registry_address=192.168.1.171:2379 web
通过这个管理界面可以查看服务的详细信息,可以测试服务,使用比较方便
缩放布局组件FittedBox主要有两个功能:缩放和位置调整。FittedBox会根据自己的尺寸来调整child的尺寸。
Tauri 是一个框架,用于为所有主要桌面平台构建小巧、快速的二进制文件。开发人员可以集成任何可编译为 HTML、JS 和 CSS 的前端框架,以构建他们的用户界面。应用程序的后端是一个基于 Rust 的二进制文件,带有一个前端可以与之交互的 API。
Tauri 应用程序的用户界面目前在 macOS 和 Windows 上利用 tao 作为窗口处理库,在 Linux 上通过 Tauri 团队孵化和维护的 WRY 利用 WebKit、Windows 上的 WebView2 和 Linux 上的 WebKitGTK 创建一个统一的系统 webview(和其他好东西,如菜单和任务栏)接口。
图像添加(高斯/椒盐/泊松/斑点)噪声
python多维数组为一维数组(reshape、flatten、ravel),使用NumPy库.
快速生成表格
Electron页面跳转、浏览器打开链接和打开新窗口
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。