Browse Source

Prepare for splitting things into separate packages

Move everything into a sprinklers_rs package and create cargo workspace
master
Alex Mikhalev 4 years ago
parent
commit
174d69fbcc
  1. 38
      Cargo.toml
  2. 35
      sprinklers_rs/Cargo.toml
  3. 0
      sprinklers_rs/scripts/add_migration.sh
  4. 0
      sprinklers_rs/src/database/migration.rs
  5. 0
      sprinklers_rs/src/database/migrations/0001-table_sections-down.sql
  6. 0
      sprinklers_rs/src/database/migrations/0001-table_sections-up.sql
  7. 0
      sprinklers_rs/src/database/migrations/0002-section_rows-down.sql
  8. 0
      sprinklers_rs/src/database/migrations/0002-section_rows-up.sql
  9. 0
      sprinklers_rs/src/database/migrations/0003-table_programs-down.sql
  10. 0
      sprinklers_rs/src/database/migrations/0003-table_programs-up.sql
  11. 0
      sprinklers_rs/src/database/migrations/0004-program_rows-down.sql
  12. 0
      sprinklers_rs/src/database/migrations/0004-program_rows-up.sql
  13. 0
      sprinklers_rs/src/database/migrations/0005-view_program_sequence-down.sql
  14. 0
      sprinklers_rs/src/database/migrations/0005-view_program_sequence-up.sql
  15. 0
      sprinklers_rs/src/database/migrations/0006-fix_view_program_seq-down.sql
  16. 0
      sprinklers_rs/src/database/migrations/0006-fix_view_program_seq-up.sql
  17. 0
      sprinklers_rs/src/database/migrations/mod.rs
  18. 0
      sprinklers_rs/src/database/mod.rs
  19. 0
      sprinklers_rs/src/main.rs
  20. 0
      sprinklers_rs/src/model/mod.rs
  21. 0
      sprinklers_rs/src/model/program.rs
  22. 0
      sprinklers_rs/src/model/section.rs
  23. 0
      sprinklers_rs/src/mqtt/actor.rs
  24. 0
      sprinklers_rs/src/mqtt/event_loop.rs
  25. 0
      sprinklers_rs/src/mqtt/mod.rs
  26. 0
      sprinklers_rs/src/mqtt/request/mod.rs
  27. 0
      sprinklers_rs/src/mqtt/request/programs.rs
  28. 0
      sprinklers_rs/src/mqtt/request/sections.rs
  29. 0
      sprinklers_rs/src/mqtt/topics.rs
  30. 0
      sprinklers_rs/src/option_future.rs
  31. 7
      sprinklers_rs/src/program_runner.rs
  32. 0
      sprinklers_rs/src/schedule.rs
  33. 0
      sprinklers_rs/src/section_interface.rs
  34. 0
      sprinklers_rs/src/section_runner.rs
  35. 0
      sprinklers_rs/src/section_runner_json.rs
  36. 0
      sprinklers_rs/src/serde.rs
  37. 0
      sprinklers_rs/src/trace_listeners.rs
  38. 0
      sprinklers_rs/src/update_listener.rs

38
Cargo.toml

@ -1,35 +1,5 @@
[package] [workspace]
name = "sprinklers_rs"
version = "0.1.0"
authors = ["Alex Mikhalev <alexmikhalevalex@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html members = [
"sprinklers_rs"
[dependencies] ]
rusqlite = "0.24.0"
color-eyre = "0.5.1"
eyre = "0.6.0"
thiserror = "1.0.20"
tokio = { version = "0.2.22", features = ["rt-core", "time", "stream", "sync", "signal", "macros", "test-util"] }
tracing = { version = "0.1.19", features = ["log"] }
tracing-futures = "0.2.4"
pin-project = "0.4.23"
im = "15.0.0"
chrono = { version = "0.4.15" }
assert_matches = "1.3.0"
serde = { version = "1.0.116", features = ["derive"] }
serde_json = "1.0.57"
actix = { version = "0.10.0", default-features = false }
actix-rt = "1.1.1"
futures-util = { version = "0.3.5", default-features = false, features = ["std", "async-await", "sink"] }
num-traits = "0.2.12"
num-derive = "0.3.2"
[dependencies.rumqttc]
version = "0.1.0"
[dependencies.tracing-subscriber]
version = "0.2.11"
default-features = false
features = ["registry", "fmt", "env-filter", "ansi"]

35
sprinklers_rs/Cargo.toml

