ATProto Personal Data Server storage for OCaml
4
fork

Configure Feed

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

ocaml-pds: bind put-and-get example as a function

The block referenced [record_bytes] as a free variable; wrap as
[put_and_get ~record_bytes = ...] so the snippet is self-contained.
Also add [eio.core] / [eio_main] / [fmt] / [atp] to the mdx libraries
so [Atp.Did] / [Eio.Switch] / [Fmt.pr] resolve.

+7 -9
+6 -8
README.md
··· 35 35 ### Create a repo, put and get records 36 36 37 37 ```ocaml 38 - let () = 38 + let put_and_get ~record_bytes = 39 39 Eio_main.run @@ fun env -> 40 40 Eio.Switch.run @@ fun sw -> 41 41 let fs = Eio.Stdenv.fs env in 42 42 let repo = 43 - Pds.v ~sw Eio.Path.(fs / "my-repo") 43 + Pds.v ~sw 44 + Eio.Path.(fs / "my-repo") 44 45 ~did:(Atp.Did.of_string_exn "did:web:example.com") 45 46 in 46 - Pds.put repo 47 - ~collection:"app.bsky.feed.post" 48 - ~rkey:"abc123" 49 - record_bytes; 47 + Pds.put repo ~collection:"app.bsky.feed.post" ~rkey:"abc123" record_bytes; 50 48 (match Pds.find repo ~collection:"app.bsky.feed.post" ~rkey:"abc123" with 51 - | Some data -> Fmt.pr "record: %d bytes@." (String.length data) 52 - | None -> Fmt.pr "not found@."); 49 + | Some data -> Fmt.pr "record: %d bytes@." (String.length data) 50 + | None -> Fmt.pr "not found@."); 53 51 Pds.close repo 54 52 ``` 55 53
+1 -1
dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries nox-pds eio eio.unix)) 7 + (libraries nox-pds eio eio.core eio.unix eio_main fmt atp))