metathings_plugin_vernemq_storage

package
v1.3.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPTION_STORAGE = "storage"
)

Variables

View Source
var (
	WithStorage, GetStorage = option.New[Storage](OPTION_STORAGE)

	Register, New = registerer.Pair[Storage]()
)

Functions

func ParseVernemqRedisKey

func ParseVernemqRedisKey(clientid, username string) string

Types

type PublishAcl

type PublishAcl struct {
	Pattern string `json:"pattern"`
	MaxQos  int    `json:"max_qos,omitempty"`
}

type RedisStorage

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

func (*RedisStorage) CreateOrUpdateUser

func (s *RedisStorage) CreateOrUpdateUser(user *User) error

func (*RedisStorage) GetLogger

func (s *RedisStorage) GetLogger() logrus.FieldLogger

func (*RedisStorage) RemoveUser

func (s *RedisStorage) RemoveUser(clientid, username string) error

type Storage

type Storage interface {
	CreateOrUpdateUser(user *User) error
	RemoveUser(clientid, username string) error
}

func NewRedisStorage

func NewRedisStorage(opts ...option.ApplyOption) (Storage, error)

type SubscribeAcl

type SubscribeAcl struct {
	Pattern        string `json:"pattern"`
	MaxQos         int    `json:"max_qos,omitempty"`
	MaxPayloadSize int    `json:"max_payload_size,omitempty"`
	AllowedRetain  bool   `json:"allowed_retain,omitempty"`
}

type User

type User struct {
	MountPoint    string         `json:"mountpoint"`
	ClientID      string         `json:"client_id"`
	Username      string         `json:"username"`
	Passhash      string         `json:"passhash"`
	PublishAcls   []PublishAcl   `json:"publish_acl"`
	SubscribeAcls []SubscribeAcl `json:"subscribe_acl"`
}

Jump to

Keyboard shortcuts

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