MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / build_gql_api_client

Function build_gql_api_client

src/api_client.rs:62–79  ·  view source on GitHub ↗
(token: Option<&str>, api_url: String)

Source from the content-addressed store, hash-verified

60}
61
62fn build_gql_api_client(token: Option<&str>, api_url: String) -> GQLClient {
63 let headers = match token {
64 Some(token) => {
65 let mut headers = std::collections::HashMap::new();
66 headers.insert("Authorization".to_string(), token.to_owned());
67 headers
68 }
69 None => Default::default(),
70 };
71
72 GQLClient::new_with_config(ClientConfig {
73 endpoint: api_url,
74 // Slightly high to account for cold starts
75 timeout: Some(20),
76 headers: Some(headers),
77 proxy: None,
78 })
79}
80
81nest! {
82 #[derive(Debug, Deserialize, Serialize)]*

Callers 2

newMethod · 0.85
set_tokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected