Crate lib

Crate lib 

Source
Expand description

Automattermostatus main components and helper functions used by main

Re-exports§

pub use config::Args;
pub use config::SecretType;
pub use config::WifiStatusConfig;
pub use mattermost::BaseSession;
pub use mattermost::MMStatus;
pub use mattermost::Session;
pub use state::Cache;
pub use state::Location;
pub use state::State;
pub use wifiscan::WiFi;
pub use wifiscan::WifiInterface;

Modules§

config
This module holds struct and helpers for parameters and configuration
mattermost
This module exports Session and MMStatus
offtime
This module Provide the Off trait and OffDays struct
state
Implement persistant state for current location
utils
Simple utilities functions
wifiscan
Implement wifi SSID scan for linux, windows and mac os.

Functions§

create_session
Create Session according to args.secret_type.
get_cache
Return a Cache used to persist state.
get_wifi_and_update_status_loop
Main application loop, looking for a known SSID and updating mattermost custom status accordingly.
prepare_status
Prepare a dictionnary of MMStatus ready to be send to mattermost server depending upon the location being found.
setup_tracing
Setup logging to stdout (Tracing is a bit more involving to set up but will provide much more feature if needed)