OCaml library for JSONfeed parsing and creation
1(** Hub endpoints for real-time notifications.
2
3 Hubs describe endpoints that can be used to subscribe to real-time
4 notifications of changes to the feed. This is an optional and rarely-used
5 feature of JSON Feed, primarily for feeds that update frequently.
6
7 @see <https://www.jsonfeed.org/version/1.1/> JSON Feed Specification *)
8
9
10(** The type representing a hub endpoint. *)
11type t
12
13
14(** {1 Construction} *)
15
16(** [create ~type_ ~url ()] creates a hub object.
17
18 @param type_ The type of hub protocol (e.g., ["rssCloud"], ["WebSub"])
19 @param url The URL endpoint for the hub
20
21 {b Example:}
22 {[
23 let hub = Hub.create
24 ~type_:"WebSub"
25 ~url:"https://pubsubhubbub.appspot.com/" ()
26 ]} *)
27val create : type_:string -> url:string -> unit -> t
28
29
30(** {1 Accessors} *)
31
32(** [type_ t] returns the hub's protocol type. *)
33val type_ : t -> string
34
35(** [url t] returns the hub's endpoint URL. *)
36val url : t -> string
37
38
39(** {1 Comparison} *)
40
41(** [equal a b] tests equality between two hubs. *)
42val equal : t -> t -> bool
43
44
45(** {1 Pretty Printing} *)
46
47(** [pp ppf t] pretty prints a hub to the formatter.
48
49 The output is human-readable and suitable for debugging.
50
51 {b Example output:}
52 {v WebSub: https://pubsubhubbub.appspot.com/ v} *)
53val pp : Format.formatter -> t -> unit