Documentation
¶
Index ¶
- Variables
- type Sketch
- func (sk *Sketch) AppendBinary(data []byte) ([]byte, error)
- func (sk *Sketch) Clone() *Sketch
- func (sk *Sketch) Estimate() uint64
- func (sk *Sketch) Insert(e []byte)
- func (sk *Sketch) InsertHash(x uint64)
- func (sk *Sketch) MarshalBinary() (data []byte, err error)
- func (sk *Sketch) Merge(other *Sketch) error
- func (sk *Sketch) UnmarshalBinary(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrorTooShort = errors.New("too short binary")
ErrorTooShort is an error that UnmarshalBinary try to parse too short binary.
Functions ¶
This section is empty.
Types ¶
type Sketch ¶
type Sketch struct {
// contains filtered or unexported fields
}
func New14 ¶
func New14() *Sketch
New14 returns a HyperLogLog Sketch with 2^14 registers (precision 14)
func New16 ¶
func New16() *Sketch
New16 returns a HyperLogLog Sketch with 2^16 registers (precision 16)
func New16NoSparse ¶
func New16NoSparse() *Sketch
New16NoSparse returns a HyperLogLog Sketch with 2^16 registers (precision 16) that will not use a sparse representation
func NewNoSparse ¶
func NewNoSparse() *Sketch
NewNoSparse returns a HyperLogLog Sketch with 2^14 registers (precision 14) that will not use a sparse representation
func (*Sketch) AppendBinary ¶ added in v0.2.3
AppendBinary implements the encoding.BinaryAppender interface.
func (*Sketch) InsertHash ¶
func (*Sketch) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
When the result will be appended to another buffer, consider using AppendBinary to avoid additional allocations and copying.
func (*Sketch) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.