Commit 3a84c0c6 authored by Amanjeev Sethi's avatar Amanjeev Sethi

service/files: wip, Fileshare service accepts advertised files

parent b83710c3
Pipeline #1001 passed with stages
in 5 minutes and 13 seconds
......@@ -12,30 +12,35 @@ pub mod types;
// TODO: file progress
// TODO: Download links with tokens
const ASC_NAME: &'static str = "net.qaul.fileshare";
/// Filesharing service state
pub struct Fileshare {
qaul: Arc<Qaul>,
advertised: Arc<Vec<FileId>>,
impl Fileshare {
/// Initialise the filesharing service
/// Initialise the file-sharing service
/// In order to initialise, a valid and running
/// `Qaul` reference needs to be provided.
pub fn new(qaul: Arc<Qaul>) -> Result<Self> {
Ok(Self { qaul })
pub fn new(qaul: Arc<Qaul>, advertised: Arc<Vec<FileId>>) -> Result<Self> {
Ok(Self {
/// Advertise a new file into a network
/// Advertise a file into a network
pub fn advertise(
file_name: String,
file_id: FileId,
file_size: usize,
file_type: FileFilter,
file_type: FileFilter, // TODO: use mime crate for file_type
) -> Result<FileId> {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment