geolocate 0.2.4

A CLI for geolocation data providers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::constants::{DEFAULT, IP2LOCATION, IPGEOLOCATION};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// Configuration struct to hold API key names and values in a HashMap
#[derive(Serialize, Deserialize, Debug)]
#[serde(transparent)]
pub struct APIKeys(pub HashMap<String, String>);

impl Default for APIKeys {
  fn default() -> Self {
    Self(HashMap::from([
      (IP2LOCATION.to_string(), "".to_string()),
      (IPGEOLOCATION.to_string(), "".to_string()),
      (DEFAULT.to_string(), "".to_string()),
    ]))
  }
}