From 55c08168d4c81d75375893f82618f4fb8f4f44ed Mon Sep 17 00:00:00 2001 From: zu1k Date: Fri, 9 Jul 2021 20:41:29 +0800 Subject: [PATCH] docs: Add docs for IPFS --- docs/go-storage/services/ipfs.md | 42 +++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/go-storage/services/ipfs.md b/docs/go-storage/services/ipfs.md index 01a1467b..6902ed6f 100644 --- a/docs/go-storage/services/ipfs.md +++ b/docs/go-storage/services/ipfs.md @@ -1,3 +1,43 @@ +[InterPlanetary File System(IPFS)](https://ipfs.io/) + ## Project - \ No newline at end of file + + +## Config + +### Storager + +#### Available Pairs + +| Name | Required | Comments | +| ---- | -------- | -------- | +| [endpoint](go-storage/pairs/endpoint.md) | Y | endpoint | +| [work_dir](go-storage/pairs/work_dir.md) | N | work dir | + +#### Examples + +Init storager (see [this page](go-storage/operations/index.md#how-to-initialize-a-servicerstorager) for details) + +```go +import ( + _ "github.com/beyondstorage/go-service-ipfs" + "github.com/beyondstorage/go-storage/v4/services" +) + +store, err := services.NewStoragerFromString("ipfs:///?endpoint=") // endpoint example: http:127.0.0.1:5001 +if err != nil { + log.Fatalf("ipfs new service: %v", err) +} + +``` + +## Implementation + +This service implements following interfaces: + +- [Storager](../operations/storager/index.md) + +- [Copier](../operations/copy.md) + +- [Mover](../operations/move.md)