Go源码阅读——github.com/medcl/esm —— esapi.go
esm(An Elasticsearch Migration Tool)—— esapi.go
https://github.com/medcl/esm release: v0.6.1
通过阅读好的源代码,细致思考,理性分析并借鉴优秀实践经验,提高 zuoyang 的编程水平,所谓 "他山之石,可以攻玉" 该是如此吧。
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | /* Copyright 2016 Medcl (m AT medcl.net) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import "bytes" /* 定义了一些常用的 API 的接口 */ type ESAPI interface { /*获取 Elasticsearch 集群的健康状态*/ ClusterHealth() *ClusterHealth /*批量插入、更新或删除文档*/ Bulk(data *bytes.Buffer) /*获取索引的设置信息*/ GetIndexSettings(indexNames string) (*Indexes, error) /*删除索引*/ DeleteIndex(name string) error /*创建索引*/ CreateIndex(name string, settings map [string] interface {}) error /*获取一个或多个索引的映射信息*/ GetIndexMappings(copyAllIndexes bool, indexNames string) (string, int, *Indexes, error) /*更新索引的设置信息*/ UpdateIndexSettings(indexName string, settings map [string] interface {}) error /*更新索引的映射信息*/ UpdateIndexMapping(indexName string, mappings map [string] interface {}) error /*滚动搜索,用于读取大批量数据*/ NewScroll(indexNames string, scrollTime string, docBufferCount int, query string, slicedId, maxSlicedCount int, fields string) ( interface {}, error) /*获取下一批滚动搜索结果*/ NextScroll(scrollTime string, scrollId string) ( interface {}, error) /*刷新一个或多个索引的缓存*/ Refresh(name string) (err error) } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具