modules

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package modules provides fx dependency injection registration for all modules.

Index

Constants

This section is empty.

Variables

View Source
var Modules = fx.Options(
	fx.Provide(func(log zerolog.Logger, cfg *config.Type) *manager.PluginManager {
		mgr := manager.NewPluginManager(cfg.Plugins, log)
		if cfg.Plugins != nil && cfg.Plugins.Enabled {
			if err := mgr.Init(context.Background(), cfg.Plugins.Config); err != nil {
				log.Error().Err(err).Msg("plugin manager init failed")
			}
		}
		return mgr
	}),

	fx.Invoke(func(mgr *manager.PluginManager, lc fx.Lifecycle) {
		lc.Append(fx.Hook{
			OnStop: func(ctx context.Context) error {
				for _, inst := range mgr.List() {
					mgr.UnloadPlugin(ctx, inst.Identity)
				}
				return nil
			},
		})
	}),

	fx.Invoke(
		example.Register,
		hub.Register,
		web.Register,
		web.SetLoginRateLimiterCache,
	),
)

Modules registers all interaction modules.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package example implements the example module demonstrating all module entry points.
Package example implements the example module demonstrating all module entry points.
Package hub implements the hub management module providing chat commands for health checks, app management, and resource tag query endpoints.
Package hub implements the hub management module providing chat commands for health checks, app management, and resource tag query endpoints.
Package web provides a web UI module with server-rendered HTML pages.
Package web provides a web UI module with server-rendered HTML pages.

Jump to

Keyboard shortcuts

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