refactor: simplify endpoint and capabilities
This commit is contained in:
@@ -16,3 +16,22 @@ struct EndpointCapability {
|
||||
int method;
|
||||
std::vector<ParamSpec> params;
|
||||
};
|
||||
|
||||
struct EndpointInfo {
|
||||
String uri;
|
||||
int method;
|
||||
std::vector<ParamSpec> params;
|
||||
String serviceName; // Name of the service that registered this endpoint
|
||||
bool isLocal; // Whether this endpoint is on the local node
|
||||
|
||||
// Constructor for individual parameters
|
||||
EndpointInfo(const String& u, int m, const std::vector<ParamSpec>& p, const String& service, bool local)
|
||||
: uri(u), method(m), params(p), serviceName(service), isLocal(local) {}
|
||||
|
||||
// Constructor for easy conversion from EndpointCapability
|
||||
EndpointInfo(const EndpointCapability& cap, const String& service = "", bool local = true)
|
||||
: uri(cap.uri), method(cap.method), params(cap.params), serviceName(service), isLocal(local) {}
|
||||
|
||||
// Default constructor
|
||||
EndpointInfo() : isLocal(true) {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user