Module Message.Base

type body =
  1. | Body of string
type via =
  1. | Via of Com.pubkey
type sign =
  1. | Sign of string
type unicast_header =
  1. | Unicast_header of {
    1. src : Com.pubkey;
    2. dst : Com.pubkey;
    3. ttl : Com.ttl;
    4. exp : Com.expiry;
    }
type multicast_header =
  1. | Multicast_header of {
    1. grp : Commons.multicast_group_pubkey;
    2. ttl : Com.ttl;
    3. exp : Com.expiry;
    4. seen : Com.seen;
    }
type t =
  1. | Unicast_message of {
    1. header : unicast_header;
    2. body : body;
    3. sign : sign;
    4. via : via option;
    }
  2. | Multicast_message of {
    1. header : multicast_header;
    2. body : body;
    3. sign : sign;
    4. via : via option;
    }
val fold : (unicast_header -> body -> sign -> via option -> 'a) -> (multicast_header -> body -> sign -> via option -> 'a) -> t -> 'a
val fold' : (t -> 'a) -> (t -> 'a) -> t -> 'a
val fold_unwrap : (unicast_header -> string -> string -> Com.pubkey option -> 'a) -> (multicast_header -> string -> string -> Com.pubkey option -> 'a) -> t -> 'a
val fold_unwrap' : (Com.pubkey -> string -> string -> Com.pubkey option -> 'a) -> (Commons.multicast_group_pubkey -> string -> string -> Com.pubkey option -> 'a) -> t -> 'a
val fold_flip_multi : t -> (multicast_header -> body -> sign -> via option -> 'a) -> 'a
val fold_flip_multi_unwrap : t -> (multicast_header -> string -> string -> Com.pubkey option -> 'a) -> 'a
val fold_flip_multi_unwrap' : t -> (Commons.multicast_group_pubkey -> string -> string -> Com.pubkey option -> 'a) -> 'a
val fold_header : (Com.pubkey -> Com.pubkey -> Com.ttl -> Com.expiry -> 'a) -> (Commons.multicast_group_pubkey -> Com.ttl -> Com.expiry -> Com.seen -> 'a) -> t -> 'a
val fold_header' : (unicast_header -> 'a) -> (multicast_header -> 'a) -> t -> 'a
module Acc : sig ... end
module T : sig ... end
module Pp : sig ... end
module Decode : sig ... end
module Encode : sig ... end
val is_unicast : t -> bool
val is_multicast : t -> bool
val get_body : t -> body
val get_signature : t -> sign
val sign_prepare : [< `Multi of multicast_header | `Uni of unicast_header ] -> string -> string
val sign_message : Upsycle_router__Commons.privkey -> [< `Multi of multicast_header | `Uni of unicast_header ] -> string -> string
val verify_signature : Upsycle_router__Commons.pubkey -> t -> unit Lwt.t
module Mk : sig ... end
val pp : Stdlib.Format.formatter -> t -> unit
val pp_short : Stdlib.Format.formatter -> t -> unit
val get_uni_field : [< `Dst | `Src ] -> t -> Com.pubkey
val get_multi_field : [< `Grp ] -> t -> Commons.multicast_group_pubkey
val get_uni_src : t -> Com.pubkey

These raise an exception on multicast messages: caller must be sure it's a unicast message

val get_uni_dst : t -> Com.pubkey
val get_multi_group : t -> Commons.multicast_group_pubkey

These raise an exception on unicast messages: caller must be sure it's a multicast message

val get_multi_group' : t -> Upsycle_router__Commons.pubkey
val is_for : Com.pubkey -> t -> bool

Returns `false` for a multicast message and therefore doesn't raise any exceptions. Works by checking the `dst` field.

val via_set : Com.pubkey -> t -> t
val message_id_s : [< `Blake2b_256 | `Blake2b_32 | `Blake2s_128 | `Blake2s_32 ] -> t -> string
val message_id : [< `Blake2b_256 | `Blake2b_32 | `Blake2s_128 | `Blake2s_32 ] -> t -> Com.msg_id