client

command module
v0.0.0-...-723cda8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

README

nabia-client

Build Status Coverage Status Latest Release Go Report Card

Nabia-compatible HTTP client for interacting with Nabia servers.

Quick Start

Prerequisites
  • Go 1.22 or higher
  • A running Nabia server instance
Installation
# Clone the repository
git clone https://github.com/Nabia-DB/nabia.git
cd nabia/client

# Install dependencies
go mod download

# Build the application
go build -o nabia-client .
Usage

The nabia-client supports all HTTP methods that the Nabia server implements:

Configuration

The client can be configured using command-line flags or environment variables:

# Command-line flags
./nabia-client --host localhost --port 5380 GET mykey

# Environment variables
export NABIA_HOST=localhost
export NABIA_PORT=5380
./nabia-client GET mykey
Basic Operations

GET - Retrieve a value:

./nabia-client GET mykey

POST - Create a new key-value pair:

# From command line
./nabia-client POST mykey "Hello, World!"

# From file
./nabia-client POST mykey --file /path/to/file.txt

PUT - Create or update a key-value pair:

# From command line
./nabia-client PUT mykey "Updated value"

# From file
./nabia-client PUT mykey --file /path/to/file.txt

DELETE - Remove a key:

./nabia-client DELETE mykey

HEAD - Check if a key exists:

./nabia-client HEAD mykey

OPTIONS - Get allowed methods for a key:

./nabia-client OPTIONS mykey
Working with Files

The client can handle file uploads and downloads:

# Upload a file
./nabia-client POST image.jpg --file /path/to/image.jpg

# The client automatically detects MIME types for files
Content Types

The client automatically handles content types:

  • Text data is sent as text/plain; charset=utf-8
  • File uploads use automatic MIME type detection
  • Binary data defaults to application/octet-stream

API Compatibility

This client is compatible with the Nabia server API. Read the full specification.

Development

Running Tests
go test ./...
Building from Source
go build -o nabia-client .

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Merge Request

License

See LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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