redis

package
v0.0.0-...-0864a4c Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenConsumeKey

func GenConsumeKey(red *redis.Client, originKey string, suffix string) (string, error)

func GenTempKey

func GenTempKey(red *redis.Client, originKey string, suffix string) (string, error)

*

func Intersect

func Intersect(red *redis.Client, key string, arr []uint64) ([]uint64, error)

*

  • 与 Redis 中的 Set 取交集
  • 将 arr 放入临时键中再使用 SINTER 命令

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MultiUnmarshal

func MultiUnmarshal(vals []interface{}, out interface{})

func MultiUnmarshalStr

func MultiUnmarshalStr(vals []string, out interface{})

func ReleaseTempKey

func ReleaseTempKey(red *redis.Client, key string) error

func Setup

func Setup(settings *Settings) (*redis.Client, error)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Types

type Settings

type Settings struct {
	Host        string        `yaml:"host"`
	Password    string        `yaml:"password"`
	DB          int           `yaml:"db"`
	PoolSize    int           `yaml:"pool-size"`
	PoolTimeout time.Duration `yaml:"pool-timeout"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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