-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathlib.rs
54 lines (49 loc) · 1.32 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pub mod coffee;
pub mod config;
mod nurse;
pub use coffee_lib as lib;
#[derive(Clone, Debug)]
pub enum CoffeeOperation {
/// Install(plugin name, branch, verbose run, dynamic installation)
Install(String, Option<String>, bool, bool),
/// List
List,
// Upgrade(name of the repository, verbose run)
Upgrade(String, bool),
Remove(String),
/// Remote(name repository, url of the repository)
Remote(Option<RemoteAction>, Option<String>),
/// Setup(core lightning root path)
Setup(String),
Show(String),
/// Search(plugin name)
Search(String),
Nurse(bool),
/// Tip operation
///
/// (plugin_name, amount_msat)
Tip(String, u64),
/// Disable a plugin(plugin name)
Disable(String),
/// Enable a plugin(plugin name)
Enable(String),
}
#[derive(Clone, Debug)]
pub enum RemoteAction {
Add(String, String),
Rm(String),
Inspect(String),
List,
}
pub trait CoffeeArgs: Send + Sync {
/// return the command that coffee needs to execute
fn command(&self) -> CoffeeOperation;
/// return the conf
fn conf(&self) -> Option<String>;
/// return the network
fn network(&self) -> Option<String>;
/// return the data dir
fn data_dir(&self) -> Option<String>;
/// return the skip verify flag
fn skip_verify(&self) -> bool;
}