github.com/wailsapp/wails/v2/cmd/wails https://github.com/wailsapp/wails https://github.com/wailsapp/wails/blob/master/README.zh-Hans.md
github.com/olivere/elastic options := []elastic.ClientOptionFunc{ elastic.SetURL(“http://xxxxxxx:9200”), elastic.SetSniff(true), //是否开启集群嗅探 elastic.SetHealthcheckInterval(10 * time.Second), //设置两次运行状况检查之间的间隔, 默认60s elastic.SetGzip(false), //启用或禁用gzip压缩 elastic.SetErrorLog(log.New(os.Stderr, “ELASTIC “, log.LstdFlags)), //ERROR日志输出配置 elastic.SetInfoLog(log.New(os.Stdout, “”, log.LstdFlags)), //INFO级别日志输出配置 } options = append(options, elastic.SetBasicAuth( “xxxx”, //账号 “xxxxxxxxxxxxxx”, //密码 )) con, err := elastic.NewClient(options…) 1 创建索引 _, err = conf.ES().CreateIndex(indexName).BodyJson(mapping).Do(context.Background())
1,结构体没有tag,字段原样打印,大小写不变,小写字母开头的字段不会被打印 user := User{ Name: “小花”, Age: 18, Height: 162, Weight: 42, } // struct–转–>json string str_json, err := json.Marshal(user)