@ -0,0 +1,35 @@
[package]
name = "sprinklers_rs"
version = "0.1.0"
authors = ["Alex Mikhalev <alexmikhalevalex@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rusqlite = "0.24.0"
color-eyre = "0.5.1"
eyre = "0.6.0"
thiserror = "1.0.20"
tokio = { version = "0.2.22", features = ["rt-core", "time", "stream", "sync", "signal", "macros", "test-util"] }
tracing = { version = "0.1.19", features = ["log"] }
tracing-futures = "0.2.4"
pin-project = "0.4.23"
im = "15.0.0"
chrono = { version = "0.4.15" }
assert_matches = "1.3.0"
serde = { version = "1.0.116", features = ["derive"] }
serde_json = "1.0.57"
actix = { version = "0.10.0", default-features = false }
actix-rt = "1.1.1"
futures-util = { version = "0.3.5", default-features = false, features = ["std", "async-await", "sink"] }
num-traits = "0.2.12"
num-derive = "0.3.2"
[dependencies.rumqttc]
version = "0.1.0"
[dependencies.tracing-subscriber]
version = "0.2.11"
default-features = false
features = ["registry", "fmt", "env-filter", "ansi"]

0
scripts/add_migration.sh → sprinklers_rs/scripts/add_migration.sh

0
src/database/migration.rs → sprinklers_rs/src/database/migration.rs

0
src/database/migrations/0001-table_sections-down.sql → sprinklers_rs/src/database/migrations/0001-table_sections-down.sql

0
src/database/migrations/0001-table_sections-up.sql → sprinklers_rs/src/database/migrations/0001-table_sections-up.sql

0
src/database/migrations/0002-section_rows-down.sql → sprinklers_rs/src/database/migrations/0002-section_rows-down.sql

0
src/database/migrations/0002-section_rows-up.sql → sprinklers_rs/src/database/migrations/0002-section_rows-up.sql

0
src/database/migrations/0003-table_programs-down.sql → sprinklers_rs/src/database/migrations/0003-table_programs-down.sql

0
src/database/migrations/0003-table_programs-up.sql → sprinklers_rs/src/database/migrations/0003-table_programs-up.sql

0
src/database/migrations/0004-program_rows-down.sql → sprinklers_rs/src/database/migrations/0004-program_rows-down.sql

0
src/database/migrations/0004-program_rows-up.sql → sprinklers_rs/src/database/migrations/0004-program_rows-up.sql

0
src/database/migrations/0005-view_program_sequence-down.sql → sprinklers_rs/src/database/migrations/0005-view_program_sequence-down.sql

0
src/database/migrations/0005-view_program_sequence-up.sql → sprinklers_rs/src/database/migrations/0005-view_program_sequence-up.sql

0
src/database/migrations/0006-fix_view_program_seq-down.sql → sprinklers_rs/src/database/migrations/0006-fix_view_program_seq-down.sql

0
src/database/migrations/0006-fix_view_program_seq-up.sql → sprinklers_rs/src/database/migrations/0006-fix_view_program_seq-up.sql

0
src/database/migrations/mod.rs → sprinklers_rs/src/database/migrations/mod.rs

0
src/database/mod.rs → sprinklers_rs/src/database/mod.rs

0
src/main.rs → sprinklers_rs/src/main.rs

0
src/model/mod.rs → sprinklers_rs/src/model/mod.rs

0
src/model/program.rs → sprinklers_rs/src/model/program.rs

0
src/model/section.rs → sprinklers_rs/src/model/section.rs

0
src/mqtt/actor.rs → sprinklers_rs/src/mqtt/actor.rs

0
src/mqtt/event_loop.rs → sprinklers_rs/src/mqtt/event_loop.rs

0
src/mqtt/mod.rs → sprinklers_rs/src/mqtt/mod.rs

0
src/mqtt/request/mod.rs → sprinklers_rs/src/mqtt/request/mod.rs

0
src/mqtt/request/programs.rs → sprinklers_rs/src/mqtt/request/programs.rs

0
src/mqtt/request/sections.rs → sprinklers_rs/src/mqtt/request/sections.rs

0
src/mqtt/topics.rs → sprinklers_rs/src/mqtt/topics.rs

0
src/option_future.rs → sprinklers_rs/src/option_future.rs

7
src/program_runner.rs → sprinklers_rs/src/program_runner.rs

@ -689,9 +689,10 @@ mod test {
runner.update_programs(programs).await.unwrap(); runner.update_programs(programs).await.unwrap();
// First try a non-existant program id // First try a non-existant program id
runner.run_program_id(3).await.unwrap(); assert_matches!(
yield_now().await; runner.run_program_id(3).await,
assert_matches!(prog_events.try_recv(), Err(broadcast::TryRecvError::Empty)); Err(ProgramRunnerError::InvalidProgramId(3))
);
runner.run_program_id(1).await.unwrap(); runner.run_program_id(1).await.unwrap();
yield_now().await; yield_now().await;

0
src/schedule.rs → sprinklers_rs/src/schedule.rs

0
src/section_interface.rs → sprinklers_rs/src/section_interface.rs

0
src/section_runner.rs → sprinklers_rs/src/section_runner.rs

0
src/section_runner_json.rs → sprinklers_rs/src/section_runner_json.rs

0
src/serde.rs → sprinklers_rs/src/serde.rs

0
src/trace_listeners.rs → sprinklers_rs/src/trace_listeners.rs

0
src/update_listener.rs → sprinklers_rs/src/update_listener.rs

Loading…
Cancel
Save