02 2020 档案

摘要:查看编码 show variables like 'char%'; 结果 + + + | Variable_name | Value | + + + | character_set_client | gbk | | character_set_connection | gbk | | charact 阅读全文
posted @ 2020-02-24 09:25 jihite 阅读(997) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/a036405f989c 待整理。。。 阅读全文
posted @ 2020-02-23 16:17 jihite 阅读(1918) 评论(0) 推荐(0) 编辑
摘要:1. 安装zookeeper brew install zookeeper 默认安装位置 启动文件: /usr/local/Cellar/zookeeper/3.4.10/bin/ 配置文件: /usr/local/etc/zookeeper/ 2. 启动zookeeper 服务 nohup zoo 阅读全文
posted @ 2020-02-23 16:16 jihite 阅读(11132) 评论(0) 推荐(2) 编辑
摘要:python小例-生产、消费 生产 #!/usr/bin/env python # -*- coding: utf-8 -*- from kafka import KafkaProducer import json producer = KafkaProducer(bootstrap_servers 阅读全文
posted @ 2020-02-17 08:53 jihite 阅读(1622) 评论(0) 推荐(0) 编辑
摘要:命令行安装 yum install golang 默认安装目录/usr/lib/golang/ (不同系统不一样,可通过搜索golang关键字查找: find / -name golang) 卸载 yum remove golang 配置环境变量 手动安装 官网下载安装包:链接 如:wget htt 阅读全文
posted @ 2020-02-15 18:29 jihite 阅读(11181) 评论(0) 推荐(0) 编辑
摘要:作者:Latm Ake链接:https://www.zhihu.com/question/20523036/answer/35225920来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 问题 由于zip格式中并没有指定编码格式,Windows下生成的zip文件中的编码 阅读全文
posted @ 2020-02-11 19:50 jihite 阅读(4949) 评论(1) 推荐(2) 编辑
摘要:功能 自动生产接口文档 安装 # 安装swaggo get -u github.com/swaggo/swag/cmd/swag # 安装 gin-swagger go get -u github.com/swaggo/gin-swagger go get -u github.com/swaggo/ 阅读全文
posted @ 2020-02-07 22:37 jihite 阅读(888) 评论(0) 推荐(0) 编辑
摘要:安装beengo go get github.com/astaxie/beego/validation 直接使用 package main import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name s 阅读全文
posted @ 2020-02-07 00:36 jihite 阅读(2527) 评论(0) 推荐(0) 编辑
摘要:代码实现 main.go package main import ( "fmt" "github.com/jihite/go-gin-example/pkg/setting" "github.com/jihite/go-gin-example/routers" "net/http" ) func m 阅读全文
posted @ 2020-02-05 11:56 jihite 阅读(2727) 评论(0) 推荐(0) 编辑
摘要:初始化 执行go mod init module-name,其中module-name为包名字,执行完后会生成go.mod文件,如下 module module-name go 1.13 拉取依赖 go get *** 如:go get github.com/jinzhu/gorm 更多参数 用 g 阅读全文
posted @ 2020-02-04 21:04 jihite 阅读(3150) 评论(1) 推荐(0) 编辑
摘要:背景 有些linux服务器处于内网,并且没有公网ip,故要想与外网进行http/https通信只能通过nat或者加proxy的方式。nat服务器有网段的限制,而http/https proxy代理则没有,使用起来也方便。 同时有部分网址不需要走代理 解决 添加环境变量 设置代理 export htt 阅读全文
posted @ 2020-02-03 22:05 jihite 阅读(13292) 评论(0) 推荐(0) 编辑
摘要:背景 golang没有queue这种类型,不过可以用slice、list模拟 slice当queue 声明队列 var queue []int 入队一个元素: queue = append(queue, 1) 出队一个元素: if len(queue) > 1 { queue = queue[1:] 阅读全文
posted @ 2020-02-03 21:07 jihite 阅读(3203) 评论(0) 推荐(0) 编辑
摘要:UML Model 基本模型定义 type Model struct { ID int `gorm:"primary_key" json:"id"` CreatedOn int `json:"created_on"` ModifiedOn int `json:"modified_on"` Delet 阅读全文
posted @ 2020-02-02 20:34 jihite 阅读(812) 评论(0) 推荐(0) 编辑
摘要:go build 编译文件,输出可执行文件 (参考) go clean 删除编译生成的可执行文件 go run 编译源码,并执行main()函数 go build 编译源码,生成可执行文件,并将可执行文件移动到 $GOPATH/pkg 或者$GOPATH/bin go test 读取源码目录下面 阅读全文
posted @ 2020-02-01 17:52 jihite 阅读(226) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示