随笔分类 - Go语言
摘要:Person: Please give me an example where gin implements server push and the front end receives data. ChatGPT: Sure! Here's an example of how you could
阅读全文
摘要:Person: How to implement login in the system using gin and html template? ChatGPT: To implement a login system using the Gin web framework and HTML te
阅读全文
摘要:Person: JavaScript实现非对称加密 ChatGPT: JavaScript 可以使用公钥密码学算法来实现非对称加密。常用的公钥密码学算法包括 RSA 和 ECC。 下面是一个使用 RSA 算法实现非对称加密的示例: // 生成 RSA 密钥对 const { publicKey, p
阅读全文
摘要:##约定的列名 type User struct { ID uint // 列名是 `id` Name string // 列名是 `name` Birthday time.Time // 列名是 `birthday` CreatedAt time.Time // 列名是 `created_at`
阅读全文
摘要:时间日期格式化 time.Now().Format("2006-01-02") 原生DefaultServeMux支持restful路由 ref: https://towardsdev.com/how-to-create-rest-api-in-golang-6448d1de294c package
阅读全文