1
2
3
4
5
6
7
8
9
10
11
12
use crate::IpfsApi;

impl IpfsApi {
    /// Shut down the IPFS daemon
    /// This function causes the IPFS daemon to terminate
    pub fn shutdown(&self) -> Result<(), ureq::Error> {
        let url =
            format!("http://{}:{}/api/v0/shutdown", self.server, self.port);
        ureq::post(&url).call()?;
        Ok(())
    }
}