[][src]Function transit_model::read_utils::read_config

pub fn read_config<P: AsRef<Path>>(
    config_path: Option<P>
) -> Result<(Contributor, Dataset, BTreeMap<String, String>)>

Read a JSON configuration file to facilitate the creation of:

  • a Contributor
  • a Dataset
  • a list of key/value which will be used in 'feed_infos.txt' Below is an example of this file
{
    "contributor": {
        "contributor_id": "contributor_id",
        "contributor_name": "Contributor Name",
        "contributor_license": "AGPIT",
        "contributor_website": "http://www.datasource-website.com"
    },
    "dataset": {
        "dataset_id": "dataset-id"
    },
    "feed_infos": {
        "feed_publisher_name": "The Great Data Publisher",
        "feed_license": "AGPIT",
        "feed_license_url": "http://www.datasource-website.com",
        "tartare_platform": "dev",
        "tartare_contributor_id": "contributor_id"
    }
}