cmd

package
v0.0.0-...-7bc661d Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *cobra.Command

New returns a new cobra command.

Types

type CleanerConfig

type CleanerConfig struct {
	// Scanner is used to scan redis keys.
	// Scanner is required.
	Scanner *RedisConfig `validate:"required"`

	// Cleaner is used to delete redis keys.
	// Cleaner is optional. If not set, Scanner will be used.
	Cleaner *RedisConfig

	// Match is the pattern of keys to scan.
	// Match is required.
	Match string `validate:"required"`

	// Count is the number of keys to scan per time.
	// Count is optional. Default is 10.
	// See: https://redis.io/commands/scan
	Count int64

	// Interval time of per scan.
	// Interval is optional. If not set, no sleep between scans.
	Interval time.Duration
}

type Config

type Config struct {
	Cleaner []*CleanerConfig `validate:"required,dive"`
}

type RedisConfig

type RedisConfig struct {
	Addr     string
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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