Fork me on GitHub

04 2022 档案

摘要:配置文件加载 yaml文件 yaml中一部分代码 # catering Global Configuration # jwt configuration jwt: signing-key: 'catering' expires-time: 604800 issuer: 'catering' # za 阅读全文
posted @ 2022-04-22 17:58 小傅啊 阅读(396) 评论(0) 推荐(0)
摘要:JWT校验 配置文件 package config type JWT struct { SigningKey string `json:"signingKey" yaml:"signing-key"` // jwt签名 ExpiresTime int64 `json:"expiresTime" ya 阅读全文
posted @ 2022-04-22 16:14 小傅啊 阅读(1063) 评论(0) 推荐(1)
摘要:Gorm解析 gorm,orm框架 Config.yaml mysql: host: 127.0.0.1 #地址 port: "3306" #端口 config: charset=utf8mb4&parseTime=True&loc=Local #配置 db-name: gva #数据库名称 use 阅读全文
posted @ 2022-04-21 14:09 小傅啊 阅读(1970) 评论(0) 推荐(0)
摘要:Zap日志解析 Config.yaml zap: level: 'info' #日志级别 format: 'console' #输出的级别,有console和json prefix: '[catering]' #输出的前缀,[catering]xxxxxxxxxxx director: 'log' 阅读全文
posted @ 2022-04-21 14:06 小傅啊 阅读(1368) 评论(0) 推荐(0)
摘要:Go WaitGroup源码解析 结构体 type WaitGroup struct { noCopy noCopy state1 [3]uint32 } 其中state1代表三个字段:counter, waiter, sema counter:计数器,每次经过wg.Add(X)或者wg.Done( 阅读全文
posted @ 2022-04-13 09:45 小傅啊 阅读(170) 评论(0) 推荐(0)