Geocube GoLang Client Library is delivered as an example of Geocube Client. It can be used as a module in a Golang application or as a Command-Line-Interface.
- GoLang 1.16
- An instance of the Geocube Server, its url and, depending on the configuration, its ApiKey
$ GO111MODULE=on go get github.com/airbusgeo/geocube-client-go
...
import (
"github.com/airbusgeo/geocube-client-go/client"
)
...
Build the command-line-interface
$ cd cli && go build
$ ./cli --help
NAME:
cli - Command-Line-Interface Client for the Geocube
USAGE:
cli [global options] command [command options] [arguments...]
VERSION:
0.2.0
DESCRIPTION:
Command-Line-Interface Client to connect to a Geocube Server (github.com/airbusgeo/geocube)
COMMANDS:
records, r manage records
layouts, l manage layout
catalog, c access catalog
variables, v manage variables
palettes, p manage palettes
operation, o manage datasets
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--srv value geocube server endpoint (default: "127.0.0.1:8080")
--apikey value distribute api key
--insecure allow insecure grpc
--help, -h show help
--version, -v print the version
The connection is configured using the global options srv
, apikey
, insecure
:
./cli --srv 127.0.0.1:8080 --insecure
Commands are grouped by kind of operations. The entities accepts the CRUD(L) operations (all operations are not implemented yet):
records
: commands to handle recordslayouts
: commands to handle layoutsvariables
: commands to handle variablespalettes
: commands to handle palettes (create)operation
: commands to handle datasets (indexation, delation, consolidation...)catalog
: commands to access catalog (get cube of data) Please follow the Data Access Jupyter notebook
Documentation of each command is available with the following command:
$ ./cli command --help
Documentation of the client will be available soon. Please refer to the GRPC documentation.
Geocube-Client-Go is under development. The API might evolve in backwards incompatible ways until essential functionality is covered.
Geocube-Client-Go uses the protobuf GRPC interface, automatically generated from the protobuf files provided by the Geocube.
The pb
files can be generated using the module protoc-gen-go
(go get -u github.com/golang/protobuf/protoc-gen-go
), the geocube protobuf folder and the following command:
protoc -I <geocube_folder>/api/v1/ --go_out=plugins=grpc:. pb/geocube.proto pb/catalog.proto pb/records.proto pb/dataformat.proto pb/variables.proto pb/layouts.proto pb/operations.proto
Contributions are welcome. Please read the contributing guidelines before submitting fixes or enhancements.
Geocube-Client-Go is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Geocube is a project under development by Airbus DS Geo SA with the support of CNES.