๐Ÿ€ ATproto library for gleam
atproto library gleam
35

Configure Feed

Select the types of activity you want to include in your feed.

test: inline "context_from_env" function

kacaii.dev (Jul 2, 2026, 12:54 PM -0300) 1bf9fe3a ec48ea13

+9 -11
+9 -11
test/possum_test.gleam
··· 25 25 Context(handle: String, did: did.Did, pds: String) 26 26 } 27 27 28 - fn context_from_env() -> Result(Context, Nil) { 29 - use handle <- result.try(envoy.get("POSSUM_TEST_HANDLE")) 30 - use pds <- result.try(envoy.get("POSSUM_TEST_PDS")) 31 - use did_string <- result.try(envoy.get("POSSUM_TEST_DID")) 32 - use did <- result.try(did.parse(did_string) |> result.replace_error(Nil)) 33 - 34 - Ok(Context(handle:, did:, pds:)) 35 - } 36 - 37 28 fn global_data() -> Context { 38 29 global_value.create_with_unique_name("possum_test.global.data", fn() { 39 - use <- result.lazy_unwrap(context_from_env()) 40 - let handle = "bsky.app" 30 + use <- result.lazy_unwrap({ 31 + use handle <- result.try(envoy.get("POSSUM_TEST_HANDLE")) 32 + use pds <- result.try(envoy.get("POSSUM_TEST_PDS")) 33 + use did_string <- result.try(envoy.get("POSSUM_TEST_DID")) 34 + use did <- result.map(did.parse(did_string) |> result.replace_error(Nil)) 41 35 36 + Context(handle:, did:, pds:) 37 + }) 38 + 39 + let handle = "bsky.app" 42 40 let assert Ok(did_response) = 43 41 request.new() 44 42 |> request.set_host(slingshot)