View Source ExTypesense.Connection (ExTypesense v0.7.3)

Fetches credentials either from application env or map.

Summary

Functions

Setting new connection or using the default config.

Types

@type t() :: %{
  host: binary() | nil,
  api_key: binary() | nil,
  port: non_neg_integer() | nil,
  scheme: binary() | nil
}

Functions

Link to this function

new(connection \\ defaults())

View Source (since 0.4.0)
@spec new(connection :: t() | map()) :: t()

Setting new connection or using the default config.

On using this function

Functions e.g. ExTypesense.search don't need to explicitly pass this unless you want to use another connection. See README for more details. Also, api_key is hidden when invoking this function.

Examples

iex> conn = ExTypesense.Connection.new()
%ExTypesense.Connection{
  host: "localhost",
  port: 8108,
  scheme: "http",
  ...
}