---
title: llarp/rpc/endpoints.hpp

---

# llarp/rpc/endpoints.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::rpc](Namespaces/namespacellarp_1_1rpc.md)**  |
| **[llarp::rpc::endpoint](Namespaces/namespacellarp_1_1rpc_1_1endpoint.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::rpc::endpoint::Endpoint](Classes/structllarp_1_1rpc_1_1endpoint_1_1Endpoint.md)**  |
| struct | **[llarp::rpc::endpoint::Pure](Classes/structllarp_1_1rpc_1_1endpoint_1_1Pure.md)**  |
| struct | **[llarp::rpc::endpoint::Halt](Classes/structllarp_1_1rpc_1_1endpoint_1_1Halt.md)**  |
| struct | **[llarp::rpc::endpoint::GetVersion](Classes/structllarp_1_1rpc_1_1endpoint_1_1GetVersion.md)**  |
| struct | **[llarp::rpc::endpoint::Logs](Classes/structllarp_1_1rpc_1_1endpoint_1_1Logs.md)**  |
| struct | **[llarp::rpc::endpoint::Stateful](Classes/structllarp_1_1rpc_1_1endpoint_1_1Stateful.md)**  |
| struct | **[llarp::rpc::endpoint::GetStatus](Classes/structllarp_1_1rpc_1_1endpoint_1_1GetStatus.md)**  |




## Source code

```cpp
#pragma once

#include <string_view>
#include <llarp/config/config.hpp>
#include <oxenmq/oxenmq.h>
#include <oxenmq/address.h>
#include <oxen/log/omq_logger.hpp>

namespace llarp
{
  struct AbstractRouter;
}

namespace llarp::rpc::endpoint
{
  // base struct to be inherited
  struct Endpoint
  {
    Endpoint(){};
    Endpoint(std::string _str) : response(_str){};
    Endpoint(nlohmann::json _json) : response(_json){};
    ~Endpoint() = default;

    std::variant<std::string, nlohmann::json> response;
  };

  // these endpoints use the send_reply() functionality to send message in the current cycle
  struct Pure : virtual Endpoint
  {
    using Endpoint::Endpoint;
  };

  struct Halt : virtual Pure
  {
    using Pure::Pure;
  };

  struct GetVersion : virtual Pure
  {
    using Pure::Pure;
  };

  struct Logs : virtual Pure
  {};

  // these endpoints use the reply() functionality to send a delayed message in the next cycle
  struct Stateful : virtual public Endpoint
  {
    using Endpoint::Endpoint;
  };

  struct GetStatus : virtual public Stateful
  {
    GetStatus() : verbose(false){};
    GetStatus(std::string _str) : verbose(false)
    {
      response = _str;
    };
    GetStatus(nlohmann::json _json) : verbose(false)
    {
      response = _json;
    };

    ~GetStatus() = default;

    bool verbose;
  };

}  // namespace llarp::rpc::endpoint

/*
    Fast Endpoints (send_reply):
      - halt
      - version
      - logs

    Slow Endpoints (reply):
      - get_status
      - status
      - quic_connect
      - quic_listener
      - lookup_snode
      - endpoint
      - exit
      - dns_query
      - config

*/
```


-------------------------------

Updated on 2023-01-20 at 23:19:39 +0000
