摘要: 一、记住密码 设置记住密码(默认15分钟): git config --global credential.helper cache 设置记住密码时间: git config credential.helper 'cache --timeout=3600' 永久保存密码: git config -- 阅读全文
posted @ 2020-12-29 11:23 枯藤老艹树 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 1、切片忠找出最大数放到最后 package main import "fmt" func main() { a := []int{101, 108, 107, 1000, 1000, 392, 105, 109, 103, 102} fmt.Println(a) max := a[0] var m 阅读全文
posted @ 2020-12-29 10:57 枯藤老艹树 阅读(109) 评论(0) 推荐(0) 编辑
摘要: go 查询es报错: 一、问题描述: elasticsearch 分页查询数据,刚开始数据还可以正常显示,但是到后面就报错: panic: elastic: Error 400 (Bad Request): all shards failed [type=search_phase_execution 阅读全文
posted @ 2020-10-16 15:53 枯藤老艹树 阅读(2963) 评论(0) 推荐(0) 编辑
摘要: 判断通道是否有数据,无数据退出 package main import ( "bufio" "fmt" "io" "os" ) func FileRead(filename string, filesChan chan string) { defer close(filesChan) // 处理完退 阅读全文
posted @ 2020-09-17 18:46 枯藤老艹树 阅读(1185) 评论(0) 推荐(0) 编辑
摘要: 1、下载所有依赖(切换到项目目录) go get -d -v ./... 2、windows下打Linux包 set GOARCH=amd64 set GOOS=linux go build 阅读全文
posted @ 2020-09-04 11:14 枯藤老艹树 阅读(165) 评论(0) 推荐(0) 编辑
摘要: gin 框架解决跨域问题 package main import ( "gin_es7/es" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "time" ) func Atime(t string) string { //fmtt 阅读全文
posted @ 2020-09-02 17:53 枯藤老艹树 阅读(268) 评论(0) 推荐(0) 编辑
摘要: go 修改请求头,添加参数请求URL // 打印请求结果 func printBody(r *http.Response) { defer func() { _ = r.Body.Close() }() content, err := ioutil.ReadAll(r.Body) if err != 阅读全文
posted @ 2020-08-27 10:45 枯藤老艹树 阅读(165) 评论(0) 推荐(0) 编辑
摘要: es 从文件中读取查询信息 统计后放到文件中 package main import ( "context" "fmt" elastic "github.com/olivere/elastic/v7" "time" ) var host = []string{ "http://192.168.0.2 阅读全文
posted @ 2020-08-21 12:02 枯藤老艹树 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 版本为7.4.0 先按照kafka集群,请看另一个博客 kafak部署 filebeat配置文件 filebeat.inputs: - type: log enabled: true paths: - /log/java001.log tags: ["java001"] exclude_lines: 阅读全文
posted @ 2020-07-09 10:48 枯藤老艹树 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 安装导入导出命令 npm install elasticdump 数据导出 ./node_modules/elasticdump/bin/elasticdump --input=http://127.0.0.1:9211/myindex --output=./myindex_m.json --typ 阅读全文
posted @ 2020-07-09 10:39 枯藤老艹树 阅读(1497) 评论(0) 推荐(0) 编辑