web_persist.mli 2.42 KB
Newer Older
Stephane Glondu's avatar
Stephane Glondu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
(**************************************************************************)
(*                                BELENIOS                                *)
(*                                                                        *)
(*  Copyright © 2012-2015 Inria                                           *)
(*                                                                        *)
(*  This program is free software: you can redistribute it and/or modify  *)
(*  it under the terms of the GNU Affero General Public License as        *)
(*  published by the Free Software Foundation, either version 3 of the    *)
(*  License, or (at your option) any later version, with the additional   *)
(*  exemption that compiling, linking, and/or using OpenSSL is allowed.   *)
(*                                                                        *)
(*  This program is distributed in the hope that it will be useful, but   *)
(*  WITHOUT ANY WARRANTY; without even the implied warranty of            *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *)
(*  Affero General Public License for more details.                       *)
(*                                                                        *)
(*  You should have received a copy of the GNU Affero General Public      *)
(*  License along with this program.  If not, see                         *)
(*  <http://www.gnu.org/licenses/>.                                       *)
(**************************************************************************)

22
open Serializable_t
23
open Web_serializable_t
24

25 26 27
type election_state =
  [ `Open
  | `Closed
28
  | `EncryptedTally of int * int * string
29
  | `Tallied of plaintext
30 31 32
  ]
val get_election_state : string -> election_state Lwt.t
val set_election_state : string -> election_state -> unit Lwt.t
33

34 35 36
val get_election_date : string -> datetime Lwt.t
val set_election_date : string -> datetime -> unit Lwt.t

37 38
val get_partial_decryptions : string -> (int * string) list Lwt.t
val set_partial_decryptions : string -> (int * string) list -> unit Lwt.t
Stephane Glondu's avatar
Stephane Glondu committed
39 40 41

val get_auth_config : string -> (string * (string * string list)) list Lwt.t
val set_auth_config : string -> (string * (string * string list)) list -> unit Lwt.t
42

43 44
val get_raw_election : string -> string option Lwt.t
val get_election_metadata : string -> metadata option Lwt.t
45
val get_election_result : string -> Yojson.Safe.json result option Lwt.t
Stephane Glondu's avatar
Stephane Glondu committed
46 47

val get_elections_by_owner : user -> string list Lwt.t