geocube-client-go

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2023 License: Apache-2.0

README

Geocube GoLang Client Library

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.

Requirements

  • GoLang 1.16
  • An instance of the Geocube Server, its url and, depending on the configuration, its ApiKey

Installation

Geocube-Client-Go
$ GO111MODULE=on go get github.com/airbusgeo/geocube-client-go
...
import (
  "github.com/airbusgeo/geocube-client-go/client"
)
...
Command-Line-Interface

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
Connect to the Geocube

The connection is configured using the global options srv, apikey, insecure:

./cli --srv 127.0.0.1:8080 --insecure

Documentation

CLI

Commands are grouped by kind of operations. The entities accepts the CRUD(L) operations (all operations are not implemented yet):

  • records : commands to handle records
  • layouts : commands to handle layouts
  • variables : commands to handle variables
  • palettes : 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
Client

Documentation of the client will be available soon. Please refer to the GRPC documentation.

Status

Geocube-Client-Go is under development. The API might evolve in backwards incompatible ways until essential functionality is covered.

Update GRPC Interface

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

Contributing

Contributions are welcome. Please read the contributing guidelines before submitting fixes or enhancements.

Licensing

Geocube-Client-Go is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Credits

Geocube is a project under development by Airbus DS Geo SA with the support of CNES.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL