config

package
v0.0.0-...-252e742 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package config provides public APIs for reading, saving, reloading, and resetting RedisSMQ system configuration.

Configuration is stored in Redis and shared across all connected instances. Changes are propagated automatically over the internal event bus using version-controlled updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close releases the configuration singleton.

func Get

func Get() *cfg.Config

Get returns the current configuration.

It panics if Init has not been called.

func Init

func Init(ctx context.Context) error

Init initializes the configuration singleton.

It is safe to call multiple times; subsequent calls are no-ops. If no configuration exists in Redis, default configuration is saved.

func Reload

func Reload(ctx context.Context) error

Reload reloads the configuration from Redis.

If the configuration cannot be loaded, default configuration is saved and used instead.

func Reset

func Reset(ctx context.Context) error

Reset restores the configuration to factory defaults.

func Save

func Save(ctx context.Context, c *cfg.Config) (int, error)

Save persists the given configuration and publishes an update event.

Use config.Get() to obtain the current config, modify fields as needed, then pass the result to Save. The config replaces the entire stored configuration.

It returns the new configuration version.

Types

This section is empty.

Directories

Path Synopsis
Package cfg defines the public configuration structures used by RedisSMQ.
Package cfg defines the public configuration structures used by RedisSMQ.

Jump to

Keyboard shortcuts

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