README.md 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# go-ipfs-routing

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![Build Status](https://travis-ci.org/ipfs/go-ipfs-routing.svg?branch=master)](https://travis-ci.org/ipfs/go-ipfs-routing)

> go-ipfs-routing provides go-libp2p-routing implementations used in go-ipfs.

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#license)

## Install

Steven Allen's avatar
Steven Allen committed
19
`go-ipfs-routing` works like a set of regular Go packages:
20 21

```
Steven Allen's avatar
Steven Allen committed
22
> go get github.com/ipfs/go-ipfs-routing/...
23 24
```

Steven Allen's avatar
Steven Allen committed
25 26
This module uses [Gx](https://github.com/whyrusleeping/gx) to manage
dependencies. You can use `make all` to build it with the `gx` dependencies.
27 28 29

## Usage

Steven Allen's avatar
Steven Allen committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
This repo contains 3 different packages.

### Mock

[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs-routing/mock?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-routing/mock)

```
import "github.com/ipfs/go-ipfs-routing/mock"
```

Mock is a fake router useful for tests. It provides a mock client that
implements the `IpfsRouting` interface and a mock server from which the client
retrieves routing records.


### Offline

[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs-routing/offline?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-routing/offline)

```
import "github.com/ipfs/go-ipfs-routing/offline"
```

Offline is an offline router that can put and get records to and from a local
`Datastore` but can't retrieve them from the network.

### None

[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs-routing/none?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-routing/none)

60
```
Steven Allen's avatar
Steven Allen committed
61
import "github.com/ipfs/go-ipfs-routing/none"
62 63
```

Steven Allen's avatar
Steven Allen committed
64 65
None is a router no-op router that doesn't do anything. Puts always succeed and
lookups always fail.
66 67 68 69 70

## Contribute

PRs accepted.

Steven Allen's avatar
Steven Allen committed
71 72
Small note: If editing the README, please conform to the
[standard-readme](https://github.com/RichardLitt/standard-readme) specification.
73 74 75 76

## License

MIT © Protocol Labs, Inc.