redis

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

Auth is an auth controller which allows access to all connections and topics.

func (*Auth) ID

func (a *Auth) ID() string

ID returns the ID of the hook.

func (*Auth) Init

func (a *Auth) Init(config any) error

func (*Auth) OnACLCheck

func (a *Auth) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

OnACLCheck returns true if the connecting client has matching read or write access to subscribe or publish to a given topic.

func (*Auth) OnConnectAuthenticate

func (a *Auth) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

OnConnectAuthenticate returns true if the connecting client has rules which provide access in the auth ledger.

func (*Auth) Provides

func (a *Auth) Provides(b byte) bool

Provides indicates which hook methods this hook provides.

func (*Auth) Stop

func (a *Auth) Stop() error

Stop closes the redis connection.

type Options

type Options struct {
	pa.Blacklist
	RedisOptions  *redisOptions `json:"redis-options" yaml:"redis-options"`
	AuthMode      byte          `json:"auth-mode" yaml:"auth-mode"`
	AuthKeyPrefix string        `json:"auth-prefix" yaml:"auth-prefix"`
	AclMode       byte          `json:"acl-mode" yaml:"acl-mode"`
	AclKeyPrefix  string        `json:"acl-prefix" yaml:"acl-prefix"`
	PasswordHash  pa.HashType   `json:"password-hash" yaml:"password-hash"`
	HashKey       string        `json:"hash-key" yaml:"hash-key"`
}

Jump to

Keyboard shortcuts

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