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

Configure Feed

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

possum: mention slingshot

kacaii.dev (Jun 30, 2026, 10:46 AM -0300) 15e47d81 f4fe57b2

+23 -15
+22 -14
src/possum.gleam
··· 1 1 //// ## PDS (Personal Data Server) 2 2 //// 3 - //// A PDS, or Personal Data Server, is a server that hosts a user. 4 - //// A PDS will always store the user's data repo and signing keys. 5 - //// It may also assign the user a handle and a DID. 6 - //// Many PDSes will host multiple users. 3 + //// A PDS, or Personal Data Server, is a server that hosts a user, it will 4 + //// always store the user's data repo and signing keys. It may also assign 5 + //// the user a handle and a DID. Many PDSes will host multiple users. 7 6 //// 8 - //// A PDS communicates with AppViews to run applications. 9 - //// A PDS doesn't typically run any applications itself, 10 - //// though it will have general account management interfaces 11 - //// such as the OAuth login screen. 7 + //// A PDS doesn't typically run any applications itself, though it will have 8 + //// general account management interfaces such as the OAuth login screen. 12 9 //// PDSes actively sync their data repos with Relays. 13 10 //// 14 11 //// ## Lexicon ··· 58 55 /// Get current PLC Data for the indicated DID, 59 56 /// this returns information about a Decentralized Identifier (DID), 60 57 /// including their handle and service endpoint. 58 + /// 59 + /// PLC is a persistent global identifier system, stands for 60 + /// "Public Ledger of Credentials". 61 61 /// 62 62 /// ## Examples 63 63 /// ··· 65 65 /// import gleam/http/request 66 66 /// import possum 67 67 /// 68 - /// let did = "did:plc:z72i7hdynmk6r22z27h6tvur" 69 - /// 70 68 /// let request = 71 69 /// request.new() 72 - /// |> possum.get_plc_data(did) 70 + /// |> possum.get_plc_data("did:plc:z72i7hdynmk6r22z27h6tvur") 73 71 /// ``` 74 72 /// 75 73 /// ## Response ··· 95 93 /// } 96 94 /// ``` 97 95 /// 98 - /// Documentation: [AT Protocol DIDs](https://atproto.com/specs/did) 96 + /// Documentation: [DID PLC Directory](https://web.plc.directory/) 99 97 pub fn get_plc_data( 100 98 request: request.Request(_), 101 99 did: String, ··· 117 115 /// 118 116 /// request.new() 119 117 /// |> possum.resolve_well_known_did("gleam.run") 118 + /// ``` 120 119 /// 121 - /// assert response.body == "did=did:plc:k5vecqzf4d5mdvkcu3mx6l5g" 120 + /// ## Response 121 + /// 122 + /// ```txt 123 + /// did:plc:k5vecqzf4d5mdvkcu3mx6l5g 122 124 /// ``` 123 125 /// 124 126 /// Documentation: [HTTPS well-known Method](https://atproto.com/specs/handle#https-well-known-method) ··· 134 136 135 137 /// Resolves an atproto handle (hostname) to a DID. 136 138 /// Does not necessarily bi-directionally verify against the the DID document. 139 + /// 140 + /// You can use projects like [Slingshot](https://slingshot.microcosm.blue) 141 + /// for easy access to cached data. 137 142 /// 138 143 /// ## Examples 139 144 /// ··· 339 344 /// or arbitrary binary data. In atproto, object nodes often include a string 340 345 /// field `$type` that specifies their Lexicon schema. 341 346 /// 347 + /// You can use projects like [Slingshot](https://slingshot.microcosm.blue) 348 + /// for easy access to cached data. 349 + /// 342 350 /// ```gleam 343 351 /// import gleam/http/request 344 352 /// import possum 345 353 /// 346 354 /// let request = 347 355 /// request.new() 348 - /// |> request.set_host("personal.data-server.pds") 356 + /// |> request.set_host("personal.data-server.pds") 349 357 /// |> possum.get_record( 350 358 /// repository: did, 351 359 /// rkey: "3mn6n3lvibc2b",
+1 -1
test/possum_test.gleam
··· 18 18 Context(handle: String, did: String, pds: String) 19 19 } 20 20 21 - pub fn global_data() -> Context { 21 + fn global_data() -> Context { 22 22 global_value.create_with_unique_name("possum_test.global.data", fn() { 23 23 let handle = "bsky.app" 24 24