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

Function build_gql_api_client

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

Source from the content-addressed store, hash-verified

97}
98
99fn build_gql_api_client(token: Option<&str>, api_url: String) -> GQLClient {
100 let headers = match token {
101 Some(token) => {
102 let mut headers = std::collections::HashMap::new();
103 headers.insert("Authorization".to_string(), token.to_owned());
104 headers
105 }
106 None => Default::default(),
107 };
108
109 GQLClient::new_with_config(ClientConfig {
110 endpoint: api_url,
111 // Slightly high to account for cold starts
112 timeout: Some(20),
113 headers: Some(headers),
114 proxy: None,
115 })
116}
117
118nest! {
119 #[derive(Debug, Deserialize, Serialize)]*

Callers 2

newMethod · 0.85
set_authenticationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected