Skip to content

Commit

Permalink
fix(DagApi): put JSON stream
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed May 13, 2018
1 parent 10e3e4d commit 14de697
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/CoreApi/IDagApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -20,7 +21,7 @@ namespace Ipfs.CoreApi
public interface IDagApi
{
/// <summary>
/// Put an IPLD node.
/// Put JSON data as an IPLD node.
/// </summary>
/// <param name="data">
/// The JSON data to send to the network.
Expand Down Expand Up @@ -50,6 +51,37 @@ Task<Cid> PutAsync(
bool pin = true,
CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Put a stream JSON data as an IPLD node.
/// </summary>
/// <param name="data">
/// The stream of JSON.
/// </param>
/// <param name="contentType">
/// The content type or format of the <paramref name="data"/>; such as "raw" or "cbor".
/// See <see cref="MultiCodec"/> for more details. Defaults to "cbor".
/// </param>
/// <param name="multiHash">
/// The <see cref="MultiHash"/> algorithm name used to produce the <see cref="Cid"/>.
/// </param>
/// <param name="pin">
/// If <b>true</b> the <paramref name="data"/> is pinned to local storage and will not be
/// garbage collected. The default is <b>true</b>.
/// </param>
/// <param name="cancel">
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
/// </param>
/// <returns>
/// A task that represents the asynchronous put operation. The task's value is
/// the data's <see cref="Cid"/>.
/// </returns>
Task<Cid> PutAsync(
Stream data,
string contentType = "cbor",
string multiHash = MultiHash.DefaultAlgorithmName,
bool pin = true,
CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Get an IPLD node.
/// </summary>
Expand Down

0 comments on commit 14de697

Please sign in to comment.