redis

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

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 13 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) BindGate

func (l *Locator) BindGate(ctx context.Context, uid int64, gid string) error

BindGate 绑定网关

func (*Locator) BindNode

func (l *Locator) BindNode(ctx context.Context, uid int64, name, nid string) error

BindNode 绑定节点

func (*Locator) LocateGate

func (l *Locator) LocateGate(ctx context.Context, uid int64) (string, error)

LocateGate 定位用户所在网关

func (*Locator) LocateNode

func (l *Locator) LocateNode(ctx context.Context, uid int64, name string) (string, error)

LocateNode 定位用户所在节点

func (*Locator) UnbindGate

func (l *Locator) UnbindGate(ctx context.Context, uid int64, gid string) error

UnbindGate 解绑网关

func (*Locator) UnbindNode

func (l *Locator) UnbindNode(ctx context.Context, uid int64, name string, nid string) error

UnbindNode 解绑节点

func (*Locator) Watch

func (l *Locator) Watch(ctx context.Context, kinds ...cluster.Kind) (locate.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