/images/avatar.png

Context

Go Web 编程 Context Go 语言的 Context 既, 上下文。 是Golang 语言标准库 golang.org/x/net/context。 golang 的 Context包, 是专门用来简

Cookie 与 Session

Go Web 编程 HTTP 协议是无状态的,对于一个浏览器发出的多次请求,WEB 服务器无法区分, 是不是来源于同一个浏览器, 所以诞生了Cookie 与 Session 使某个域名

Gin templates

Go Web 编程 gin 框架 templates templates 的基础语法以及概念在前面的文章中有记录 HTML 基础概念 gin 下的例子 go 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

Gin 框架

Go Web 编程 Gin 框架 官方 中文文档 https://gin-gonic.com/zh-cn/docs/ Gin 简介 Gin 是一个用 Go (Golang) 编写的 HTTP web 框架。 使用 httprouter, 因此是一个拥有很好性能的API框架。 Gin 特性 快速 基于 Radix 树的路由,内存占用

Go Jwt With Token

JWT JWT全称JSON Web Token是一种跨域认证解决方案, 属于一个开放的标准, 它规定了一种 Token 实现方式, 目前多用于前后端分离项目和OAuth2.

Go Web validator 参数校验

Validator Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving。 github - https://github.com/go-playground/validator validator Fields Tag Description eqcsfield Field Equals Another Field (relative) eqfield Field Equals Another Field fieldcontains NOT DOCUMENTED IN doc.go fieldexcludes NOT DOCUMENTED IN doc.go gtcsfield Field Greater Than Another Relative Field gtecsfield Field Greater Than or Equal To Another Relative Field gtefield Field Greater