Ketama
Package ketama implements a consistent hashing ring (long term maintenance).
Install / Use
/learn @hit9/KetamaREADME
Ketama
Package ketama implements a consistent hashing ring (on md5).
https://pkg.go.dev/github.com/hit9/ketama
Example
package main
import (
"fmt"
"github.com/hit9/ketama"
)
func main() {
ring := ketama.NewRing([]*ketama.Node{
ketama.NewNode("127.0.0.1:8000", "binding data0", 1),
ketama.NewNode("127.0.0.1:8001", "binding data1", 1),
ketama.NewNode("127.0.0.1:8002", "binding data2", 1),
ketama.NewNode("127.0.0.1:8003", "binding data3", 1),
ketama.NewNode("127.0.0.1:8004", "binding data3", 1),
})
fmt.Printf("%v\n", ring.Get("key1"))
}
Please checkout ketama_example.go for more .
Links
License
BSD.
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
