Skip to content

Commit 67c7963

Browse files
authored
Merge pull request #32 from daijiale/master
add readme-zh
2 parents ecf6776 + 35fce86 commit 67c7963

File tree

7 files changed

+299
-92
lines changed

7 files changed

+299
-92
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ script:
3232

3333
after_success:
3434
- bash <(curl -s https://codecov.io/bash)
35+
36+
cache:
37+
directories:
38+
- $GOPATH/pkg/mod
39+
- $HOME/.cache/go-build

README-zh.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# 🔍 Lens
2+
3+
> 一个分布式互联网中的搜索引擎
4+
5+
Lens既是服务于分布式互联网的搜索引擎,又是一个数据收集工具。它公开了一个简单小巧的API接口用于智能地查找[IPFS](https://ipfs.io/)上的内容。
6+
7+
[![GoDoc](https://godoc.org/github.com/RTradeLtd/Lens?status.svg)](https://godoc.org/github.com/RTradeLtd/Lens)
8+
[![Build Status](https://travis-ci.com/RTradeLtd/Lens.svg?branch=master)](https://travis-ci.com/RTradeLtd/Lens)
9+
[![codecov](https://codecov.io/gh/RTradeLtd/Lens/branch/master/graph/badge.svg)](https://codecov.io/gh/RTradeLtd/Lens)
10+
[![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
11+
[![Latest Release](https://img.shields.io/github/release/RTradeLtd/Lens.svg?colorB=red)](https://github.com/RTradeLtd/Lens/releases)
12+
13+
## 多语言
14+
15+
[![](https://img.shields.io/badge/Lang-English-blue.svg)](README.md) [![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg)](README-zh.md)
16+
17+
## 特性与用例
18+
19+
Lens最初是与Temporal配合使用的,用户可以在使用Temporal时选择是否将他们上传的数据被Lens索引,并在贡献数据的同时获得RTC奖励。然后,用户可以使用一个简单易用的API来搜索数据内容。
20+
21+
[Temporal web](https://temporal.cloud/lens)中使用Lens进行搜索将会非常有益,并且可以获得RTC通证奖励。当然,我们也赋予了Lens独立部署和使用的服务,用户可以单独使用Lens进行内容录入和搜索服务,但这种方式并不能获取RTC通证奖励。
22+
23+
24+
### API编程接口
25+
26+
Lens基于[gRPC](https://grpc.io/)暴露了一个简单的API接口。 定义如下:
27+
[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc/blob/master/lensv2/service.proto).
28+
29+
Lens API的核心RPCs如下:
30+
31+
```proto
32+
service LensV2 {
33+
rpc Index(IndexReq) returns (IndexResp) {}
34+
rpc Search(SearchReq) returns (SearchResp) {}
35+
rpc Remove(RemoveReq) returns (RemoveResp) {}
36+
}
37+
```
38+
39+
可以在[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc)中找到。
40+
41+
### 编码支持
42+
43+
只支持IPFS[CIDs](https://github.com/multiformats/cid) 作为搜索输入值, 并且搜索结果仅支持图片,文本,和pdf文件。我们正尝试通过数据类型智能嗅探技术来解析更多内容类型。
44+
45+
下面表格中是我们所支持检索的文件格式:
46+
47+
| Mime Type | Support Level | Tested Types |
48+
|------------------|---------------|--------------------------|
49+
| `text/*` | Beta | `text/plain`, `text/html`|
50+
| `image/*` | Beta | `image/jpeg` |
51+
| `application/pdf`| Beta | `application/pdf` |
52+
53+
## 部署
54+
55+
基于Docker命令行的部署方式如下
56+
[`rtradetech/lens`](https://cloud.docker.com/u/rtradetech/repository/docker/rtradetech/lens)
57+
58+
59+
```sh
60+
$> docker pull rtradetech/lens:latest
61+
```
62+
63+
A[`docker-compose`](https://docs.docker.com/compose/) [configuration](/lens.yml)
64+
配置信息如下:
65+
66+
```sh
67+
$> wget -O lens.yml https://raw.githubusercontent.com/RTradeLtd/Lens/master/lens.yml
68+
$> LENS=latest BASE=/my/dir docker-compose -f lens.yml up
69+
```
70+
71+
## 参与开发
72+
73+
这个项目依赖于:
74+
75+
* [Go 1.11+](https://golang.org/dl/)
76+
* [dep](https://github.com/golang/dep#installation)
77+
* [Tesseract](https://github.com/tesseract-ocr/tesseract#installing-tesseract)
78+
* [Tensorflow](https://www.tensorflow.org/install)
79+
* [go-fitz](https://github.com/gen2brain/go-fitz#install)
80+
81+
使用 `go get` 获取代码库:
82+
83+
```sh
84+
$> go get github.com/RTradeLtd/Lens
85+
```
86+
87+
通过我们所提供的 [`make dep`](https://github.com/RTradeLtd/Lens/blob/master/Makefile#L13)可以一键安装所需依赖。

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and querying content on [IPFS](https://ipfs.io/).
1212
[![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
1313
[![Latest Release](https://img.shields.io/github/release/RTradeLtd/Lens.svg?colorB=red)](https://github.com/RTradeLtd/Lens/releases)
1414

15+
## Multi-Language
16+
17+
[![](https://img.shields.io/badge/Lang-English-blue.svg)](README.md) [![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg)](README-zh.md)
18+
1519
## Features and Usage
1620

1721
Initially integrated with Temporal, Lens will allow users to optionally have the

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
precision: 2
3+
round: up
4+
range: "50...90"
5+
status:
6+
project:
7+
default:
8+
threshold: 1

go.mod

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ go 1.12
55
require (
66
bou.ke/monkey v1.0.1 // indirect
77
github.com/RTradeLtd/cmd/v2 v2.1.0
8-
github.com/RTradeLtd/config v2.0.5+incompatible // indirect
98
github.com/RTradeLtd/config/v2 v2.1.1
10-
github.com/RTradeLtd/go-ipfs-api v2.0.9+incompatible
9+
github.com/RTradeLtd/go-ipfs-api v0.0.0-20190523020607-76503b15fe41
1110
github.com/RTradeLtd/grpc v0.0.0-20190418211244-442966584c77
12-
github.com/RTradeLtd/rtfs/v2 v2.1.0
11+
github.com/RTradeLtd/rtfs/v2 v2.2.1-0.20190619023929-cc756767aa1c
1312
github.com/RoaringBitmap/roaring v0.4.17 // indirect
1413
github.com/blevesearch/bleve v0.7.1-0.20190409055314-a7b50b3b0dbd
1514
github.com/blevesearch/blevex v0.0.0-20180227211930-4b158bb555a3 // indirect
1615
github.com/blevesearch/go-porterstemmer v1.0.2 // indirect
1716
github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect
1817
github.com/bobheadxi/zapx v0.2.0
19-
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
18+
github.com/btcsuite/goleveldb v1.0.0 // indirect
2019
github.com/couchbase/vellum v0.0.0-20190111184608-e91b68ff3efe // indirect
2120
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d // indirect
2221
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
@@ -28,28 +27,34 @@ require (
2827
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
2928
github.com/gen2brain/go-fitz v0.0.0-20190406123625-a8bb4f9e52c1
3029
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
31-
github.com/ipfs/go-cid v0.0.1
30+
github.com/ipfs/go-cid v0.0.2
31+
github.com/ipfs/go-ds-badger v0.0.5 // indirect
32+
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
33+
github.com/ipfs/go-ipfs-files v0.0.3 // indirect
34+
github.com/jessevdk/go-flags v1.4.0 // indirect
3235
github.com/jmhodges/levigo v1.0.0 // indirect
33-
github.com/libp2p/go-libp2p-pubsub v0.0.1 // indirect
34-
github.com/maxbrunsfeld/counterfeiter/v6 v6.0.2
35-
github.com/mitchellh/go-homedir v1.1.0 // indirect
36+
github.com/kisielk/errcheck v1.2.0 // indirect
37+
github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec // indirect
38+
github.com/kr/pty v1.1.4 // indirect
39+
github.com/libp2p/go-libp2p-peer v0.1.0 // indirect
40+
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
41+
github.com/multiformats/go-multiaddr-dns v0.0.2 // indirect
42+
github.com/opentracing/opentracing-go v1.1.0 // indirect
3643
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95 // indirect
3744
github.com/otiai10/gosseract v2.2.1+incompatible
3845
github.com/otiai10/mint v1.2.3 // indirect
3946
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
4047
github.com/sirupsen/logrus v1.4.1 // indirect
4148
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
49+
github.com/stretchr/objx v0.2.0 // indirect
50+
github.com/syndtr/goleveldb v1.0.0 // indirect
4251
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
4352
github.com/tensorflow/tensorflow v1.12.0
44-
github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c // indirect
4553
go.etcd.io/bbolt v1.3.2 // indirect
4654
go.uber.org/zap v1.9.1
47-
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d // indirect
4855
golang.org/x/lint v0.0.0-20190409202823-959b441ac422
49-
golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect
50-
golang.org/x/sys v0.0.0-20190425145619-16072639606e // indirect
51-
golang.org/x/text v0.3.2 // indirect
52-
golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a // indirect
5356
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
5457
google.golang.org/grpc v1.20.1
5558
)
59+
60+
replace github.com/dgraph-io/badger v2.0.0-rc.2+incompatible => github.com/dgraph-io/badger v1.6.0

0 commit comments

Comments
 (0)