appstate

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package appstate owns the process-wide mutable runtime state. Configuration is published as immutable snapshots so request and queue goroutines never race with an administrator-triggered reinitialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

func New

func New(initial config.Config) *State

func (*State) Config

func (s *State) Config() config.Config

Config returns the current immutable configuration snapshot.

func (*State) NodeMultiplierManager

func (s *State) NodeMultiplierManager() *nodeMultiplier.Manager

func (*State) Reinitialize

func (s *State) Reinitialize(subsystem string)

func (*State) Restart

func (s *State) Restart() error

func (*State) SetNodeMultiplierManager

func (s *State) SetNodeMultiplierManager(manager *nodeMultiplier.Manager)

func (*State) SetReinitialize

func (s *State) SetReinitialize(handler func(string))

func (*State) SetRestart

func (s *State) SetRestart(handler func() error)

func (*State) SetTelegramBot

func (s *State) SetTelegramBot(bot *tgbot.Bot)

func (*State) TelegramBot

func (s *State) TelegramBot() *tgbot.Bot

func (*State) UpdateConfig

func (s *State) UpdateConfig(update func(*config.Config))

UpdateConfig serializes partial updates and atomically publishes the result. Callers must replace nested slices/maps instead of mutating values retained from an older snapshot.

Jump to

Keyboard shortcuts

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