add code to evade ip blocking, improve pagination code and fix documentation
This commit is contained in:
parent
f8c3c8dcbe
commit
c170de8194
14 changed files with 264 additions and 61 deletions
|
@ -11,11 +11,15 @@ use std::fs;
|
|||
//
|
||||
/// * `port` - It stores the parsed port number option on which the server should launch.
|
||||
/// * `binding_ip_addr` - It stores the parsed ip address option on which the server should launch
|
||||
/// * `style` - It stores the theming options for the website.
|
||||
/// * `redis_connection_url` - It stores the redis connection url address on which the redis
|
||||
/// client should connect.
|
||||
#[derive(Clone)]
|
||||
pub struct Config {
|
||||
pub port: u16,
|
||||
pub binding_ip_addr: String,
|
||||
pub style: Style,
|
||||
pub redis_connection_url: String,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
@ -44,6 +48,7 @@ impl Config {
|
|||
globals.get::<_, String>("theme")?,
|
||||
globals.get::<_, String>("colorscheme")?,
|
||||
),
|
||||
redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
//! This module provides public models for handling, storing and serializing parsed config file
|
||||
//! options from config.lua by grouping them togather.
|
||||
|
||||
use serde::Serialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// A named struct which stores, serializes and groups the parsed config file options of theme and
|
||||
/// colorscheme names into the Style struct which derives the `Clone` and `Serialize` traits
|
||||
/// where the `Clone` trait is derived for allowing the struct to be cloned and passed to the
|
||||
/// server as a shared data between all routes except `/robots.txt` and the `Serialize` trait
|
||||
/// has been derived for allowing the object to be serialized so that it can be passed to
|
||||
/// handlebars template files.
|
||||
/// A named struct which stores,deserializes, serializes and groups the parsed config file options
|
||||
/// of theme and colorscheme names into the Style struct which derives the `Clone`, `Serialize`
|
||||
/// and Deserialize traits where the `Clone` trait is derived for allowing the struct to be
|
||||
/// cloned and passed to the server as a shared data between all routes except `/robots.txt` and
|
||||
/// the `Serialize` trait has been derived for allowing the object to be serialized so that it
|
||||
/// can be passed to handlebars template files and the `Deserialize` trait has been derived in
|
||||
/// order to allow the deserializing the json back to struct in aggregate function in
|
||||
/// aggregator.rs and create a new struct out of it and then serialize it back to json and pass
|
||||
/// it to the template files.
|
||||
///
|
||||
/// # Fields
|
||||
//
|
||||
/// * `theme` - It stores the parsed theme option used to set a theme for the website.
|
||||
/// * `colorscheme` - It stores the parsed colorscheme option used to set a colorscheme for the
|
||||
/// theme being used.
|
||||
#[derive(Serialize, Clone)]
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct Style {
|
||||
pub theme: String,
|
||||
pub colorscheme: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue