redis

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-redis

package main

import (
	"context"
	"fmt"
	//"github.com/jishulangcom/go-config"
	"github.com/jishulangcom/go-redis"
)

func main() {
	// redisCnf := &config.RedisCnfDto{} // 这里可以填写自己的配置
	// redisPoolCnf := &config.RedisPoolCnfDto{} // 这里可以填写自己的配置
	redis.NewDB(nil, nil) // nil时用默认值
	defer redis.CloseDB()

	//
	redis.DB.Set(context.Background(), "site", "技术狼|jishulang.com", 0)
	val := redis.DB.Get(context.Background(), "site").Val()
	fmt.Println(val)
}

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CloseDB

func CloseDB()

func NewDB

func NewDB(redisCnf *config.RedisCnfDto, redisPoolCnf *config.RedisPoolCnfDto) *redis.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

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