api started

This commit is contained in:
Tim Blume 2021-01-02 00:19:42 +01:00
parent 4d5f0fd233
commit efa3677d69
4 changed files with 52 additions and 5 deletions

18
include/httpreceiver.h Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include <include/api.h>
#include <QObject>
namespace http {
#define HTTPReceiverInterfaceIID "bigsnitch.api.HTTPReceiverInterface/100"
class ReceiverInterface {
public:
virtual ~ReceiverInterface() = default;
};
}
Q_DECLARE_INTERFACE(http::ReceiverInterface, HTTPReceiverInterfaceIID)

21
include/httpsender.h Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <include/api.h>
#include <QObject>
namespace http {
#define HTTPSenderInterfaceIID "bigsnitch.api.HTTPSenderInterface/100"
class SenderInterface {
public:
virtual ~SenderInterface() = default;
virtual int send(http::Request request);
virtual bool received(int id);
virtual std::optional<http::Response> receive(int id);
};
}
Q_DECLARE_INTERFACE(http::SenderInterface, HTTPSenderInterfaceIID)