《用Gin框架构建分布式应用》学习第5天,p77-p87总结,总计11页。
一、技术总结
1.Go知识点
(1)context
2.on-premises software
p80, A container is like a separate OS, but not virtualized; it only contains the dependencies needed for that one application, which makes the container portable and deployable on-premises or on the cloud。
premises的意思是“the land and buildings owned by someone, especially by a company or organization(归属于某人(尤指公司、组织)的土地或建筑物)”。简单来说 on-premises software 指的是运行在本地的服务(软件)。
wiki 对这个名称的定义很好,这里直接引用“On-premises software (abbreviated to on-prem, and often written as "on-premise") is installed and runs on computers on the premises of the person or organization using the software, rather than at a remote facility such as a server farm or cloud”。
3.openssl rand命令
openssl rand -base64 12 | docker secret create mongodb_password-
rand 命令语法:
4.查看docker latest tag对应的版本号
(1)未下载镜像
(2)已下载镜像
使用 docker inspect 命令进行查看。
5.mongo-go-driver示例
书上代码使用的mongo-go-driver v1.4.5,现在已经更新到了v2.0.0,导致有些代码无法运行,建议使用最新版。这里还得再吐槽下 Go 生态圈的文档写得太糟糕了。示例:
个人认为,上面的代码 err 就不应该忽略掉。而应该是:
二、英语总结
1.ephemeral
p79, I opted to go with Docker duce to its popularity and simplicity in runing ephermeral environment.
(1)ephemeral: ephemera + -al。
(2)ephemera: epi-("on") + hemera("day"), lasting one day , short-lived"。
三、其它
从目前的阅读体验来看,作者默认读者充分掌握Golang,丝毫不会展开介绍。
四、参考资料
1. 编程
2. 英语
领取专属 10元无门槛券
私享最新 技术干货