refactor(pubky): simplify internals mod after using pkarr client

This commit is contained in:
nazeh
2024-09-22 19:12:07 +03:00
parent ad9db81b00
commit 9fd8501718
4 changed files with 0 additions and 38 deletions

View File

@@ -1,28 +1,12 @@
use pkarr::SignedPacket;
use pubky_common::crypto::PublicKey;
use reqwest::RequestBuilder;
use url::Url;
use crate::error::Result;
use crate::PubkyClient;
mod endpoints;
pub mod resolver;
impl PubkyClient {
// === Pkarr ===
pub(crate) async fn pkarr_resolve(
&self,
public_key: &PublicKey,
) -> Result<Option<SignedPacket>> {
Ok(self.pkarr.resolve(public_key).await?)
}
pub(crate) async fn pkarr_publish(&self, signed_packet: &SignedPacket) -> Result<()> {
Ok(self.pkarr.publish(signed_packet).await?)
}
// === HTTP ===
pub(crate) fn inner_request(&self, method: reqwest::Method, url: Url) -> RequestBuilder {

View File

@@ -1,2 +0,0 @@
pub mod http;
pub mod pkarr;

View File

@@ -1,20 +0,0 @@
use pkarr::SignedPacket;
use pubky_common::crypto::PublicKey;
use crate::error::Result;
use crate::PubkyClient;
impl PubkyClient {
// === Pkarr ===
pub(crate) async fn pkarr_resolve(
&self,
public_key: &PublicKey,
) -> Result<Option<SignedPacket>> {
Ok(self.pkarr.resolve(public_key).await?)
}
pub(crate) async fn pkarr_publish(&self, signed_packet: &SignedPacket) -> Result<()> {
Ok(self.pkarr.publish(signed_packet).await?)
}
}