filter

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, val string) (bool, error)

func Exist

func Exist(ctx context.Context, val string) (bool, error)

func InitFilter added in v0.0.3

func InitFilter(name string, opt FilterOption)

Types

type Filter

type Filter interface {
	Exist(ctx context.Context, val string) (bool, error)
	Add(ctx context.Context, val string) (bool, error)
}

func NewRedisFilter

func NewRedisFilter(opt FilterOption) Filter

new filter base redis

type FilterOption

type FilterOption struct {
	Host        string
	Auth        bool
	Username    string
	Password    string
	Database    string
	Table       string
	DB          int
	Key         string
	MaxIdle     int
	IdleTimeout time.Duration
	MaxActive   int
}

type LinkFilterBaseRedis

type LinkFilterBaseRedis struct {
	Client *redisbloom.Client
	Pool   *redigo.Pool
	Key    string
}

func (*LinkFilterBaseRedis) Add

func (c *LinkFilterBaseRedis) Add(ctx context.Context, val string) (bool, error)

func (*LinkFilterBaseRedis) Exist

func (c *LinkFilterBaseRedis) Exist(ctx context.Context, val string) (bool, error)

Jump to

Keyboard shortcuts

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