-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee281ba
commit fce1343
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ipfs.CoreApi | ||
{ | ||
/// <summary> | ||
/// DNS mapping to IPFS. | ||
/// </summary> | ||
/// <remarks> | ||
/// Multihashes are hard to remember, but domain names are usually easy to | ||
/// remember. To create memorable aliases for multihashes, DNS TXT | ||
/// records can point to other DNS links, IPFS objects, IPNS keys, etc. | ||
/// </remarks> | ||
public interface IDnsApi | ||
{ | ||
|
||
/// <summary> | ||
/// Resolve a domain name to an IPFS path. | ||
/// </summary> | ||
/// <param name="name"> | ||
/// An domain name, such as "ipfs.io". | ||
/// </param> | ||
/// <param name="recursive"> | ||
/// Resolve until the result is not a DNS link. Defaults to <b>false</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 operation. The task's value is | ||
/// the resolved IPFS path as a <see cref="string"/>, such as | ||
/// <c>/ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao</c>. | ||
/// </returns> | ||
Task<string> ResolveAsync( | ||
string name, | ||
bool recursive = false, | ||
CancellationToken cancel = default(CancellationToken) | ||
); | ||
} | ||
} |