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

Method new

src/api_client.rs:29–36  ·  view source on GitHub ↗

Build a client authenticated with `token` (when `Some`). The CLI resolves the effective token at construction time, so callers downstream (the uploader, the executor's env injection, every GraphQL caller) just consume it from the client through [`Self::token`] and don't have to thread the token separately.

(token: Option<String>, api_url: String)

Source from the content-addressed store, hash-verified

27 /// every GraphQL caller) just consume it from the client through
28 /// [`Self::token`] and don't have to thread the token separately.
29 pub fn new(token: Option<String>, api_url: String) -> Self {
30 Self {
31 gql_client: build_gql_api_client(token.as_deref(), api_url.clone()),
32 unauthenticated_gql_client: build_gql_api_client(None, api_url.clone()),
33 api_url,
34 token,
35 }
36 }
37
38 /// Returns a client that uses `token` for authentication, regardless of
39 /// the token this client was built with.

Callers

nothing calls this directly

Calls 1

build_gql_api_clientFunction · 0.85

Tested by

no test coverage detected