redis

package
v0.0.0-...-98409da Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFingerPrintListName

func GetFingerPrintListName() string

GetFingerPrintListName 读取application.yaml配置文件内redis.FingerPrintListName

func GetIdleTimeout

func GetIdleTimeout() int

GetIdleTimeout 读取application.yaml配置文件内redis.IdleTimeout

func GetMaxActive

func GetMaxActive() int

GetMaxActive 读取application.yaml配置文件内redis.MaxActive

func GetMaxConnLifetime

func GetMaxConnLifetime() int

GetMaxConnLifetime 读取application.yaml配置文件内redis.MaxConnLifetime

func GetMaxIdle

func GetMaxIdle() int

GetMaxIdle 读取application.yaml配置文件内redis.MaxIdle

func GetPortScannerListName

func GetPortScannerListName() string

GetPortScannerListName 读取application.yaml配置文件内redis.PortScannerListName

func GetRedisIP

func GetRedisIP() string

GetRedisIP 读取application.yaml配置文件内redis.IP

func GetRedisPassword

func GetRedisPassword() string

GetRedisPassword 读取application.yaml配置文件内redis.Password

func GetRedisPort

func GetRedisPort() string

GetRedisPort 读取application.yaml配置文件内redis.Port

func PushPortScannerTask

func PushPortScannerTask(conn redis.Conn, ip string) error

func SendToFingerPrintList

func SendToFingerPrintList(conn redis.Conn, s string) error

SendToFingerPrintList 发送IP:PORT到redis的FingerPrint列表

Types

type RedisConn

type RedisConn struct {
	// contains filtered or unexported fields
}

RedisConn 非连接池

func (*RedisConn) NewRedisClient

func (redisConn *RedisConn) NewRedisClient()

NewRedisClient redis初始化连接

type RedisPool

type RedisPool struct {
	Dial            func() (redis.Conn, error) // 连接数据库使用
	MaxIdle         int                        // 最大空闲数
	MaxActive       int                        // 最大存活数
	IdleTimeout     time.Duration              // 空闲超时时间
	MaxConnLifetime time.Duration              // 最大生命周期
	Pool            *redis.Pool                // 全局redis连接池句柄
}

RedisPool 连接池

func (*RedisPool) NewRedisPool

func (redisPool *RedisPool) NewRedisPool()

InitRedis 初始化RedisPool(连接池版本)

func (*RedisPool) OnPortScannerQueue

func (redisPool *RedisPool) OnPortScannerQueue(wg *sync.WaitGroup, timeout time.Duration, call func(string, chan int, error))

OnQueue 监听(非连接池版本) wg 协程 queue redis list key name timeout 监听轮询间隔时间 call 回调函数,处理从redis获取的数据

Jump to

Keyboard shortcuts

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