mysql

package
v2.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AclTable

type AclTable struct {
	Table        string `json:"table" yaml:"table"`
	UserColumn   string `json:"user-column" yaml:"user-column"`
	TopicColumn  string `json:"topic-column" yaml:"topic-column"`
	AccessColumn string `json:"access-column" yaml:"access-column"`
}

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 mysql connection.

type AuthTable

type AuthTable struct {
	Table          string      `json:"table" yaml:"table"`
	UserColumn     string      `json:"user-column" yaml:"user-column"`
	PasswordColumn string      `json:"password-column" yaml:"password-column"`
	AllowColumn    string      `json:"allow-column" yaml:"allow-column"`
	PasswordHash   pa.HashType `json:"password-hash" yaml:"password-hash"`
	HashKey        string      `json:"hash-key" yaml:"hash-key"`
}

type DsnInfo

type DsnInfo struct {
	Host          string `json:"host" yaml:"host"`
	Port          int    `json:"port" yaml:"port"`
	Schema        string `json:"schema" yaml:"schema"`
	Charset       string `json:"charset" yaml:"charset"`
	LoginName     string `json:"login-name" yaml:"login-name"`
	LoginPassword string `json:"login-password" yaml:"login-password"`
	MaxOpenConns  int    `json:"max-open-conns" yaml:"max-open-conns"`
	MaxIdleConns  int    `json:"max-idle-conns" yaml:"max-idle-conns"`
}

type Options

type Options struct {
	pa.Blacklist
	AuthMode byte      `json:"auth-mode" yaml:"auth-mode"`
	AclMode  byte      `json:"acl-mode" yaml:"acl-mode"`
	Dsn      DsnInfo   `json:"dsn" yaml:"dsn"`
	Auth     AuthTable `json:"auth" yaml:"auth"`
	Acl      AclTable  `json:"acl" yaml:"acl"`
}

Jump to

Keyboard shortcuts

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