Initial yak shaving.

This commit is contained in:
Jordan Petridis
2017-09-15 03:24:17 +03:00
commit 44eb261b95
9 changed files with 148 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
use structopt::StructOpt;
use loggerv;
use errors::*;
#[derive(StructOpt, Debug)]
#[structopt(name = "example", about = "An example of StructOpt usage.")]
struct Opt {
/// Enable logging, use multiple `v`s to increase verbosity
#[structopt(short = "v", long = "verbose")]
verbosity: u64,
}
pub fn run() -> Result<()> {
let args = Opt::from_args();
loggerv::init_with_verbosity(args.verbosity)?;
let foo = args;
info!("{:?}", foo);
Ok(())
}
+43
View File
@@ -0,0 +1,43 @@
#![recursion_limit = "1024"]
extern crate structopt;
#[macro_use]
extern crate structopt_derive;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate loggerv;
extern crate reqwest;
#[macro_use]
extern crate diesel;
// use diesel::prelude::*;
pub mod cli;
pub mod schema;
pub mod models;
pub mod errors {
use reqwest;
use std::io;
error_chain! {
foreign_links {
ReqError(reqwest::Error);
IoError(io::Error);
Log(::log::SetLoggerError);
}
}
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}
+10
View File
@@ -0,0 +1,10 @@
#![recursion_limit = "1024"]
#[macro_use]
extern crate error_chain;
extern crate hammond;
use hammond::cli::run;
quick_main!(run);
View File
+27
View File
@@ -0,0 +1,27 @@
table! {
episode (id) {
id -> Integer,
title -> Text,
desrciption -> Nullable<Text>,
uri -> Text,
local_uri -> Nullable<Text>,
thumbnail -> Nullable<Text>,
lenght -> Nullable<Integer>,
guid -> Nullable<Text>,
podcast_id -> Integer,
}
}
table! {
podcast (id) {
id -> Integer,
title -> Text,
uri -> Text,
link -> Nullable<Text>,
description -> Nullable<Text>,
last_modified -> Nullable<Text>,
http_etag -> Nullable<Integer>,
image_uri -> Nullable<Text>,
image_local -> Nullable<Text>,
}
}