rally/runtime/bootstrap

Types

pub type Config {
  Config(
    package_name: String,
    port: Int,
    database_path: String,
    auth_secret_env: String,
    allow_missing_development_auth_secret: Bool,
    static_prefix: String,
    static_root: String,
    http: http_server.Config,
  )
}

Constructors

  • Config(
      package_name: String,
      port: Int,
      database_path: String,
      auth_secret_env: String,
      allow_missing_development_auth_secret: Bool,
      static_prefix: String,
      static_root: String,
      http: http_server.Config,
    )
pub type ConfigError {
  CannotReadGleamToml(message: String)
  InvalidGleamToml(message: String)
  InvalidPort(value: String)
}

Constructors

  • CannotReadGleamToml(message: String)
  • InvalidGleamToml(message: String)
  • InvalidPort(value: String)
pub type Context {
  Context(db: sqlight.Connection, session: session.AuthSession)
}

Constructors

pub type StartError {
  ConfigError(error: ConfigError)
  DatabaseOpenFailed(path: String, message: String)
  AuthSessionConfigFailed(error: session.AuthSessionConfigError)
}

Constructors

Values

pub fn config_error_message(error: ConfigError) -> String
pub fn config_from_project(
  default_port default_port: Int,
) -> Result(Config, ConfigError)
pub fn config_from_toml(
  toml toml: String,
  default_port default_port: Int,
  port_override port_override: Result(String, Nil),
  database_path_override database_path_override: Result(
    String,
    Nil,
  ),
) -> Result(Config, ConfigError)
pub fn listen(
  config config: Config,
  handlers handlers: Handlers,
) -> Result(Nil, StartError)
pub fn start(
  default_port default_port: Int,
  handlers handlers: Handlers,
) -> Result(Nil, StartError)
pub fn start_error_message(error: StartError) -> String
Search Document