API
Geocore APIs are gRPC APIs.
In the Download section, you can find the archive of all:
- API packages (api-core tgz files) including npm, pypi, nuget, maven, pubdev packages and proto files for each API service
- MQTT data models (mqtt-transtream tgz files)
You will also find a simulation tool helping you to exploit evttest API to generate fake events on your boards for test.
Please contact support team to get access credentials to the download section
For resource management reasons, only Geo API is deployed by default.
Evttest and Perso are deployed in your environment on demand. Please contact support team.
Loading a package from a local file may be new to you, even if you have used some of these package managers for years.
In our case, packages are not hosted on public registries like PyPI, NuGet.org, npmjs.com or pub.dev.
Instead, we ship archive files (tarballs, nupkg, jars, …) that you can:
- install directly into your local environment, and/or
- re-publish into your own private registries.
Below are guides to load a package on your local setup.
pip is the standard package manager for the python programming language.
API modules are available in tar.gz format. For instance:
pypi-centiloc_core-1.15.2.tar.gz
Copy this file into your project (for example in a vendor/ folder), then install it into your Python (virtual) environment.
You must have pip installed.
From the directory where the file is located:
python -m pip install --upgrade pypi-centiloc_core-1.15.2.tar.gz
# or, more generally:
python -m pip install --upgrade ./pypi-centiloc_core-<VERSION>.tar.gz
Once installed, you can import and use the generated modules:
from centiloc_core.geo import board_pb2_grpc
from centiloc_core.geo import common_pb2
# […]
board_arg = common_pb2.BoardID(sn=board_sn)
You may also push the same tar.gz to your own PyPI-compatible registry (Artifactory, Nexus, …) if you prefer.
nuget is a package format for .NET technology, such as C# or Visual Basic.
API modules are available in .nupkg format. For instance:
Centiloc.Core.1.15.2.nupkg
We recommend using a local folder source in addition to your usual NuGet sources (for example nuget.org).
- Copy the file to a local folder:
mkdir -p ./packages
cp Centiloc.Core.1.15.2.nupkg ./packages/
- Create a
NuGet.confignext to your.csprojto declare both sources:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="centiloc-local" value="./packages" />
</packageSources>
</configuration>
- Add the package to your project:
dotnet add package Centiloc.Core --version 1.15.2
Centiloc.Core will be resolved from ./packages, while dependencies such as Google.Protobuf are resolved from nuget.org.
Then restore and build as usual:
dotnet restore
dotnet build
If you already have a private NuGet feed, you can also upload Centiloc.Core.1.15.2.nupkg there and consume it as a normal package from your own source.
npm is the package manager for the Node.js and JavaScript/TypeScript ecosystem.
API modules are available as tgz bundles produced by npm pack. For instance:
npm-centiloc-centiloc_core-1.15.2.tgz
This file contains a package.json and the generated JS/TS stubs.
Copy the file into your project (for example into a vendor/ directory):
cp /download/path/npm-centiloc-centiloc_core-1.15.2.tgz ./vendor/
Then, from your project root:
npm install ./vendor/npm-centiloc-centiloc_core-1.15.2.tgz
# or with pnpm/yarn if you prefer
This will add the package to your node_modules and to your package-lock.json.
Instead of calling npm install manually, you can declare the tarball as a dependency:
{
"dependencies": {
"@centiloc/centiloc_core": "file:./vendor/npm-centiloc-centiloc_core-1.15.2.tgz"
}
}
(adapt the package name to whatever is defined in the name field of the bundled package.json.)
Then run:
npm install
You can then import the generated stubs from your code, e.g.:
// Example – actual path depends on how the package is structured
import { GeoClient } from '@centiloc/centiloc_core/geo';
You may also push the tarball to your own npm-compatible registry if you have one.
For Java / Kotlin projects, we ship:
maven-centiloc-core-1.15.2.jarmaven-centiloc-core-1.15.2.pom(cleaned POM with dependencies, no internal Centiloc URLs)
These files represent a standard Maven artifact:
<groupId>com.centiloc</groupId>
<artifactId>centiloc-core</artifactId>
<version>1.15.2</version>
From the directory containing the JAR and POM:
mvn install:install-file \
-Dfile=maven-centiloc-core-1.15.2.jar \
-DpomFile=maven-centiloc-core-1.15.2.pom
This installs the artifact into your local ~/.m2/repository.
You can then depend on it from another Maven project:
<dependencies>
<dependency>
<groupId>com.centiloc</groupId>
<artifactId>centiloc-core</artifactId>
<version>1.15.2</version>
</dependency>
</dependencies>
After that, a standard:
mvn clean install
will resolve the Centiloc API and all its transitive dependencies (Protobuf, gRPC, etc.).
If you have a private Maven repository (Nexus, Artifactory, GitLab Package Registry, …), you can use:
mvn deploy:deploy-file \
-Dfile=maven-centiloc-core-1.15.2.jar \
-DpomFile=maven-centiloc-core-1.15.2.pom \
-DrepositoryId=<your-repo-id> \
-Durl=<your-repo-url>
Once deployed, your projects can consume com.centiloc:centiloc-core:1.15.2 directly from your registry.
For Dart / Flutter, we distribute a ready-to-use package structure as a tarball:
dart-centiloc_core_dart_v1.15.2.tgz
Inside this archive, you will find:
- a
pubspec.yaml - a
lib/folder with the generated.dartstubs
Choose a folder where you keep third-party code, for example third_party/centiloc_core:
mkdir -p third_party/centiloc_core
tar -C third_party/centiloc_core -xvzf dart-centiloc_core_dart_v1.15.2.tgz
After extraction, third_party/centiloc_core/ should contain a pubspec.yaml and lib/.
In your application’s pubspec.yaml:
dependencies:
centiloc_core:
path: ../third_party/centiloc_core
(adapt the path according to your project layout.)
Then run:
dart pub get
# or:
flutter pub get
You can now import the generated APIs in your Dart / Flutter code:
import 'package:centiloc_core/geo/geo.pbgrpc.dart';
Note: this is a path dependency – the package is not published to pub.dev. You are free to re-host it on your own server if you have a private pub server.
For Go, we currently provide a tarball containing the generated .pb.go files, but no go.mod file:
proto-centiloc__proto.v1.15.2.tgz
The tarball contains Go packages generated from the Protobuf definitions (e.g. geo, perso, etc.). It is intended to be vendored directly into your application.
There are two main ways to consume it, depending on how you manage Go modules.
-
Inspect one of the generated files (for example
geo.pb.go) and find its import path, coming fromoption go_packagein the.protofile, something like:package geo // import path comment, for example: // option go_package = "git.centiloc.com/centiloc/core/geo;geo"; -
Extract the tarball into your
$GOPATH/srcso that the directory matches this path:# example with go_package = "git.centiloc.com/centiloc/core/geo;geo" mkdir -p "$GOPATH/src/git.centiloc.com/centiloc/core" tar -C "$GOPATH/src/git.centiloc.com/centiloc/core" -xvzf proto-centiloc__proto.v1.15.2.tgz -
In your Go code, import the package using that path:
import "git.centiloc.com/centiloc/core/geo" func useAPI() { var id geo.BoardID _ = id }
Go will compile using the sources you unpacked under $GOPATH.
If your project uses Go modules (go.mod), you can:
-
Extract the tarball into a folder inside your repo, for example:
mkdir -p internal/vendor/centiloc_proto tar -C internal/vendor/centiloc_proto -xvzf proto-centiloc__proto.v1.15.2.tgz -
In your
go.mod, add areplacedirective that maps the import path fromgo_packageto this local folder. For example, ifgo_packageis:option go_package = "git.centiloc.com/centiloc/core/geo;geo";then in
go.mod:module your.app/module go 1.21 require git.centiloc.com/centiloc/core v1.15.2 replace git.centiloc.com/centiloc/core => ./internal/vendor/centiloc_proto -
Your code can then import using the canonical path:
import "git.centiloc.com/centiloc/core/geo"
Important: always adapt the import paths /
replacetarget to the actualgo_packageused in the Protobuf files for your API version.