Documentation ¶
Index ¶
- Constants
- type Filter
- func (rf *Filter) BulkSet(ctx context.Context, cli *bloomd.Client, rr input.KeyReaderReseter) (results bloomd.ResultReader, err error)
- func (rf *Filter) Check(ctx context.Context, cli *bloomd.Client, k bloomd.Key) (bool, error)
- func (rf *Filter) Clear(ctx context.Context, cli *bloomd.Client) error
- func (rf *Filter) Close(ctx context.Context, cli *bloomd.Client) error
- func (rf *Filter) CreateFilters(ctx context.Context, cli *bloomd.Client, advance clock.UnitNum, capacity int, ...) error
- func (rf *Filter) Drop(ctx context.Context, cli *bloomd.Client) error
- func (rf *Filter) DropOlderFilters(ctx context.Context, cli *bloomd.Client, tail clock.UnitNum) error
- func (rf *Filter) Flush(ctx context.Context, cli *bloomd.Client) error
- func (rf *Filter) MultiCheck(ctx context.Context, cli *bloomd.Client, reader bloomd.KeyReader) (resultReader bloomd.ResultReader, err error)
- func (rf *Filter) Set(ctx context.Context, cli *bloomd.Client, k bloomd.Key) (result bool, err error)
- type Namer
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter provides fuctionality of working with multiple sequential filters through time
func NewFilter ¶
NewFilter creates a new Filter unit - unit of time, e.g. Week, Day or Month. All keys being set during period with a same unit will be stored in a single filter. period - period in specified time units to consider in set operations namer - provides algorithm to name filters according to specified unit of time
func (*Filter) BulkSet ¶
func (rf *Filter) BulkSet(ctx context.Context, cli *bloomd.Client, rr input.KeyReaderReseter) (results bloomd.ResultReader, err error)
BulkSet sets keys to all filters within the configured period it returns result for oldest filter note that it does not check if filter exists
func (*Filter) Check ¶
Check sequentially checks filters through period note that it does not check if filters exist
func (*Filter) CreateFilters ¶
func (rf *Filter) CreateFilters(ctx context.Context, cli *bloomd.Client, advance clock.UnitNum, capacity int, prob float64, inMemory bool) error
CreateFilters creates all filters through a specified period if advance is greater than 0 that it will preallocate filters
func (*Filter) DropOlderFilters ¶
func (rf *Filter) DropOlderFilters(ctx context.Context, cli *bloomd.Client, tail clock.UnitNum) error
DropOlderFilters drops all filters that correspond to units older that period if tail is greater that 0 that it will preserve some old filters