consistent:一个Go库,该库实现一致性哈希和有界负载的一致性哈希

时间:2021-04-12 11:46:38
【文件属性】:
文件名称:consistent:一个Go库,该库实现一致性哈希和有界负载的一致性哈希
文件大小:7KB
文件格式:ZIP
更新时间:2021-04-12 11:46:38
golang consistent-hashing Go 包装一致 一致性哈希和有界负载的一致性哈希的Golang实现。 一致的哈希示例 package main import ( "log" "github.com/lafikl/consistent" ) func main () { c := consistent . New () // adds the hosts to the ring c . Add ( "127.0.0.1:8000" ) c . Add ( "92.0.0.1:8000" ) // Returns the host that owns `key`. // // As described in https://en.wikipedia.org/wiki/Consistent_hashing // // It returns ErrNoHosts if the ring has no host
【文件预览】:
consistent-master
----go.mod(119B)
----example_test.go(1KB)
----go.sum(233B)
----LICENSE(1KB)
----consistent_test.go(2KB)
----README.md(3KB)
----consistent.go(5KB)
----.gitignore(275B)

网友评论