Starship.validate_config-exclamation-mark

You're seeing just the function validate_config-exclamation-mark, go back to Starship module for more information.
Link to this function

validate_config!(config)

View Source

Specs

validate_config!(config :: map()) :: map() | no_return()

Validates the configuration and adds any of the missing required information.

## Examples

iex(1)> config = %{}
%{}
iex(2)> Starship.validate_config!(config)
%{
  hosts: %{
    {:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
    {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
  },
  ip: {0, 0, 0, 0},
  port: 4000,
  ssl_opts: nil
}
iex(3)> config =
...(3)>  %{
...(3)>    ip: {1, 2, 3, 4}
...(3)>  }
%{
  ip: {1, 2, 3, 4}
}
iex(4)> Starship.validate_config!(config)
%{
  hosts: %{
    {:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
    {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
  },
  ip: {1, 2, 3, 4},
  port: 4000,
  ssl_opts: nil
}
iex(5)> config =
...(5)>  %{
...(5)>    ip: {1, 2, 3, 4},
...(5)>    port: 4001
...(5)>  }
%{
  ip: {1, 2, 3, 4},
  port: 4001
}
iex(6)> Starship.validate_config!(config)
%{
  hosts: %{
    {:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
    {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
  },
  ip: {1, 2, 3, 4},
  port: 4001,
  ssl_opts: nil
}
iex(7)> config =
...(7)>  %{
...(7)>    ip: {1, 2, 3, 4},
...(7)>    port: 4001,
...(7)>    hosts: %{
...(7)>      {:http, "*"} => {A.Different.Handler, %{}}
...(7)>    }
...(7)>  }
%{
  hosts: %{
    {:http, "*"} => {A.Different.Handler, %{}},
  },
  ip: {1, 2, 3, 4},
  port: 4001
}
iex(8)> Starship.validate_config!(config)
%{
  hosts: %{
    {:http, "*"} => {A.Different.Handler, %{}},
    {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
  },
  ip: {1, 2, 3, 4},
  port: 4001,
  ssl_opts: nil
}
iex(9)> config =
...(9)>  %{
...(9)>    ip: {1, 2, 3, 4},
...(9)>    port: 4001,
...(9)>    hosts: %{
...(9)>      {:http, "wow"} => {A.Different.Handler, %{}}
...(9)>    }
...(9)>  }
%{
  hosts: %{
    {:http, "wow"} => {A.Different.Handler, %{}},
  },
  ip: {1, 2, 3, 4},
  port: 4001
}
iex(10)> Starship.validate_config!(config)
%{
  hosts: %{
    {:http, "wow"} => {A.Different.Handler, %{}},
    {:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
    {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
  },
  ip: {1, 2, 3, 4},
  port: 4001,
  ssl_opts: nil
}