From 981daa7ee8b57510118f98bd4a0f06e3bb0adc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 25 Jun 2018 21:01:57 +0200 Subject: [PATCH] providers: add some docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- providers/providers.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/providers/providers.go b/providers/providers.go index 5d001f3e660..5fdd91c7fcf 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -46,9 +46,17 @@ type blockRequest struct { Ctx context.Context } -// Interface defines providers interface to libp2p routing system +// Interface is an abstraction on top of the libp2p content routing which +// optimizes common content routing tasks type Interface interface { + // Provide a block to the network. Calls to this method are usually + // non-blocking with back-pressure which might happen under load Provide(k *cid.Cid) error + + // ProvideRecursive provides graph to the network. Calls to this method are + // usually non-blocking with back-pressure which might happen under load + // + // Note: only call this method with offline NodeGetter. ProvideRecursive(ctx context.Context, n ipld.Node, serv ipld.NodeGetter) error FindProviders(ctx context.Context, k *cid.Cid) error