aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.hh
diff options
context:
space:
mode:
authorKevin Quick <kquick@galois.com>2020-09-29 08:32:06 -0700
committerKevin Quick <kquick@galois.com>2020-09-29 08:32:06 -0700
commit66c3959e8ca73ff59faacc319a47b6f93a66be64 (patch)
tree076892d5ef8b3d5d81ead006351bc460e7a08b09 /src/libstore/content-address.hh
parent5a35cc29bffc88b88f883dfcdd1bb251eab53ecd (diff)
parente2d398c200023a0d1e0054c536e7f6438bd2b139 (diff)
Merge branch 'master' into access-tokens
Diffstat (limited to 'src/libstore/content-address.hh')
-rw-r--r--src/libstore/content-address.hh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libstore/content-address.hh b/src/libstore/content-address.hh
index 22a039242..f6a6f5140 100644
--- a/src/libstore/content-address.hh
+++ b/src/libstore/content-address.hh
@@ -55,4 +55,23 @@ std::optional<ContentAddress> parseContentAddressOpt(std::string_view rawCaOpt);
Hash getContentAddressHash(const ContentAddress & ca);
+/*
+ We only have one way to hash text with references, so this is single-value
+ type is only useful in std::variant.
+*/
+struct TextHashMethod { };
+struct FixedOutputHashMethod {
+ FileIngestionMethod fileIngestionMethod;
+ HashType hashType;
+};
+
+typedef std::variant<
+ TextHashMethod,
+ FixedOutputHashMethod
+ > ContentAddressMethod;
+
+ContentAddressMethod parseContentAddressMethod(std::string_view rawCaMethod);
+
+std::string renderContentAddressMethod(ContentAddressMethod caMethod);
+
}