redis

package module
v0.0.0-...-6e686d7 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 12 Imported by: 1

README

Usage redis auth plugin

add config section to conf/app.ini

[auth]
; define auth plugin provider is redis
plugin = redis
ttl = 0
max_tokens = 0

; 0.AuthDiscardOld(recommended)
; 1.AuthDiscardNew(deny new connect)
; don't change this value,otherwise you really know what's this parame
discard = 0
[auth.public]
; public account is useful
enable = true
username = mqtt
password = public

[auth.plugin.redis]
; redis server
server = 127.0.0.1:6379
; redis db number
db = 3
; redis connect userName
username = 
; redis connect passWord
password = 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(conf face.Conf) face.Auth

func New

func New(conf face.Conf) (face.Auth, error)

Types

type Option

type Option func(*Options) error

func WithPrefix

func WithPrefix(prefix string) Option

func WithRedisAddr

func WithRedisAddr(addr string) Option

func WithRedisDB

func WithRedisDB(db int) Option

type Options

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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