cmvr-es/cmvr-es/service/grpc/server/include/grpc_recovery_audit.h

39 lines
914 B
C++

#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
namespace cmvr::service {
struct RecoveryAuditRecord {
std::uint64_t occurred_at_unix_ms{0};
std::string stage;
std::string correlation_id;
std::string principal_id;
std::string peer;
std::string recovery_id;
std::string reason;
std::string mode;
bool all_devices{false};
std::vector<std::string> device_ids;
std::uint64_t expected_safety_epoch{0};
std::uint64_t previous_safety_epoch{0};
std::uint64_t current_safety_epoch{0};
std::string result;
};
class RecoveryAuditSink {
public:
virtual ~RecoveryAuditSink() = default;
virtual bool append(
const RecoveryAuditRecord& record,
std::string* error = nullptr) noexcept = 0;
};
std::shared_ptr<RecoveryAuditSink> makeFileRecoveryAuditSink(
std::string path);
} // namespace cmvr::service