Documentation ¶
Index ¶
- func EStamatewithParameters(n uint, p float64) (m uint, k uint)
- func GenerateRandom(digit int) string
- func GenerateRandomTime() time.Duration
- func InitWorker(workerId int64)
- func SnowFlake(db *gorm.DB)
- func Version(db *gorm.DB)
- type BloomFilter
- func (f *BloomFilter) Add(data []byte) *BloomFilter
- func (f *BloomFilter) AddString(data string) *BloomFilter
- func (f *BloomFilter) Cap() uint
- func (f *BloomFilter) Clear() *BloomFilter
- func (f *BloomFilter) Copy() *BloomFilter
- func (f *BloomFilter) Equal(g *BloomFilter) bool
- func (f *BloomFilter) EstimateFalsePositiveRate(n uint, rounds uint32) (fpRate float64)
- func (f *BloomFilter) GK() uint
- func (f *BloomFilter) GoDecode(data []byte) error
- func (f *BloomFilter) GoEncode() ([]byte, error)
- func (f *BloomFilter) MarshaJson() ([]byte, error)
- func (f *BloomFilter) Merge(g *BloomFilter) error
- func (f *BloomFilter) Readfrom(stream io.Reader) (int64, error)
- func (f *BloomFilter) Test(data []byte) bool
- func (f *BloomFilter) TestAndAdd(data []byte) bool
- func (f *BloomFilter) TestAndAddString(data []byte) bool
- func (f *BloomFilter) TestLocations(locs []uint64) bool
- func (f *BloomFilter) TestString(data []byte) bool
- func (f *BloomFilter) UnMarshaJson(data []byte) error
- func (f *BloomFilter) Writeto(stream io.Writer) (int64, error)
- type PageHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BloomFilter ¶
type BloomFilter struct { M uint `json:"m"` //容量 K uint `json:"k"` //hash函数个数 B *bitset.BitSet `json:"b"` }
func (*BloomFilter) Add ¶
func (f *BloomFilter) Add(data []byte) *BloomFilter
func (*BloomFilter) AddString ¶
func (f *BloomFilter) AddString(data string) *BloomFilter
func (*BloomFilter) Cap ¶
func (f *BloomFilter) Cap() uint
func (*BloomFilter) EstimateFalsePositiveRate ¶
func (f *BloomFilter) EstimateFalsePositiveRate(n uint, rounds uint32) (fpRate float64)
测试正确率
func (*BloomFilter) GK ¶
func (f *BloomFilter) GK() uint
func (*BloomFilter) GoDecode ¶
func (f *BloomFilter) GoDecode(data []byte) error
func (*BloomFilter) GoEncode ¶
func (f *BloomFilter) GoEncode() ([]byte, error)
func (*BloomFilter) Merge ¶
func (f *BloomFilter) Merge(g *BloomFilter) error
func (*BloomFilter) Test ¶
func (f *BloomFilter) Test(data []byte) bool
func (*BloomFilter) TestAndAddString ¶
func (f *BloomFilter) TestAndAddString(data []byte) bool
测试是否存在,存在就更新
func (*BloomFilter) TestLocations ¶
func (f *BloomFilter) TestLocations(locs []uint64) bool
测试整数 是否存在
func (*BloomFilter) TestString ¶
func (f *BloomFilter) TestString(data []byte) bool
type PageHelper ¶
type PageHelper struct { Page int64 `json:"page"` Size int64 `json:"size"` Total int64 `json:"total"` Pages int64 `json:"pages"` }
func (*PageHelper) Limit ¶
func (ph *PageHelper) Limit() int64
func (*PageHelper) Offset ¶
func (ph *PageHelper) Offset() int64
func (*PageHelper) SetPages ¶
func (ph *PageHelper) SetPages(total int64)
Click to show internal directories.
Click to hide internal directories.