package guardian

  1. Overview
  2. Docs

Source file role.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(** representation is simply the group's name *)
type t = string [@@deriving show, eq, ord]

let of_yojson : Yojson.Safe.t -> (t, string) CCResult.t = function
  | `String s -> Ok s
  | _ -> Error "Invalid role."
;;

module type Sig = sig
  type t [@@deriving eq, show, ord, yojson]

  val name : t -> string
  val find_target : t -> Uuid.Target.t option
  val find_target_exn : t -> Uuid.Target.t
  val of_string : string -> t
  val all : t list
end