Module Refer.Random

Functions to generate random Refer records.

val key : unit -> string

(key ()) is a random string suitable for a key in a refer record.

These keys are strings of 1-10 random uppercase characters.

val value : ?len:int -> ?lines:int -> unit -> string

(value ?len ?lines ()) is a random string suitable for a value in a refer record.

?len is the maximum length of a line in the value (default: 60).

?lines is the maximum number of lines in the value (default: 10).

val keyset : ?size:(unit -> int) -> ?key:(unit -> string) -> unit -> string list

(keyset ?size ?key ()) is a random set of size (size ()) (default: < 10) refer record keys.

The keys are given by (key ()) (default: key).

val record : ?keys:(unit -> string list) -> ?values:(?len:int -> ?lines:int -> unit -> string) -> unit -> string

(record ?keys ()) generates a random refer record.

The keys are given by (keys ()) (default: keyset) and all of them are used in the record.

The values are given by (values ()) (default: value).

val db : ?size:(unit -> int) -> ?keys:(unit -> string list) -> ?values:(?len:int -> ?lines:int -> unit -> string) -> unit -> string list

(db ?size ?keys ?values ()) generates a random database of size (size ()) (default: < 100) refer records.

Each record is given by (record ?keys ?values ()).