///|
/// The connection parameters for an LDAP session.
pub struct LdapConfig {
  host : String
  port : Int
  version : Int
  max_message_size : Int
  timeout_ms : Int?
  require_tls : Bool
} derive(Eq, @debug.Debug)

///|
pub fn LdapConfig::new(
  host : String,
  port : Int,
  version? : Int,
  max_message_size? : Int,
  timeout_ms? : Int,
  require_tls? : Bool,
) -> LdapConfig {
  {
    host,
    port,
    version: match version {
      Some(v) => v
      None => 3
    },
    max_message_size: match max_message_size {
      Some(v) => v
      None => 64 * 1024 * 1024
    },
    timeout_ms,
    require_tls: match require_tls {
      Some(v) => v
      None => false
    },
  }
}