Skip to content

Commit

Permalink
Merge pull request #32 from daijiale/master
Browse files Browse the repository at this point in the history
add readme-zh
  • Loading branch information
bonedaddy authored Jul 26, 2019
2 parents ecf6776 + 35fce86 commit 67c7963
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 92 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ script:

after_success:
- bash <(curl -s https://codecov.io/bash)

cache:
directories:
- $GOPATH/pkg/mod
- $HOME/.cache/go-build
87 changes: 87 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 🔍 Lens

> 一个分布式互联网中的搜索引擎
Lens既是服务于分布式互联网的搜索引擎,又是一个数据收集工具。它公开了一个简单小巧的API接口用于智能地查找[IPFS](https://ipfs.io/)上的内容。

[![GoDoc](https://godoc.org/github.com/RTradeLtd/Lens?status.svg)](https://godoc.org/github.com/RTradeLtd/Lens)
[![Build Status](https://travis-ci.com/RTradeLtd/Lens.svg?branch=master)](https://travis-ci.com/RTradeLtd/Lens)
[![codecov](https://codecov.io/gh/RTradeLtd/Lens/branch/master/graph/badge.svg)](https://codecov.io/gh/RTradeLtd/Lens)
[![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
[![Latest Release](https://img.shields.io/github/release/RTradeLtd/Lens.svg?colorB=red)](https://github.com/RTradeLtd/Lens/releases)

## 多语言

[![](https://img.shields.io/badge/Lang-English-blue.svg)](README.md) [![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg)](README-zh.md)

## 特性与用例

Lens最初是与Temporal配合使用的,用户可以在使用Temporal时选择是否将他们上传的数据被Lens索引,并在贡献数据的同时获得RTC奖励。然后,用户可以使用一个简单易用的API来搜索数据内容。

[Temporal web](https://temporal.cloud/lens)中使用Lens进行搜索将会非常有益,并且可以获得RTC通证奖励。当然,我们也赋予了Lens独立部署和使用的服务,用户可以单独使用Lens进行内容录入和搜索服务,但这种方式并不能获取RTC通证奖励。


### API编程接口

Lens基于[gRPC](https://grpc.io/)暴露了一个简单的API接口。 定义如下:
[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc/blob/master/lensv2/service.proto).

Lens API的核心RPCs如下:

```proto
service LensV2 {
rpc Index(IndexReq) returns (IndexResp) {}
rpc Search(SearchReq) returns (SearchResp) {}
rpc Remove(RemoveReq) returns (RemoveResp) {}
}
```

可以在[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc)中找到。

### 编码支持

只支持IPFS[CIDs](https://github.com/multiformats/cid) 作为搜索输入值, 并且搜索结果仅支持图片,文本,和pdf文件。我们正尝试通过数据类型智能嗅探技术来解析更多内容类型。

下面表格中是我们所支持检索的文件格式:

| Mime Type | Support Level | Tested Types |
|------------------|---------------|--------------------------|
| `text/*` | Beta | `text/plain`, `text/html`|
| `image/*` | Beta | `image/jpeg` |
| `application/pdf`| Beta | `application/pdf` |

## 部署

基于Docker命令行的部署方式如下
[`rtradetech/lens`](https://cloud.docker.com/u/rtradetech/repository/docker/rtradetech/lens)


```sh
$> docker pull rtradetech/lens:latest
```

A[`docker-compose`](https://docs.docker.com/compose/) [configuration](/lens.yml)
配置信息如下:

```sh
$> wget -O lens.yml https://raw.githubusercontent.com/RTradeLtd/Lens/master/lens.yml
$> LENS=latest BASE=/my/dir docker-compose -f lens.yml up
```

## 参与开发

这个项目依赖于:

* [Go 1.11+](https://golang.org/dl/)
* [dep](https://github.com/golang/dep#installation)
* [Tesseract](https://github.com/tesseract-ocr/tesseract#installing-tesseract)
* [Tensorflow](https://www.tensorflow.org/install)
* [go-fitz](https://github.com/gen2brain/go-fitz#install)

使用 `go get` 获取代码库:

```sh
$> go get github.com/RTradeLtd/Lens
```

通过我们所提供的 [`make dep`](https://github.com/RTradeLtd/Lens/blob/master/Makefile#L13)可以一键安装所需依赖。
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and querying content on [IPFS](https://ipfs.io/).
[![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
[![Latest Release](https://img.shields.io/github/release/RTradeLtd/Lens.svg?colorB=red)](https://github.com/RTradeLtd/Lens/releases)

## Multi-Language

[![](https://img.shields.io/badge/Lang-English-blue.svg)](README.md) [![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg)](README-zh.md)

## Features and Usage

Initially integrated with Temporal, Lens will allow users to optionally have the
Expand Down
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
precision: 2
round: up
range: "50...90"
status:
project:
default:
threshold: 1
33 changes: 19 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ go 1.12
require (
bou.ke/monkey v1.0.1 // indirect
github.com/RTradeLtd/cmd/v2 v2.1.0
github.com/RTradeLtd/config v2.0.5+incompatible // indirect
github.com/RTradeLtd/config/v2 v2.1.1
github.com/RTradeLtd/go-ipfs-api v2.0.9+incompatible
github.com/RTradeLtd/go-ipfs-api v0.0.0-20190523020607-76503b15fe41
github.com/RTradeLtd/grpc v0.0.0-20190418211244-442966584c77
github.com/RTradeLtd/rtfs/v2 v2.1.0
github.com/RTradeLtd/rtfs/v2 v2.2.1-0.20190619023929-cc756767aa1c
github.com/RoaringBitmap/roaring v0.4.17 // indirect
github.com/blevesearch/bleve v0.7.1-0.20190409055314-a7b50b3b0dbd
github.com/blevesearch/blevex v0.0.0-20180227211930-4b158bb555a3 // indirect
github.com/blevesearch/go-porterstemmer v1.0.2 // indirect
github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect
github.com/bobheadxi/zapx v0.2.0
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
github.com/btcsuite/goleveldb v1.0.0 // indirect
github.com/couchbase/vellum v0.0.0-20190111184608-e91b68ff3efe // indirect
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
Expand All @@ -28,28 +27,34 @@ require (
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
github.com/gen2brain/go-fitz v0.0.0-20190406123625-a8bb4f9e52c1
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/ipfs/go-cid v0.0.1
github.com/ipfs/go-cid v0.0.2
github.com/ipfs/go-ds-badger v0.0.5 // indirect
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
github.com/ipfs/go-ipfs-files v0.0.3 // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.0.1 // indirect
github.com/maxbrunsfeld/counterfeiter/v6 v6.0.2
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/kisielk/errcheck v1.2.0 // indirect
github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec // indirect
github.com/kr/pty v1.1.4 // indirect
github.com/libp2p/go-libp2p-peer v0.1.0 // indirect
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/multiformats/go-multiaddr-dns v0.0.2 // indirect
github.com/opentracing/opentracing-go v1.1.0 // indirect
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95 // indirect
github.com/otiai10/gosseract v2.2.1+incompatible
github.com/otiai10/mint v1.2.3 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
github.com/sirupsen/logrus v1.4.1 // indirect
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
github.com/tensorflow/tensorflow v1.12.0
github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c // indirect
go.etcd.io/bbolt v1.3.2 // indirect
go.uber.org/zap v1.9.1
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d // indirect
golang.org/x/lint v0.0.0-20190409202823-959b441ac422
golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect
golang.org/x/sys v0.0.0-20190425145619-16072639606e // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a // indirect
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
google.golang.org/grpc v1.20.1
)

replace github.com/dgraph-io/badger v2.0.0-rc.2+incompatible => github.com/dgraph-io/badger v1.6.0
Loading

0 comments on commit 67c7963

Please sign in to comment.