Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigData ¶
ConfigData holds all sections and their ordering
type FileMutexManager ¶ added in v0.9.2
type FileMutexManager struct {
// contains filtered or unexported fields
}
func NewFileMutexManager ¶ added in v0.9.2
func NewFileMutexManager() *FileMutexManager
func (*FileMutexManager) WithReadLock ¶ added in v0.9.2
func (fm *FileMutexManager) WithReadLock(path string, fn func() error) error
func (*FileMutexManager) WithWriteLock ¶ added in v0.9.2
func (fm *FileMutexManager) WithWriteLock(path string, fn func() error) error
type FormatStyle ¶
type FormatStyle int
SectionConfig manages the configuration system FormatStyle defines different configuration file formats
const ( FormatDefault FormatStyle = iota FormatSystemd FormatINI )
type PropertyType ¶
type PropertyType string
PropertyType represents the type of a configuration property
const ( TypeString PropertyType = "string" TypeInt PropertyType = "int" TypeBool PropertyType = "bool" TypeArray PropertyType = "array" TypeObject PropertyType = "object" )
type Schema ¶
type Schema struct { Type PropertyType Description string Required bool MinLength *int MaxLength *int Properties map[string]*Schema Items *Schema // For array types Pattern *string // For string validation }
Schema represents a configuration schema definition
type SectionConfig ¶
type SectionConfig struct {
// contains filtered or unexported fields
}
func NewSectionConfig ¶
func NewSectionConfig(idSchema *Schema) *SectionConfig
func (*SectionConfig) GetPlugin ¶
func (sc *SectionConfig) GetPlugin(typeName string) *SectionPlugin
func (*SectionConfig) Parse ¶
func (sc *SectionConfig) Parse(filename string) (*ConfigData, error)
Parse reads and parses a configuration file
func (*SectionConfig) RegisterPlugin ¶
func (sc *SectionConfig) RegisterPlugin(plugin *SectionPlugin)
func (*SectionConfig) Write ¶
func (sc *SectionConfig) Write(config *ConfigData) error
type SectionPlugin ¶
type SectionPlugin struct { TypeName string Properties map[string]*Schema IDProperty string Validations []ValidationFunc FolderPath string }
SectionPlugin defines the schema and behavior for a specific section type
type ValidationFunc ¶
type WatchCallback ¶
type WatchCallback func(*ConfigData)
WatchCallback is called when configuration changes are detected
Click to show internal directories.
Click to hide internal directories.