cache

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(addr, password, prefix string, db int) (*Cache, error)

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, request *DeleteRequest) (int64, error)

func (*Cache) Exists

func (c *Cache) Exists(ctx context.Context, request *ExistsRequest) (bool, error)

func (*Cache) Expire

func (c *Cache) Expire(ctx context.Context, request *ExpireRequest) (bool, error)

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, request *GetCacheRequest) (string, error)

Get Redis `GET key` command. It returns redis.Nil error when key does not exist.

func (*Cache) GetListIndex

func (c *Cache) GetListIndex(ctx context.Context, request *GetListIndexRequest) (int, error)

func (*Cache) Inc

func (c *Cache) Inc(ctx context.Context, request *IncRequest) (int64, error)

func (*Cache) IncrBy

func (c *Cache) IncrBy(ctx context.Context, request *IncrByRequest) (int64, error)

func (*Cache) LPop

func (c *Cache) LPop(ctx context.Context, request *LPopRequest) (string, error)

func (*Cache) LPush

func (c *Cache) LPush(ctx context.Context, request *LPushRequest) (int64, error)

func (*Cache) RPop

func (c *Cache) RPop(ctx context.Context, request *RPopRequest) (string, error)

func (*Cache) Set

func (c *Cache) Set(ctx context.Context, request *SetCacheRequest) error

Set Redis `SET key value [expiration]` command.

func (*Cache) TTL

func (c *Cache) TTL(ctx context.Context, request *TTLRequest) (time.Duration, error)

func (*Cache) ZAdd

func (c *Cache) ZAdd(ctx context.Context, request *ZAddRequest) (int64, error)

func (*Cache) ZCard

func (c *Cache) ZCard(ctx context.Context, request *ZCardRequest) (int64, error)

func (*Cache) ZRange

func (c *Cache) ZRange(ctx context.Context, request *ZRangeRequest) ([]string, error)

func (*Cache) ZRank

func (c *Cache) ZRank(ctx context.Context, request *ZRankRequest) (int64, error)

func (*Cache) ZRem

func (c *Cache) ZRem(ctx context.Context, request *ZRemRequest) (int64, error)

func (*Cache) ZScan

func (c *Cache) ZScan(ctx context.Context, request *ZScanRequest) ([]string, uint64, error)

type DeleteRequest added in v0.0.9

type DeleteRequest struct {
	Key    string
	Prefix *string
}

type ExistsRequest added in v0.0.9

type ExistsRequest struct {
	Key    string
	Prefix *string
}

type ExpireRequest added in v0.0.9

type ExpireRequest struct {
	Key     string
	Seconds int64
	Prefix  *string
}

type GetCacheRequest added in v0.0.9

type GetCacheRequest struct {
	Key    string
	Prefix *string
}

type GetListIndexRequest added in v0.0.9

type GetListIndexRequest struct {
	Key    string
	Value  string
	Prefix *string
}

type IncRequest added in v0.0.9

type IncRequest struct {
	Key    string
	Prefix *string
}

type IncrByRequest added in v0.0.9

type IncrByRequest struct {
	Key    string
	Value  int64
	Prefix *string
}

type LPopRequest added in v0.0.9

type LPopRequest struct {
	Key    string
	Prefix *string
}

type LPushRequest added in v0.0.9

type LPushRequest struct {
	Key    string
	Value  []interface{}
	Prefix *string
}

type RPopRequest added in v0.0.9

type RPopRequest struct {
	Key    string
	Prefix *string
}

type SetCacheRequest added in v0.0.9

type SetCacheRequest struct {
	Key     string
	Value   []byte
	Seconds int64
	Prefix  *string
}

type TTLRequest added in v0.0.9

type TTLRequest struct {
	Key    string
	Prefix *string
}

type ZAddRequest added in v0.0.9

type ZAddRequest struct {
	Key     string
	Members []*redis.Z
	Prefix  *string
}

type ZCardRequest added in v0.0.9

type ZCardRequest struct {
	Key    string
	Prefix *string
}

type ZRangeRequest added in v0.0.9

type ZRangeRequest struct {
	Key    string
	Start  int64
	End    int64
	Prefix *string
}

type ZRankRequest added in v0.0.9

type ZRankRequest struct {
	Key    string
	Member string
	Prefix *string
}

type ZRemRequest added in v0.0.9

type ZRemRequest struct {
	Key     string
	Members []interface{}
	Prefix  *string
}

type ZScanRequest added in v0.0.9

type ZScanRequest struct {
	Key    string
	Cursor uint64
	Match  string
	Count  int64
	Prefix *string
}

Jump to

Keyboard shortcuts

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