CCF
Loading...
Searching...
No Matches
lfs_interface.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
6
7#include <memory>
8#include <string>
9#include <vector>
10
15namespace ccf::indexing
16{
17 using LFSKey = std::string;
18 using LFSEncryptedContents = std::vector<uint8_t>;
19 using LFSContents = std::vector<uint8_t>;
20
22 {
30 std::atomic<FetchResultType> fetch_result;
31
33
35 };
36
37 using FetchResultPtr = std::shared_ptr<FetchResult>;
38
40 {
41 public:
42 virtual ~AbstractLFSAccess() = default;
43
44 static char const* get_subsystem_name()
45 {
46 return "LFSAccess";
47 }
48
49 virtual void store(const LFSKey& key, LFSContents&& contents) = 0;
50 virtual FetchResultPtr fetch(const LFSKey& key) = 0;
51 };
52}
Definition node_subsystem_interface.h:8
Definition lfs_interface.h:40
virtual void store(const LFSKey &key, LFSContents &&contents)=0
virtual ~AbstractLFSAccess()=default
virtual FetchResultPtr fetch(const LFSKey &key)=0
static char const * get_subsystem_name()
Definition lfs_interface.h:44
Definition indexer_interface.h:14
std::string LFSKey
Definition lfs_interface.h:17
std::vector< uint8_t > LFSContents
Definition lfs_interface.h:19
std::shared_ptr< FetchResult > FetchResultPtr
Definition lfs_interface.h:37
std::vector< uint8_t > LFSEncryptedContents
Definition lfs_interface.h:18
Definition lfs_interface.h:22
FetchResultType
Definition lfs_interface.h:24
@ Fetching
Definition lfs_interface.h:25
@ NotFound
Definition lfs_interface.h:27
@ Corrupt
Definition lfs_interface.h:28
@ Loaded
Definition lfs_interface.h:26
std::atomic< FetchResultType > fetch_result
Definition lfs_interface.h:30
LFSContents contents
Definition lfs_interface.h:34
LFSKey key
Definition lfs_interface.h:32