You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.1 KiB
56 lines
1.1 KiB
6 years ago
|
#[macro_use]
|
||
|
extern crate log;
|
||
|
#[macro_use]
|
||
|
extern crate failure;
|
||
|
#[macro_use]
|
||
|
extern crate smart_default;
|
||
|
#[macro_use]
|
||
|
extern crate serde;
|
||
|
#[macro_use]
|
||
|
use elefren::{helpers::cli, prelude::*};
|
||
|
|
||
|
use failure::Fallible;
|
||
|
use crate::bootstrap::Config;
|
||
|
use crate::store::Store;
|
||
|
|
||
|
mod bootstrap;
|
||
|
mod store;
|
||
|
|
||
|
fn main() {
|
||
|
let config : Config = bootstrap::init().expect("error init config");
|
||
|
|
||
|
debug!("Loaded config: {:#?}", config);
|
||
|
|
||
|
let mut store = Store::from_file(&config.store);
|
||
|
|
||
|
debug!("Store: {:?}", store);
|
||
|
|
||
|
//store.put("foo", vec![1,2,3,4]);
|
||
|
|
||
|
let mut v : Vec<u32> = store.get("foo").unwrap();
|
||
|
v.push(v.last().unwrap()+1);
|
||
|
store.put("foo", v);
|
||
|
|
||
|
store.save();
|
||
|
|
||
|
|
||
|
|
||
|
/*
|
||
|
|
||
|
let registration = Registration::new(config.instance)
|
||
|
.client_name("elefren_test")
|
||
|
.build().expect("error register");
|
||
|
|
||
|
let mastodon = cli::authenticate(registration).expect("error auth");
|
||
|
|
||
|
println!(
|
||
|
"{:?}",
|
||
|
mastodon
|
||
|
.get_home_timeline().expect("error get TL")
|
||
|
.items_iter()
|
||
|
.take(100)
|
||
|
.collect::<Vec<_>>()
|
||
|
);
|
||
|
*/
|
||
|
}
|