mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
a252bb1307
Summary: * use `std::nullopt` * TODO about sandcastle_instance_id in opensource version Reviewed By: chadaustin Differential Revision: D27575732 fbshipit-source-id: bf76970a15fee5a3dc1e4e411ea70f5af7248496
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
struct SessionInfo {
|
|
std::string username;
|
|
std::string hostname;
|
|
// TODO(nga): sandcastle is Facebook-specific, should not be used in
|
|
// opensource version.
|
|
std::optional<uint64_t> sandcastleInstanceId;
|
|
std::string os;
|
|
std::string osVersion;
|
|
std::string edenVersion;
|
|
};
|
|
|
|
std::string getOperatingSystemName();
|
|
std::string getOperatingSystemVersion();
|
|
|
|
/**
|
|
* Returns the result of calling gethostname() in a std::string. Throws an
|
|
* exception on failure.
|
|
*/
|
|
std::string getHostname();
|
|
|
|
/**
|
|
* Return the best guess of sandcastle instance id from the environment,
|
|
* or return empty if sandcastle instance id is unknown.
|
|
*/
|
|
// TODO(nga): sandcastle is Facebook-specific, should not be used in
|
|
// opensource version.
|
|
std::optional<uint64_t> getSandcastleInstanceId();
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|