xo-alloc/xo-pywebutil/src/pywebutil/pywebutil.cpp
Roland Conybeare 3f1fd834d5 Add 'xo-pywebutil/' from commit '578b3d724a'
git-subtree-dir: xo-pywebutil
git-subtree-mainline: a2a8b936b9
git-subtree-split: 578b3d724a
2025-05-11 14:55:44 -05:00

33 lines
1.1 KiB
C++

/* @file pywebutil.cpp */
#include "pywebutil.hpp"
#include "xo/webutil/HttpEndpointDescr.hpp"
#include "xo/webutil/StreamEndpointDescr.hpp"
#include "xo/pyutil/pyutil.hpp"
#include <pybind11/chrono.h>
namespace xo {
//using xo::web::Alist;
using xo::web::HttpEndpointDescr;
//using xo::time::utc_nanos;
namespace py = pybind11;
namespace web {
PYBIND11_MODULE(PYWEBUTIL_MODULE_NAME(), m) {
//PYxxx_IMPORT_MODULE();
/* module docstring */
m.doc() = "pybind11 plugin for xo.web_util";
py::class_<HttpEndpointDescr>(m, "EndpointDescr")
.def_property_readonly("uri_pattern", &HttpEndpointDescr::uri_pattern)
.def("__repr__", &HttpEndpointDescr::display_string);
py::class_<StreamEndpointDescr>(m, "StreamEndpointDescr")
.def_property_readonly("uri_pattern", &StreamEndpointDescr::uri_pattern)
.def("__repr__", &StreamEndpointDescr::display_string);
} /*web*/
} /*namespace web*/
} /*namespace xo*/
/* end pywebutil.cpp */