Documentation ¶
Index ¶
- Variables
- type Durable
- func (s *Durable) Add(item string, value []byte)
- func (s *Durable) Close() error
- func (s *Durable) Count() (count int)
- func (s *Durable) Del(item string)
- func (s *Durable) Get(item string) Value
- func (s *Durable) GetBinaryCodec() binary.Codec
- func (s *Durable) Has(item string) bool
- func (s *Durable) Merge(other Map)
- func (s *Durable) Range(prefix []byte, tombstones bool, f func(string, Value) bool)
- type Map
- type Value
- type Volatile
- func (s *Volatile) Add(item string, value []byte)
- func (s *Volatile) Count() (count int)
- func (s *Volatile) Del(item string)
- func (s *Volatile) Get(item string) Value
- func (s *Volatile) GetBinaryCodec() binary.Codec
- func (s *Volatile) Has(item string) bool
- func (s *Volatile) Merge(other Map)
- func (s *Volatile) Range(prefix []byte, tombstones bool, f func(string, Value) bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var Now clock = func() int64 { return time.Now().UnixNano() }
Now gets the current time in Unix nanoseconds
Functions ¶
This section is empty.
Types ¶
type Durable ¶
type Durable struct {
// contains filtered or unexported fields
}
Durable represents a last-write-wins CRDT set which can be persisted to disk.
func NewDurable ¶
NewDurable creates a new last-write-wins set with bias for 'add'.
func (*Durable) GetBinaryCodec ¶
GetBinaryCodec retrieves a custom binary codec.
type Map ¶
type Map interface { Add(string, []byte) Del(string) Has(string) bool Get(string) Value Merge(Map) Range([]byte, bool, func(string, Value) bool) Count() int }
Map represents a contract for a CRDT map.
type Value ¶
type Value []byte
Value represents a time pair with a value.
type Volatile ¶
type Volatile struct {
// contains filtered or unexported fields
}
Volatile represents a last-write-wins CRDT set.
func NewVolatile ¶
func NewVolatile() *Volatile
NewVolatile creates a new last-write-wins set with bias for 'add'.
func (*Volatile) GetBinaryCodec ¶
GetBinaryCodec retrieves a custom binary codec.
Click to show internal directories.
Click to hide internal directories.