2023-05-26 00:42:35 +05:30
|
|
|
/*
|
|
|
|
* mCaptcha - A proof of work based DoS protection system
|
|
|
|
* Copyright © 2023 Aravinth Manivannan <realravinth@batsense.net>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2023-05-24 21:22:14 +05:30
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
use openraft::Config;
|
|
|
|
|
2023-05-27 10:28:52 +05:30
|
|
|
use crate::DcacheNodeId;
|
|
|
|
use crate::DcacheRaft;
|
|
|
|
use crate::DcacheStore;
|
2023-05-24 21:22:14 +05:30
|
|
|
|
|
|
|
// Representation of an application state. This struct can be shared around to share
|
|
|
|
// instances of raft, store and more.
|
2023-05-27 10:28:52 +05:30
|
|
|
pub struct DcacheApp {
|
|
|
|
pub id: DcacheNodeId,
|
2023-05-24 21:22:14 +05:30
|
|
|
pub addr: String,
|
2023-05-27 10:28:52 +05:30
|
|
|
pub raft: DcacheRaft,
|
|
|
|
pub store: Arc<DcacheStore>,
|
2023-05-24 21:22:14 +05:30
|
|
|
pub config: Arc<Config>,
|
|
|
|
}
|