key

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeHash   = "hash"
	TypeList   = "list"
	TypeSet    = "set"
	TypeString = "string"
	TypeZSet   = "zset"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Del

type Del struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Deletes one or more Keys. DEL key [key ...] https://redis.io/commands/del

func ParseDel

func ParseDel(b redis.BaseCmd) (Del, error)

func (Del) Run

func (cmd Del) Run(w redis.Writer, red redis.Redka) (any, error)

type Exists

type Exists struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Determines whether one or more keys exist. EXISTS key [key ...] https://redis.io/commands/exists

func ParseExists

func ParseExists(b redis.BaseCmd) (Exists, error)

func (Exists) Run

func (cmd Exists) Run(w redis.Writer, red redis.Redka) (any, error)

type Expire

type Expire struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Sets the expiration time of a key in seconds. EXPIRE key seconds https://redis.io/commands/expire

func ParseExpire

func ParseExpire(b redis.BaseCmd, multi int) (Expire, error)

func (Expire) Run

func (cmd Expire) Run(w redis.Writer, red redis.Redka) (any, error)

type ExpireAt

type ExpireAt struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Sets the expiration time of a key to a Unix timestamp. EXPIREAT key unix-time-seconds https://redis.io/commands/expireat

func ParseExpireAt

func ParseExpireAt(b redis.BaseCmd, multi int) (ExpireAt, error)

func (ExpireAt) Run

func (cmd ExpireAt) Run(w redis.Writer, red redis.Redka) (any, error)

type FlushDB

type FlushDB struct {
	redis.BaseCmd
}

Remove all keys from the current database. FLUSHDB https://redis.io/commands/flushdb

func ParseFlushDB

func ParseFlushDB(b redis.BaseCmd) (FlushDB, error)

func (FlushDB) Run

func (cmd FlushDB) Run(w redis.Writer, red redis.Redka) (any, error)

type Keys

type Keys struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Returns all key names that match a pattern. KEYS pattern https://redis.io/commands/keys

func ParseKeys

func ParseKeys(b redis.BaseCmd) (Keys, error)

func (Keys) Run

func (cmd Keys) Run(w redis.Writer, red redis.Redka) (any, error)

type Persist

type Persist struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Removes the expiration time of a key. PERSIST key https://redis.io/commands/persist

func ParsePersist

func ParsePersist(b redis.BaseCmd) (Persist, error)

func (Persist) Run

func (cmd Persist) Run(w redis.Writer, red redis.Redka) (any, error)

type RandomKey

type RandomKey struct {
	redis.BaseCmd
}

Returns a random key name from the database. RANDOMKEY https://redis.io/commands/randomkey

func ParseRandomKey

func ParseRandomKey(b redis.BaseCmd) (RandomKey, error)

func (RandomKey) Run

func (cmd RandomKey) Run(w redis.Writer, red redis.Redka) (any, error)

type Rename

type Rename struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Renames a key and overwrites the destination. RENAME key newkey https://redis.io/commands/rename

func ParseRename

func ParseRename(b redis.BaseCmd) (Rename, error)

func (Rename) Run

func (cmd Rename) Run(w redis.Writer, red redis.Redka) (any, error)

type RenameNX

type RenameNX struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Renames a key only when the target key name doesn't exist. RENAMENX key newkey https://redis.io/commands/renamenx

func ParseRenameNX

func ParseRenameNX(b redis.BaseCmd) (RenameNX, error)

func (RenameNX) Run

func (cmd RenameNX) Run(w redis.Writer, red redis.Redka) (any, error)

type Scan

type Scan struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Iterates over the key names in the database. SCAN cursor [MATCH pattern] [COUNT count] https://redis.io/commands/scan

func ParseScan

func ParseScan(b redis.BaseCmd) (Scan, error)

func (Scan) Run

func (cmd Scan) Run(w redis.Writer, red redis.Redka) (any, error)

type TTL

type TTL struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Returns the expiration time in seconds of a key. TTL key https://redis.io/commands/ttl

func ParseTTL

func ParseTTL(b redis.BaseCmd) (TTL, error)

func (TTL) Run

func (cmd TTL) Run(w redis.Writer, red redis.Redka) (any, error)

type Type

type Type struct {
	redis.BaseCmd
	// contains filtered or unexported fields
}

Determines the type of value stored at a key. TYPE key https://redis.io/commands/type

func ParseType

func ParseType(b redis.BaseCmd) (Type, error)

func (Type) Run

func (cmd Type) Run(w redis.Writer, red redis.Redka) (any, error)

Jump to

Keyboard shortcuts

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