gato-core

Crates.iogato-core
lib.rsgato-core
version0.5.7
sourcesrc
created_at2020-07-24 17:22:35.641
updated_at2022-07-30 23:04:58.698055
descriptionCore of Gato Web Framework
homepage
repository
max_upload_size
id269075
size15,837
Pedro Augusto da Silva Soares (pedrosoares)

documentation

README

gato-core

This repo contains all generics needed to build a modular framework in rust.

Service Provider

Is a trait responsible to modularize the framework, you can register customs ServiceProviders that will be executed during the framework bootstrap, at this moment you can register new drivers or configure the environment, etc.

See SimpleRouter for example:

use crate::SimpleRouter;
use gato_core::kernel::Provider;
use gato_core::kernel::RouterHandler;

pub struct SimpleRouterServiceProvider { }
impl SimpleRouterServiceProvider {
    pub fn new() -> Box<Self> { Box::new(SimpleRouterServiceProvider {}) }
}

impl Provider for SimpleRouterServiceProvider {
    // This method is executed during boot only one time
    fn boot(&self) -> () {
        // Register the Router driver
        RouterHandler::set_driver(Box::new(SimpleRouter::new()));
    }
}
Commit count: 0

cargo fmt