From 7d25a3f9996e2f68932a992de7bd3f56b3c704c5 Mon Sep 17 00:00:00 2001 From: Lek Huda Date: Mon, 20 Sep 2021 01:55:07 +0700 Subject: [PATCH] readme update --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 829cdf4..7d5ba77 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,42 @@ -## Description +# Description -[DiskV](https://github.com/peterbourgon/diskv) wrapper using versioning method. +[Diskv](https://github.com/peterbourgon/diskv) wrapper using versioning method. -> [DiskV](https://github.com/peterbourgon/diskv) is simple, persistent key-value store written in the Go language. \ No newline at end of file + +# Installing + +Install +```bash +$ go get github.com/mkhuda/diskv_wrapper +``` + + +# Usage + +```go +package main + +import ( + "fmt" + "github.com/peterbourgon/diskv" + "github.com/mkhuda/diskv_wrapper" +) + +func main() { + disk := diskv.New(diskv.Options{ + BasePath: basePath, + AdvancedTransform: diskv_wrapper.AdvanceTransform, + InverseTransform: diskv_wrapper.InverseTransform, + CacheSizeMax: 1024 * 1024, + }) + + diskv_wrapper.WriteVersion(disk, "v1") + + path := strings.Join([]string{"v1", "key"}, "/") + + diskv_wrapper.Write(disk, path, "testdata") +} +``` +# Credits + +Diskv Creator: [Peter Bourgon](https://github.com/peterbourgon) \ No newline at end of file