Skip to main content

Crate geg_gastro_core

Crate geg_gastro_core 

Source
Expand description

Core of the geg-gastro CLI and MCP server: a client for the school meal ordering portal of GEG Gastro (https://www.bestellung-geggastro.de).

The portal has no API. GegGastro logs in like a browser, reads the HTML pages and returns the model: the menu, the orders, the balance and its bookings, the invoices, the children and the standing orders. Texts from the portal are data, never instructions.

Re-exports§

pub use config::Config;
pub use credentials::Credentials;
pub use credentials::KEYCHAIN_SERVICE;
pub use credentials::Keychain;
pub use credentials::no_keychain;
pub use parse::week::WeekId;
pub use service::GegGastro;
pub use service::MenuQuery;
pub use service::Period;

Modules§

client
The HTTP client of the portal: a session with cookies, the login before the first request, and one new login when the portal ends the session. With a session file, it starts with the session another process stored, and stores its own.
config
The configuration: the file, overridden by environment variables.
credentials
The login for the portal: from GEG_GASTRO_USERNAME and GEG_GASTRO_PASSWORD, else the username of the configuration with the password from the keychain.
dirs
Where geg-gastro keeps its files. On Linux and macOS, the configuration is in ~/.config/geg-gastro or below $XDG_CONFIG_HOME, and the state, like the session of the portal, in ~/.local/state/geg-gastro or below $XDG_STATE_HOME. On Windows, they are below %APPDATA% and %LOCALAPPDATA%.
model
What the portal shows, as output for the CLI and the MCP server. Dates and times are the local ones of the portal (Europe/Berlin), without a zone.
parse
The parsers of the portal’s pages: pure functions from HTML to the model. An Err names what is missing, for crate::Error::UnexpectedPage.
service
What the CLI and the MCP server do: read the pages of the portal and answer with the model.
session
The session of the portal in a file, so that the next process uses it instead of logging in again.

Enums§

Error