skeg_client/server

What the connected server is and can do.

Types

pub type Capabilities {
  Capabilities(
    version: String,
    kinds: List(vector.Kind),
    default_kind: vector.Kind,
    features: List(String),
    limits: Limits,
    read_only: Bool,
    auth_supported: Bool,
    auth_required: Bool,
    raw: resp_codec.Value,
  )
}

Constructors

  • Capabilities(
      version: String,
      kinds: List(vector.Kind),
      default_kind: vector.Kind,
      features: List(String),
      limits: Limits,
      read_only: Bool,
      auth_supported: Bool,
      auth_required: Bool,
      raw: resp_codec.Value,
    )

    Arguments

    kinds

    Index kinds the server accepts, in the server’s order.

    default_kind

    The kind used by a create that names none.

    features

    Optional features this build supports, such as vsearch.filter.

    read_only

    True for a server that refuses every write.

    auth_supported

    The server can authenticate tenants.

    auth_required

    The server refuses unauthenticated connections.

    raw

    The reply as received, including fields this client does not read.

The tenant this connection acts as.

pub type Identity {
  Identity(tenant: String, mode: String)
}

Constructors

  • Identity(tenant: String, mode: String)

Limits the server advertises. They can change between releases: read them from the server rather than hard-coding them.

pub type Limits {
  Limits(max_dim: Int, max_k: Int, max_l: Int)
}

Constructors

  • Limits(max_dim: Int, max_k: Int, max_l: Int)

    Arguments

    max_dim

    Widest vector an index accepts.

    max_k

    Largest k a search honours; a larger k is reduced to this.

    max_l

    Largest search list for create (refused above) and for a search (reduced to this above).

Values

pub fn capabilities(
  connection: connection.Connection,
) -> Result(Capabilities, error.Error)
pub fn has_feature(
  capabilities: Capabilities,
  feature: String,
) -> Bool

Whether capabilities lists feature.

pub fn ping(
  connection: connection.Connection,
) -> Result(Nil, error.Error)

Checks that the server answers.

pub fn whoami(
  connection: connection.Connection,
) -> Result(Identity, error.Error)
✨ Search Document