-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAddFileOptions.cs
100 lines (90 loc) · 3.48 KB
/
AddFileOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
namespace Ipfs.CoreApi
{
/// <summary>
/// The options when adding data to the IPFS file system.
/// </summary>
/// <seealso cref="IFileSystemApi"/>
public class AddFileOptions
{
/// <summary>
/// Determines if the data is pinned to local storage.
/// </summary>
/// <value>
/// If <b>true</b> the data is pinned to local storage and will not be
/// garbage collected. The default is <b>true</b>.
/// </value>
public bool Pin { get; set; } = true;
/// <summary>
/// The maximum number of data bytes in a block.
/// </summary>
/// <value>
/// The default is 256 * 1024 (262,144) bytes.
/// </value>
public int ChunkSize { get; set; } = 256 * 1024;
/// <summary>
/// Determines if the trickle-dag format is used for dag generation.
/// </summary>
/// <value>
/// The default is <b>false</b>.
/// </value>
public bool Trickle { get; set; } = false;
/// <summary>
/// Determines if added file(s) are wrapped in a directory object.
/// </summary>
/// <value>
/// The default is <b>false</b>.
/// </value>
public bool Wrap { get; set; } = false;
/// <summary>
/// Determines if raw blocks are used for leaf data blocks.
/// </summary>
/// <value>
/// The default is <b>false</b>.
/// </value>
/// <remarks>
/// <b>RawLeaves</b> and <see cref="ProtectionKey"/> are mutually exclusive.
/// </remarks>
public bool RawLeaves { get; set; } = false;
/// <summary>
/// The hashing algorithm name to use.
/// </summary>
/// <value>
/// The <see cref="MultiHash"/> algorithm name used to produce the <see cref="Cid"/>.
/// Defaults to <see cref="MultiHash.DefaultAlgorithmName"/>.
/// </value>
/// <seealso cref="MultiHash"/>
public string Hash { get; set; } = MultiHash.DefaultAlgorithmName;
/// <summary>
/// The encoding algorithm name to use.
/// </summary>
/// <value>
/// The <see cref="MultiBase"/> algorithm name used to produce the <see cref="Cid"/>.
/// Defaults to <see cref="MultiBase.DefaultAlgorithmName"/>.
/// </value>
/// <seealso cref="MultiBase"/>
public string Encoding { get; set; } = MultiBase.DefaultAlgorithmName;
/// <summary>
/// Determines if only file information is produced.
/// </summary>
/// <value>
/// If <b>true</b> no data is added to IPFS. The default is <b>false</b>.
/// </value>
public bool OnlyHash { get; set; } = false;
/// <summary>
/// The key name used to protect (encrypt) the file contents.
/// </summary>
/// <value>
/// The name of an existing key.
/// </value>
/// <remarks>
/// <b>ProtectionKey</b> and <see cref="RawLeaves"/> are mutually exclusive.
/// </remarks>
/// <seealso cref="IKeyApi"/>
public string? ProtectionKey { get; set; }
/// <summary>
/// Used to report the progress of a file transfer.
/// </summary>
public IProgress<TransferProgress>? Progress { get; set; }
}
}