redigo

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrScriptResult = errors.New("lua script exec failed: result not 1")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(pool *redis.Pool) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, key, value string) error

Delete 删除设置的锁, 可以通过context.WithTimeout指定请求的超时时间

func (*Client) Extend

func (c *Client) Extend(ctx context.Context, key, value string, expires time.Duration) error

Extend 延长锁的过期时间, 可以通过context.WithTimeout指定请求的超时时间

func (*Client) SetNX

func (c *Client) SetNX(ctx context.Context, key, value string, expires time.Duration) error

SetNX 申请锁, 不存在时设置key和value, 可以通过context.WithTimeout指定请求的超时时间

Jump to

Keyboard shortcuts

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