config

package
v3.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBytes

func FromBytes(b []byte) (*mqtt.Options, error)

FromBytes unmarshals a byte slice of JSON or YAML config data into a valid server options value. Any hooks configurations are converted into Hooks using the toHooks methods in this package.

Types

type HookAuthConfig

type HookAuthConfig struct {
	Ledger   auth.Ledger `yaml:"ledger" json:"ledger"`
	AllowAll bool        `yaml:"allow_all" json:"allow_all"`
}

HookAuthConfig contains configurations for the auth hook.

type HookConfigs

type HookConfigs struct {
	Auth    *HookAuthConfig    `yaml:"auth" json:"auth"`
	Storage *HookStorageConfig `yaml:"storage" json:"storage"`
	Debug   *debug.Options     `yaml:"debug" json:"debug"`
}

HookConfigs contains configurations to enable individual hooks.

func (HookConfigs) ToHooks

func (hc HookConfigs) ToHooks() []mqtt.HookLoadConfig

ToHooks converts Hook file configurations into Hooks to be added to the server.

type HookStorageConfig

type HookStorageConfig struct {
	Badger *badger.Options `yaml:"badger" json:"badger"`
	Bolt   *bolt.Options   `yaml:"bolt" json:"bolt"`
	Pebble *pebble.Options `yaml:"pebble" json:"pebble"`
	Redis  *redis.Options  `yaml:"redis" json:"redis"`
}

HookStorageConfig contains configurations for the different storage hooks.

type LoggingConfig

type LoggingConfig struct {
	Level string
}

func (LoggingConfig) ToLogger

func (lc LoggingConfig) ToLogger() *slog.Logger

Jump to

Keyboard shortcuts

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