From fd2050dda6e87a85ef6928155263f3197ba1c1b9 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 6 Apr 2020 15:42:36 -0700 Subject: [PATCH 1/2] feat: add private routing config field That way, users can enable/disable/configure routing on their local network. --- routing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routing.go b/routing.go index e601cd5..d63140a 100644 --- a/routing.go +++ b/routing.go @@ -4,4 +4,8 @@ package config type Routing struct { // Type sets default daemon routing mode. Type string + + // PrivateType sets the routing mode for private networks. If unset, + // Type will be used. + PrivateType string } From f5a48d80f920b5baa6c1ac546f7eff82e0896adf Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 6 Apr 2020 17:32:07 -0700 Subject: [PATCH 2/2] doc: add a bit of documentation. --- README.md | 27 +++++++++++++++++++++++++++ routing.go | 6 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..80799d4 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +go-ipfs-config +================== + +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai) +[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/) +[![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/#ipfs:matrix.org) +[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs) +[![Discord](https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord&style=flat-square)](https://discord.gg/24fmuwR) + +> Go-ipfs configuration datastructure. + +Documentation lives in the go-ipfs repo: [docs/config.md](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md). + +## Table of Contents + +- [Contribute](#contribute) +- [License](#license) + +## Contribute + +PRs are welcome! + +Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. + +## License + +MIT © Juan Batiz-Benet diff --git a/routing.go b/routing.go index d63140a..341e265 100644 --- a/routing.go +++ b/routing.go @@ -3,9 +3,11 @@ package config // Routing defines configuration options for libp2p routing type Routing struct { // Type sets default daemon routing mode. + // + // Can be one of "dht", "dhtclient", "dhtserver", "none", or unset. Type string - // PrivateType sets the routing mode for private networks. If unset, - // Type will be used. + // PrivateType sets the routing mode for private networks. Can take the + // same values as Type and defaults to Type if unset. PrivateType string }