redis

package module
v0.0.0-...-b156b4d Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locator

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

func NewLocator

func NewLocator(opts ...Option) *Locator

func (*Locator) Get

func (l *Locator) Get(ctx context.Context, uid int64, insKind cluster.Kind) (string, error)

Get 获取用户定位

func (*Locator) Rem

func (l *Locator) Rem(ctx context.Context, uid int64, insKind cluster.Kind, insID string) error

Rem 移除用户定位

func (*Locator) Set

func (l *Locator) Set(ctx context.Context, uid int64, insKind cluster.Kind, insID string) error

Set 设置用户定位

func (*Locator) Watch

func (l *Locator) Watch(ctx context.Context, insKinds ...cluster.Kind) (locator.Watcher, error)

Watch 监听用户定位变化

type Option

type Option func(o *options)

func WithAddrs

func WithAddrs(addrs ...string) Option

WithAddrs 设置连接地址

func WithClient

func WithClient(client redis.UniversalClient) Option

WithClient 设置外部客户端

func WithContext

func WithContext(ctx context.Context) Option

WithContext 设置上下文

func WithDB

func WithDB(db int) Option

WithDB 设置数据库号

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

WithMaxRetries 设置最大重试次数

func WithPassword

func WithPassword(password string) Option

WithPassword 设置密码

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix 设置前缀

func WithUsername

func WithUsername(username string) Option

WithUsername 设置用户名

Jump to

Keyboard shortcuts

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