Update vented and add copyright comments

Signed-off-by: trivernis <trivernis@protonmail.com>
main
trivernis 4 years ago
parent 3fb35e9383
commit 7b75372755
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

4
Cargo.lock generated

@ -1409,9 +1409,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "vented" name = "vented"
version = "0.11.2" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdd0a331d4b17a1ac906ffc38825113984f244e376bd58d90affbafee5b650ed" checksum = "dba6d608c6b5e6abacdcf74e0a2820154fe9eb4282194266639fd05502c05228"
dependencies = [ dependencies = [
"async-listen", "async-listen",
"async-std", "async-std",

@ -11,7 +11,7 @@ path = "src/main.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
vented = "0.11.2" vented = "0.11.3"
rusqlite = "0.24.1" rusqlite = "0.24.1"
rand = "0.7.3" rand = "0.7.3"
base64 = "0.13.0" base64 = "0.13.0"

@ -1 +1,7 @@
pub mod node_data; /*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
pub mod node_data;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::utils::keys::{armor_public_key, extract_public_key}; use crate::utils::keys::{armor_public_key, extract_public_key};
use crate::utils::result::SnekcloudResult; use crate::utils::result::SnekcloudResult;
use crate::utils::write_toml_pretty; use crate::utils::write_toml_pretty;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::data::node_data::NodeData; use crate::data::node_data::NodeData;
use crate::modules::heartbeat::HeartbeatModule; use crate::modules::heartbeat::HeartbeatModule;
use crate::modules::nodes_refresh::NodesRefreshModule; use crate::modules::nodes_refresh::NodesRefreshModule;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::modules::heartbeat::payloads::HeartbeatPayload; use crate::modules::heartbeat::payloads::HeartbeatPayload;
use crate::modules::heartbeat::settings::HeartbeatSettings; use crate::modules::heartbeat::settings::HeartbeatSettings;
use crate::modules::Module; use crate::modules::Module;

@ -1,7 +1,12 @@
use serde::{Serialize, Deserialize}; /*
use std::time::{ UNIX_EPOCH, Duration, SystemTime}; * snekcloud node based network
use std::ops::Add; * Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use serde::{Deserialize, Serialize};
use std::ops::Add;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct HeartbeatPayload { pub struct HeartbeatPayload {
@ -14,11 +19,11 @@ impl HeartbeatPayload {
let start = SystemTime::now(); let start = SystemTime::now();
Self { Self {
node_id, node_id,
beat_at: start.duration_since(UNIX_EPOCH).unwrap().as_millis() as u64 beat_at: start.duration_since(UNIX_EPOCH).unwrap().as_millis() as u64,
} }
} }
pub fn get_beat_time(&self) -> SystemTime { pub fn get_beat_time(&self) -> SystemTime {
UNIX_EPOCH.add(Duration::from_millis(self.beat_at)) UNIX_EPOCH.add(Duration::from_millis(self.beat_at))
} }
} }

@ -1,5 +1,11 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use serde::{Deserialize, Serialize};
use std::path::PathBuf; use std::path::PathBuf;
use serde::{Serialize, Deserialize};
use std::time::Duration; use std::time::Duration;
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
@ -23,4 +29,4 @@ impl HeartbeatSettings {
pub fn interval(&self) -> Duration { pub fn interval(&self) -> Duration {
Duration::from_millis(self.interval_ms as u64) Duration::from_millis(self.interval_ms as u64)
} }
} }

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::server::tick_context::RunContext; use crate::server::tick_context::RunContext;
use crate::utils::result::SnekcloudResult; use crate::utils::result::SnekcloudResult;
use async_trait::async_trait; use async_trait::async_trait;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::data::node_data::NodeData; use crate::data::node_data::NodeData;
use crate::modules::nodes_refresh::settings::NodesRefreshSettings; use crate::modules::nodes_refresh::settings::NodesRefreshSettings;
use crate::modules::Module; use crate::modules::Module;

@ -1,4 +1,10 @@
use serde::{Serialize, Deserialize}; /*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use serde::{Deserialize, Serialize};
use std::time::Duration; use std::time::Duration;
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
@ -9,7 +15,7 @@ pub struct NodesRefreshSettings {
impl Default for NodesRefreshSettings { impl Default for NodesRefreshSettings {
fn default() -> Self { fn default() -> Self {
Self { Self {
update_interval_ms: 3600000 update_interval_ms: 3600000,
} }
} }
} }
@ -18,4 +24,4 @@ impl NodesRefreshSettings {
pub fn update_interval(&self) -> Duration { pub fn update_interval(&self) -> Duration {
Duration::from_millis(self.update_interval_ms) Duration::from_millis(self.update_interval_ms)
} }
} }

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::modules::Module; use crate::modules::Module;
use crate::server::tick_context::{EventInvocation, RunContext}; use crate::server::tick_context::{EventInvocation, RunContext};
use crate::utils::result::{SnekcloudError, SnekcloudResult}; use crate::utils::result::{SnekcloudError, SnekcloudResult};

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::utils::result::SnekcloudError; use crate::utils::result::SnekcloudError;
use async_std::sync::Sender; use async_std::sync::Sender;
use parking_lot::Mutex; use parking_lot::Mutex;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::data::node_data::NodeData; use crate::data::node_data::NodeData;
use crate::utils::result::{SnekcloudError, SnekcloudResult}; use crate::utils::result::{SnekcloudError, SnekcloudResult};
use crate::utils::settings::get_settings; use crate::utils::settings::get_settings;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::utils::settings::get_settings; use crate::utils::settings::get_settings;
use chrono::Local; use chrono::Local;
use colored::*; use colored::*;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::utils::result::SnekcloudResult; use crate::utils::result::SnekcloudResult;
use rand::RngCore; use rand::RngCore;
use regex::Regex; use regex::Regex;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use std::error::Error; use std::error::Error;
use std::fmt; use std::fmt;
use std::io; use std::io;

@ -1,3 +1,9 @@
/*
* snekcloud node based network
* Copyright (C) 2020 trivernis
* See LICENSE for more information
*/
use crate::modules::heartbeat::settings::HeartbeatSettings; use crate::modules::heartbeat::settings::HeartbeatSettings;
use crate::modules::nodes_refresh::settings::NodesRefreshSettings; use crate::modules::nodes_refresh::settings::NodesRefreshSettings;
use crate::utils::result::SnekcloudResult; use crate::utils::result::SnekcloudResult;

Loading…
Cancel
Save