threeaccents / pebble

Cache on top of badger DB. With GRPC transport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pebble (Not For Use)

GRPC based cache with a customizable backend. Default is badgerDB.

###Run

./cache --db-dir="path/to/db" --port=":5555"

###Example

package main

import (
	"context"
	"fmt"

	"github.com/oriiolabs/pebble/api"
)

func main() {
	ctx := context.Background()

	c, err := api.NewClient(":4200", nil)
	if err != nil {
		panic(err)
	}

	if err := c.Set(ctx, "hello", []byte("world")); err != nil {
		panic(err)
	}

	value, err := c.Get(ctx, "hello")
	if err != nil {
		panic(err)
	}

	fmt.Printf("value: %s\n", string(value))
}

About

Cache on top of badger DB. With GRPC transport


Languages

Language:Go 100.0%