Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Number2Bytes ¶
func Number2Bytes[T constraints.Integer | constraints.Float](num T) []byte
Types ¶
type Counter ¶
type Counter[T comparable] struct { // contains filtered or unexported fields }
Counter 计数器.
type NumHLLPP ¶
type NumHLLPP[T constraints.Integer | constraints.Float] struct { Hllpp *hllpp.HLLPP }
Example ¶
package main
import (
"fmt"
"github.com/xuender/kit/counter"
)
func main() {
hll := counter.NewNumHLLPP[int]()
hll.Add(3)
hll.Add(3)
hll.Add(1)
hll.Add(3)
fmt.Println(hll.Count())
}
Output: 2
func NewNumHLLPP ¶
func NewNumHLLPP[T constraints.Integer | constraints.Float]() *NumHLLPP[T]
func Unmarshal ¶
func Unmarshal[T constraints.Integer | constraints.Float](data []byte) (*NumHLLPP[T], error)
nolint
Click to show internal directories.
Click to hide internal directories.