Source

screentime-monitor / protocol.mli

Full commit
open Core.Std
open Async.Std

module Status : sig
  type t = { state: [ `Active of Category.t | `Not_running ]
           ; elapsed: Time.Span.t Category.Map.t
           }
  with sexp, bin_io
end

val start    : (Username.t * Category.t, unit) Rpc.Rpc.t
val stop     : (Username.t, unit) Rpc.Rpc.t
val status   : (Username.t, Status.t) Rpc.Rpc.t
val users    : (unit, Username.t list) Rpc.Rpc.t
val shutdown : (unit, unit) Rpc.Rpc.t
val report   :
  (Username.t,
   Time.Span.t Category.Map.t Date.Map.t)
    Rpc.Rpc.t
val full_report :
  (Username.t, (Category.t * Time.t * Time.t) list Date.Map.t)
    Rpc.Rpc.t
val todays_violations :
  (Username.t,
   (Rule.t * Time.Span.t * [ `Acked | `Unacked]) list)
    Rpc.Rpc.t
val get_rules : (Username.t, Rule.Set.t) Rpc.Rpc.t
val set_rules : (Username.t * Rule.Set.t, unit) Rpc.Rpc.t
val acknowledge : (Username.t * Rule.t, unit) Rpc.Rpc.t