SDKs
Available

C++

Use the Loams C++ SDK from CMake and make the first call.

The C++ client speaks Connect over HTTP (JSON, protobuf and gRPC-Web encodings) through libcurl, so it has no grpc++ dependency.

Examples: github.com/ostrium-labs/loams-cpp · Source: sdks/cpp

Install

Download loams-cpp-0.1.0.tar.gz from the GitHub release and use it from CMake:

find_package(loams CONFIG REQUIRED)

Requirements: C++17, CMake 3.20 or later, protobuf 36.1 exactly (the stubs' gencode version), libcurl 8.x and pthreads. Arch ships protobuf 36.1; Ubuntu 24.04's libprotobuf-dev is 3.21, so build protobuf v36.1 from source there. There are no vcpkg or Conan ports yet.

Quickstart

#include <loams/loams.hpp>
#include <iostream>

int main() {
  // EnvToken() reads LOAMS_API_KEY, then LOAMS_TOKEN, then sends nothing,
  // which is all GetInstance needs, so this runs against a fresh `loams dev`.
  auto loams = loams::MakeLoams({.endpoint = "http://127.0.0.1:8080",
                                 .token_source = loams::EnvToken()});

  loams::instance::v1::GetInstanceResponse info;
  loams->Instance()->GetInstance(&info);
  std::cout << info.name() << " " << info.server_version() << "\n";

  try {
    loams->System()->Guard("live");
  } catch (const loams::FeatureNotInVariantError& error) {
    std::cout << "not in this variant: " << error.Variant() << "\n";
  }
}

examples/quickstart/main.cpp in the SDK is the same program, compiled by the SDK's build. Collections and hybrid search are not in the SDK facade in 0.1.0; call the REST API.

On this page