package calculon

  1. Overview
  2. Docs

User-defined config

type irc_log = [
  1. | `None
  2. | `Chan of Lwt_io.output_channel
  3. | `Custom of string -> unit Lwt.t
]
  • deprecated use logs instead
type t = {
  1. server : string;
    (*

    Address of the irc server

    *)
  2. port : int;
    (*

    Port of the server

    *)
  3. username : string;
  4. realname : string;
  5. nick : string;
  6. tls : bool;
  7. tls_cert : Ssl.certificate option;
  8. channel : string;
    (*

    Channel to join after the connexion to the server

    *)
  9. state_file : string;
    (*

    Where plugins' state is stored

    *)
  10. irc_log : irc_log;
    (*

    Log IRC events

    • deprecated this field will be removed
    *)
  11. log_level : Logs.level;
    (*

    Level of logging.

    • since 0.6
    *)
  12. prefix : string;
    (*

    prefix for commands

    *)
}
val default : t

Default configuration:

  • server = "irc.freenode.net"
  • port = 7000
  • username = "calculon"
  • realname = "calculon"
  • nick = "calculon"
  • tls = true
  • tls_cert = None
  • channel = "#ocaml"
  • state_file = "state.json"
  • irc_log = `None
  • log_level = Logs.Warning
  • prefix = "!"
val parse : ?extra_args:(string * Arg.spec * string) list -> t -> string array -> t

parse conf args is the same as conf, but some command line arguments can override its fields

  • parameter extra_args

    additional command line arguments for Arg (since NEXT_RELEASE)

val of_argv : ?extra_args:(string * Arg.spec * string) list -> unit -> t

Parsed from Sys.argv Will call exit if Arg.parse fails

  • parameter extra_args

    additional command line arguments for Arg (since NEXT_RELEASE)

OCaml

Innovation. Community. Security.