Skip to content

Commit f641ed5

Browse files
committed
Add missing code documentation
1 parent be2671c commit f641ed5

5 files changed

+64
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
namespace OwlCore.Kubo;
22

3+
/// <summary>
4+
/// Represents an architecture for a Kubo distribution.
5+
/// </summary>
36
public class KuboDistributionArchitecture
47
{
8+
/// <summary>
9+
/// A relative download link for this architecture binary.
10+
/// </summary>
511
public string? Link { get; set; }
12+
13+
/// <summary>
14+
/// The Cid for this architecture binary.
15+
/// </summary>
616
public string? Cid { get; set; }
17+
18+
/// <summary>
19+
/// A hash that can be used to verify the downloaded data.
20+
/// </summary>
721
public string? Sha512 { get; set; }
822
}
+35-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
1-
using System;
2-
using System.Collections.Generic;
3-
4-
namespace OwlCore.Kubo;
1+
namespace OwlCore.Kubo;
52

3+
/// <summary>
4+
/// Represents data about a Kubo distribution.
5+
/// </summary>
66
public class KuboDistributionData
77
{
8+
/// <summary>
9+
/// A unique identifier for this distribution.
10+
/// </summary>
811
public string? Id { get; set; }
12+
13+
/// <summary>
14+
/// The version for this distribution.
15+
/// </summary>
916
public string? Version { get; set; }
17+
18+
/// <summary>
19+
/// The release link for this distribution.
20+
/// </summary>
1021
public string? ReleaseLink { get; set; }
22+
23+
/// <summary>
24+
/// The name of this distribution.
25+
/// </summary>
1126
public string? Name { get; set; }
27+
28+
/// <summary>
29+
/// The owner of this distribution.
30+
/// </summary>
1231
public string? Owner { get; set; }
32+
33+
/// <summary>
34+
/// A description of this distribution.
35+
/// </summary>
1336
public string? Description { get; set; }
37+
38+
/// <summary>
39+
/// The published date.
40+
/// </summary>
1441
public string? Date { get; set; }
42+
43+
/// <summary>
44+
/// The platforms for this distribution.
45+
/// </summary>
1546
public Dictionary<string, KuboDistributionPlatform>? Platforms { get; set; }
1647
}

src/Downloader/KuboDistributionJsonContext.cs

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace OwlCore.Kubo;
44

5+
/// <summary>
6+
/// Json context for serializing and deserializing <see cref="KuboDistributionData"/>.
7+
/// </summary>
58
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
69
[JsonSerializable(typeof(KuboDistributionData))]
710
public partial class KuboDistributionJsonContext : JsonSerializerContext
+11-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
using System.Collections.Generic;
2-
3-
namespace OwlCore.Kubo;
1+
namespace OwlCore.Kubo;
42

3+
/// <summary>
4+
/// Represents a distribution platform for Kubo.
5+
/// </summary>
56
public class KuboDistributionPlatform
67
{
8+
/// <summary>
9+
/// The name of the distribution platform.
10+
/// </summary>
711
public string? Name { get; set; }
12+
13+
/// <summary>
14+
/// The architectures available for this distribution.
15+
/// </summary>
816
public Dictionary<string, KuboDistributionArchitecture>? Archs { get; set; }
917
}

src/Extensions/GenericKuboExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ public static async Task<IKey> GetOrCreateKeyAsync(this IKeyApi keyApi, string k
127127
/// <param name="client">The client to use for communicating with the ipfs network.</param>
128128
/// <param name="keyName">The name of the key to get or create.</param>
129129
/// <param name="ipnsLifetime">The lifetime this ipns key should stay alive before needing to be rebroadcast by this node.</param>
130+
/// <param name="nocache">Whether to use Kubo's cache when resolving ipns keys.</param>
130131
/// <param name="size">The size of the key to create.</param>
131132
/// <param name="cancellationToken">A token that can be used to cancel the ongoing task.</param>
132133
/// <param name="getDefaultValue">Given the created ipns key, provides the default value to be published to it.</param>
133-
/// <returns></returns>
134134
public static async Task<(IKey Key, TResult Value)> GetOrCreateKeyAsync<TResult>(this ICoreApi client, string keyName, Func<IKey, TResult> getDefaultValue, TimeSpan ipnsLifetime, bool nocache, int size = 4096, CancellationToken cancellationToken = default)
135135
{
136136
// Get or create ipns key

0 commit comments

Comments
 (0)