aboutsummaryrefslogtreecommitdiff
path: root/portal/portal.mli
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-08-14 22:56:13 +0200
committerClombrong <cromblong@egregore.fun>2025-08-15 00:14:00 +0200
commitcbdbb587236f8d747ae5baf4b4f92e9458dff4f1 (patch)
treef3cd4c27529eea1621eed6554ccf18006ddd8665 /portal/portal.mli
parente4e8a81f030dc599b1d5dc84b9725667c3872124 (diff)
feat(portal): add opaque domain type to portal
Diffstat (limited to 'portal/portal.mli')
-rw-r--r--portal/portal.mli10
1 files changed, 8 insertions, 2 deletions
diff --git a/portal/portal.mli b/portal/portal.mli
index ed8765d..10b6bc3 100644
--- a/portal/portal.mli
+++ b/portal/portal.mli
@@ -4,6 +4,12 @@ exception MalformedStanza of Error.t
type socket
+(** Opaque domain name type. *)
+type domain
+
+val domain_of_string : string -> domain
+val domain_to_string : domain -> string
+
(** The type of portals communicating with an XMPP server via [_socket].
[stream] is the data sent by the XMPP server.
@@ -23,7 +29,7 @@ type t = {
val xmlns : string
(** [connect domain] returns a Portal connected to the XMPP server [domain]. *)
-val connect : string -> t Lwt.t
+val connect : domain -> t Lwt.t
(** [starttls portal] mutates [portal] into a TLS-encrypted stream with the same state.
@@ -37,7 +43,7 @@ val starttls : t -> unit Lwt.t
the response stream header.
When [from] is specified, a from attribute is included. *)
-val header : ?from:string -> string -> t -> string Lwt.t
+val header : ?from:string -> domain -> t -> string Lwt.t
(** [_encrypted socket] returns whether [socket] is encrypted, using TLS or otherwise. *)
val _encrypted : socket -> bool