MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / get

Function get

chirpstack/src/storage/passive_roaming.rs:91–105  ·  view source on GitHub ↗
(id: Uuid)

Source from the content-addressed store, hash-verified

89}
90
91pub async fn get(id: Uuid) -> Result<internal::PassiveRoamingDeviceSession, Error> {
92 let key = redis_key(format!("pr:sess:{{{}}}", id));
93
94 let v: Vec<u8> = redis::cmd("GET")
95 .arg(key)
96 .query_async(&mut get_async_redis_conn().await?)
97 .await
98 .context("Get passive-roaming device-session")?;
99 if v.is_empty() {
100 return Err(Error::NotFound(id.to_string()));
101 }
102 let ds = internal::PassiveRoamingDeviceSession::decode(&mut Cursor::new(v))
103 .context("Decode passive-roaming device-session")?;
104 Ok(ds)
105}
106
107pub async fn delete(id: Uuid) -> Result<()> {
108 let key = redis_key(format!("pr:sess:{{{}}}", id));

Callers 2

saveFunction · 0.70

Calls 4

redis_keyFunction · 0.85
get_async_redis_connFunction · 0.85
to_stringMethod · 0.80
decodeFunction · 0.50

Tested by

no test coverage detected