Atproto, Router, add atproto api mod with Nsid
Sets up a generic atproto module to store atproto implementation. Mainly doing this so that I can switch between rsky/atrium as well as add my own layers on top. This also switches the old Xrpc/Router use of Nsid to the atproto api implementation of it. Next up is the DB where I'll need a bunch of these.
This commit is contained in:
parent
d4a3a71e2f
commit
db33099405
6 changed files with 858 additions and 32 deletions
|
|
@ -1,8 +1,11 @@
|
|||
use crate::router::xrpc::{
|
||||
XrpcEndpoint,
|
||||
XrpcHandler,
|
||||
QueryInput,
|
||||
ProcedureInput,
|
||||
use crate::{
|
||||
atproto::Nsid,
|
||||
router::xrpc::{
|
||||
XrpcEndpoint,
|
||||
XrpcHandler,
|
||||
QueryInput,
|
||||
ProcedureInput,
|
||||
}
|
||||
};
|
||||
use axum::Router as AxumRouter;
|
||||
use core::net::SocketAddr;
|
||||
|
|
@ -19,13 +22,13 @@ pub enum Endpoint {
|
|||
Xrpc(XrpcEndpoint),
|
||||
}
|
||||
impl Endpoint {
|
||||
pub fn new_xrpc_query<Q>(nsid: String, query: Q) -> Self
|
||||
pub fn new_xrpc_query<Q>(nsid: Nsid, query: Q) -> Self
|
||||
where
|
||||
Q: XrpcHandler<QueryInput> + Clone
|
||||
{
|
||||
Endpoint::Xrpc(XrpcEndpoint::new_query(nsid,query))
|
||||
}
|
||||
pub fn new_xrpc_procedure<P>(nsid: String, procedure: P) -> Self
|
||||
pub fn new_xrpc_procedure<P>(nsid: Nsid, procedure: P) -> Self
|
||||
where
|
||||
P: XrpcHandler<ProcedureInput> + Clone
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue