Skip to content

hugiot/redkacli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redka 客户端

一个 Redka 客户端,使用体验更像在使用 Redis 客户端。

特征

快速开始

先决条件

Redka Client 要求 Go 版本 1.22 或以上。

获取 Redka Client

import "github.com/hugiot/redkacli"

或者

go get -u github.com/hugiot/redkacli

运行

package main

import (
	"fmt"
	"github.com/hugiot/redkacli"
	"log"
)

func main() {
	options := redkacli.NewOptions()
	options.SetPath("./test.db")
	client, err := redkacli.New(options)
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	// string commands
	_ = client.Set("name", "Tom")
	fmt.Println(client.Get("name"))

	// hash commands
	_, _ = client.HSet("object", map[string]interface{}{
		"name": "Tom",
		"age":  10,
		"city": "New York",
	})
	fmt.Println(client.HGetAll("object"))
	
	// other commands
	// ……
}

感谢

许可证

2025 © hugiot. This project is MIT licensed.

About

A redis client adapted to redka

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages