scaner

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package scaner 使用scan遍历查询的工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSetpSize

func WithSetpSize(stepsize int64) optparams.Option[Options]

WithMaxTTL 设置最大过期时间

Types

type Options

type Options struct {
	StepSize int64
}

Option 设置key行为的选项 @attribute MaxTTL time.Duration 为0则不设置过期 @attribute AutoRefresh string 需要为crontab格式的字符串,否则不会自动定时刷新

type Scanner

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

func New

func (*Scanner) Find

func (s *Scanner) Find(ctx context.Context, partten string) ([]string, error)

Find 查询满足匹配的所有key

func (*Scanner) FindOne

func (s *Scanner) FindOne(ctx context.Context, partten string) (string, error)

FindOne 查询满足匹配的一个key

type ScannerINterface

type ScannerINterface interface {
	Find(ctx context.Context, partten string) ([]string, error)
	FindOne(ctx context.Context, partten string) (string, error)
}

Jump to

Keyboard shortcuts

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