1pub mod error;
2pub mod fetch;
3pub mod model;
4pub mod parse;
5pub mod proto;
6pub mod query;
7pub mod table;
8
9use error::FlightError;
10use fetch::FetchOptions;
11use model::SearchResult;
12use query::{QueryParams, SearchQuery};
13
14pub async fn search(
15 query: SearchQuery,
16 options: FetchOptions,
17) -> Result<SearchResult, FlightError> {
18 let params = query.to_url_params();
19 let html = fetch::fetch_html(¶ms, &options).await?;
20 parse::parse_html(&html)
21}
22
23pub fn generate_browser_url(params: &QueryParams) -> String {
24 query::to_google_flights_url(params)
25}