switchgear_service/discovery/
state.rs1use crate::api::discovery::DiscoveryBackendStore;
2use jsonwebtoken::DecodingKey;
3
4#[derive(Clone)]
5pub struct DiscoveryState<S> {
6 store: S,
7 auth_authority: DecodingKey,
8}
9
10impl<S> DiscoveryState<S>
11where
12 S: DiscoveryBackendStore,
13{
14 pub fn new(store: S, auth_authority: DecodingKey) -> Self {
15 Self {
16 store,
17 auth_authority,
18 }
19 }
20
21 pub fn store(&self) -> &S {
22 &self.store
23 }
24
25 pub fn auth_authority(&self) -> &DecodingKey {
26 &self.auth_authority
27 }
28}