摘要:
## [go-cache ](https://github.com/patrickmn/go-cache) [https://github.com/patrickmn/go-cache](https://github.com/patrickmn/go-cache) ### 一句话描述 基于内存的 K 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(742)
评论(0)
推荐(0)
摘要:
## 简介 [`testify`](https://github.com/stretchr/testify)可以说是最流行的(从 GitHub star 数来看)Go 语言测试库了。`testify`提供了很多方便的函数帮助我们做`assert`和错误信息输出。使用标准库`testing`,我们需要 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(238)
评论(0)
推荐(0)
摘要:
## 简介 [`testing`](https://golang.google.cn/pkg/testing/)是 Go 语言标准库自带的测试库。在 Go 语言中编写测试很简单,只需要遵循 Go 测试的**几个约定**,与编写正常的 Go 代码没有什么区别。Go 语言中有 3 种类型的测试:单元测试 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(162)
评论(0)
推荐(0)
摘要:
## 简介 当前很多网站直接采用第三方认证登录,例如支付宝/微信/ Github 等。[`goth`](https://github.com/markbates/goth)封装了接入第三方认证的方法,并且内置实现了很多第三方认证的实现: 
评论(0)
推荐(0)
摘要:
## 简介 上一篇文章[《Go 每日一库之 securecookie》](https://go-quiz.github.io/2021/07/23/godailylib/gorilla/securecookie/)中,我们介绍了 cookie。同时提到 cookie 有两个缺点,一是数据不宜过大,二 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(272)
评论(0)
推荐(0)
摘要:
## 简介 cookie 是用于在 Web 客户端(一般是浏览器)和服务器之间传输少量数据的一种机制。由服务器生成,发送到客户端保存,客户端后续的每次请求都会将 cookie 带上。cookie 现在已经被多多少少地滥用了。很多公司使用 cookie 来收集用户信息、投放广告等。 cookie 有两 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(57)
评论(0)
推荐(0)
摘要:
## 简介 [`gorilla/schema`](https://github.com/gorilla/schema) 是 gorilla 开发工具包中用于处理表单的库。它提供了一个简单的方式,可以很方便地将表单数据转为结构体对象,或者将结构体对象转为表单数据。 ## 快速使用 本文代码使用 Go 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(72)
评论(0)
推荐(0)
摘要:
## 简介 上一篇文章中,我们介绍了 gorilla web 开发工具包中的路由管理库[`gorilla/mux`](https://github.com/gorilla/mux),在文章最后我们介绍了如何使用中间件处理通用的逻辑。在日常 Go Web 开发中,开发者遇到了很多相同的中间件需求,[g 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(59)
评论(0)
推荐(0)
摘要:
## 简介 [`gorilla/mux`](https://github.com/gorilla/mux)是 gorilla Web 开发工具包中的路由管理库。gorilla Web 开发包是 Go 语言中辅助开发 Web 服务器的工具包。它包括 Web 服务器开发的各个方面,有表单数据处理包[`g 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(569)
评论(0)
推荐(0)
摘要:
## 简介 几乎所有的编程语言都以`Hello World`作为入门程序的示例,其中有一部分以编写一个 Web 服务器作为实战案例的开始。每种编程语言都有很多用于编写 Web 服务器的库,或以标准库,或通过第三方库的方式提供。Go 语言也不例外。本文及后续的文章就去探索 Go 语言中的各个Web 编 阅读全文
posted @ 2023-09-29 20:54
larkwins
阅读(80)
评论(0)
推荐(0)