|
ORE Studio 0.0.4
|
Represents a user session in the system. More...
#include <session.hpp>

Public Member Functions | |
| std::optional< std::chrono::seconds > | duration () const |
| Calculates the session duration. | |
| bool | is_active () const |
| Checks if the session is still active. | |
Public Attributes | |
| boost::uuids::uuid | id |
| Unique identifier for this session. | |
| boost::uuids::uuid | account_id |
| Foreign key referencing the associated account. | |
| std::chrono::system_clock::time_point | start_time |
| Timestamp when the session started (login time). | |
| std::optional< std::chrono::system_clock::time_point > | end_time |
| Timestamp when the session ended (logout or disconnect). | |
| boost::asio::ip::address | client_ip |
| Client IP address. | |
| std::string | client_identifier |
| Client identifier string from handshake. | |
| std::uint16_t | client_version_major = 0 |
| Client protocol version major number. | |
| std::uint16_t | client_version_minor = 0 |
| Client protocol version minor number. | |
| std::uint64_t | bytes_sent = 0 |
| Total bytes sent to the client during this session. | |
| std::uint64_t | bytes_received = 0 |
| Total bytes received from the client during this session. | |
| std::string | country_code |
| ISO 3166-1 alpha-2 country code from geolocation. | |
| session_protocol | protocol = session_protocol::binary |
| Protocol used for this session (binary or HTTP). | |
| std::string | username |
| Username of the account that owns this session. | |
Represents a user session in the system.
This is the unified session type that serves both as:
Sessions are stored in a TimescaleDB hypertable for efficient time-series queries and automatic data lifecycle management.
| std::optional< std::chrono::seconds > duration | ( | ) | const |
Calculates the session duration.
| std::optional<std::chrono::system_clock::time_point> end_time |
Timestamp when the session ended (logout or disconnect).
Empty if session is still active.
| std::string client_identifier |
Client identifier string from handshake.
Typically contains the client application name.
| std::string country_code |
ISO 3166-1 alpha-2 country code from geolocation.
Empty if geolocation is not available or IP is private/localhost.
| std::string username |
Username of the account that owns this session.
Cached here for efficient access without needing to look up the account. Set during login and immutable for the session lifetime.