filter

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(bucket Key, key []byte) error

Add will add key to filter bucket

func CheckThenAdd

func CheckThenAdd(bucket Key, key []byte) (bool, error)

CheckThenAdd will check first and if the key is not in the filter bucket, then it will add it and return false, if the key is already in the bucket, it will just return true

func Exists

func Exists(bucket Key, key []byte) bool

Exists checks if the key are already in filter bucket

func Register added in v0.9.0

func Register(h Filter)

Register used to register filter handler to dealing with filter operations

func Remove

func Remove(bucket Key, key []byte) error

Remove will remove key from bucket

Types

type Filter

type Filter interface {
	Exists(bucket Key, key []byte) bool
	Add(bucket Key, key []byte) error
	Delete(bucket Key, key []byte) error
	CheckThenAdd(bucket Key, key []byte) (bool, error)
}

Filter is used to check if the object is in the filter or not

type Key added in v0.9.0

type Key string

Key is the key of filters

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL