config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package config provides generic configuration structures for the plugin system This deliberately avoids copying any Hockeypuck-specific configuration patterns to maintain AGPL license compliance

Index

Constants

View Source
const (
	DefaultPluginDirectory = "/etc/hockeypuck/plugins"
	DefaultDataDir         = "/var/lib/hockeypuck"
)

Constants for plugin system defaults only

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalPluginConfig

type GlobalPluginConfig struct {
	EventBufferSize     int    `toml:"eventBufferSize"`
	MaxConcurrentEvents int    `toml:"maxConcurrentEvents"`
	LogLevel            string `toml:"logLevel"`
	MetricsEnabled      bool   `toml:"metricsEnabled"`
	TaskTimeoutStr      string `toml:"taskTimeout"`
}

GlobalPluginConfig contains global plugin settings

func (*GlobalPluginConfig) TaskTimeout

func (g *GlobalPluginConfig) TaskTimeout() time.Duration

TaskTimeout returns the task timeout as a duration

type PluginConfig

type PluginConfig struct {
	Enabled   bool                              `toml:"enabled"`
	Directory string                            `toml:"directory"`
	LoadOrder []string                          `toml:"loadOrder"`
	Global    GlobalPluginConfig                `toml:"global"`
	Config    map[string]map[string]interface{} `toml:"config"`
}

PluginConfig configures the plugin system only

type Settings

type Settings struct {
	// Generic server information
	DataDir string

	// Plugin-specific configuration
	Plugins PluginConfig
}

Settings represents the minimal plugin system configuration This is deliberately generic to avoid AGPL license issues

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns default plugin configuration

func NewFromGeneric

func NewFromGeneric(data map[string]interface{}) *Settings

NewFromGeneric creates Settings from a generic configuration map This allows Hockeypuck to pass its config without us knowing the structure

func (*Settings) GetPluginConfig

func (s *Settings) GetPluginConfig(pluginName string) map[string]interface{}

GetPluginConfig returns configuration for a specific plugin

Jump to

Keyboard shortcuts

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