Giter VIP home page Giter VIP logo

ti-kv-api's Introduction

TiKV API

Go Go Coverage

Introduction

This project provides a simple API to interact with TiKV, a distributed transactional key-value database. Using this API, users can store, retrieve, update, and delete blobs of data in TiKV. The API is built with Go and utilizes the TiKV client to interact directly with a TiKV cluster.

Requirements

  • Go 1.21 or later
  • Docker and Docker Compose
  • TiKV client (referenced in the go.mod file)

Installation

Make sure you have the necessary frameworks and tools required to run the project.

  1. Clone the repository:

    git clone https://github.com/codevalley/ti-kv-api.git
    
  2. Navigate to the project directory, and execute docker build

    cd ti-kv-api
    docker build -t tikvapi .
    
  3. Use Docker Compose to build and start the services

    docker-compose up
  4. Your application can now be accessed at http://localhost:8080

  5. To stop all services and remove associated containers, you can run

    docker-compose down
    

Usage

Add a new blob

Add a new blob to the KV Store

curl -X POST "http://localhost:8080/?blob=HelloWorld"
curl -X POST "http://localhost:8080/?blob=ByeUniverse"
curl -X POST "http://localhost:8080/?blob=GreetingsEarth"

Delete a blob

Delete a specific blob from the KV Store

curl -X DELETE "http://localhost:8080/?blob=ByeUniverse"

Update a blob

Update a specific blob from the KV Store

curl -X PUT "http://localhost:8080/?oldBlob=HelloWorld&newBlob=HelloMultiverse"

Get the blob count

[Todo] Retrieve the number of blobs in the KV store.

curl "http://localhost:8080/blobs/count"

Retreive a random blob

Retrieve a random entry from the KV store.

curl "http://localhost:8080/blobs/random"

Retreive all blobs

[Todo] Retrieve all the blobs from the KV store.

curl "http://localhost:8080/blobs/all"

Maintainers

Narayan (@codevalley)

Contributing

We welcome contributions to this project. Please open an issue or submit a pull request on GitHub!

License

This project is licensed under the MIT License. See the LICENSE file for details.

ti-kv-api's People

Contributors

codevalley avatar vennindoubt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.