Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToInt64 ¶
func BytesToString ¶
BytesToString converts a string to a byte slice.
Note: This link the returned b slice as the underlying value of the s string, so any changes on b will also be reflected to s. Make sure you won't change b or only changed it AFTER the returning s string has been used and it won't be accessed anymore. Careful while using this function.
func Int64ToBytes ¶
func StringToBytes ¶
StringToBytes converts a string to a byte slice.
Note: This link the returned b slice to the s string, so any changes on b will also be reflected to s. Careful while using this function.
Types ¶
type Dashtable ¶
type Dashtable[K comparable, V any] struct { // contains filtered or unexported fields }
Dashtable is a toy implementation of dragonfly's dashtable. https://github.com/dragonflydb/dragonfly/blob/main/docs/dashtable.md A dashtable is expected to be run in a single thread/goroutine only, and currently it's NOT thread-safe to call Set and Get in parallel. To better scale out, build the application top of the Dashtable which pin each CPU thread to a dashtable instance.
func New ¶
func New[K comparable, V any](noMaxItem uint64) *Dashtable[K, V]
New returns a ready to use Dashtable.
noMaxItem provides a hint on how many segments we need to create first hand to be able to hold up to that maximum number of items, as we haven't implemented dashtable growth via segment splitting yet.