Documentation
¶
Index ¶
Constants ¶
View Source
const BuiltInMode = "c2hlbgo"
BuiltInMode represents a special build tag for built-in extension mode To enable built-in mode, build or run with tag: go build/run -tags="c2hlbgo"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Mode string `json:"mode" yaml:"mode"`
Path string `json:"path" yaml:"path"`
Includes []string `json:"includes" yaml:"includes"`
Excludes []string `json:"excludes" yaml:"excludes"`
HotReload bool `json:"hot_reload" yaml:"hot_reload"`
MaxPlugins int `json:"max_plugins" yaml:"max_plugins"`
PluginConfig map[string]any `json:"plugin_config" yaml:"plugin_config"`
Security *SecurityConfig `json:"security" yaml:"security"`
Performance *PerformanceConfig `json:"performance" yaml:"performance"`
Metrics *MetricsConfig `json:"metrics" yaml:"metrics"`
}
Config extension config struct
func (*Config) IsBuiltInMode ¶
IsBuiltInMode checks if running in built-in mode
type MetricsConfig ¶
type MetricsConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
FlushInterval string `json:"flush_interval" yaml:"flush_interval"`
BatchSize int `json:"batch_size" yaml:"batch_size"`
Retention string `json:"retention" yaml:"retention"`
Storage *StorageConfig `json:"storage" yaml:"storage"`
}
MetricsConfig metrics configuration
func (*MetricsConfig) GetRetentionDuration ¶
func (m *MetricsConfig) GetRetentionDuration() (time.Duration, error)
GetRetentionDuration returns the retention duration
func (*MetricsConfig) Validate ¶
func (m *MetricsConfig) Validate() error
Validate validates the metrics configuration
type PerformanceConfig ¶
type PerformanceConfig struct {
MaxMemoryMB int `json:"max_memory_mb" yaml:"max_memory_mb"`
MaxCPUPercent int `json:"max_cpu_percent" yaml:"max_cpu_percent"`
GarbageCollectInterval string `json:"gc_interval" yaml:"gc_interval"`
MaxConcurrentLoads int `json:"max_concurrent_loads" yaml:"max_concurrent_loads"`
}
PerformanceConfig performance settings
type SecurityConfig ¶
type SecurityConfig struct {
EnableSandbox bool `json:"enable_sandbox" yaml:"enable_sandbox"`
AllowedPaths []string `json:"allowed_paths" yaml:"allowed_paths"`
BlockedExtensions []string `json:"blocked_extensions" yaml:"blocked_extensions"`
TrustedSources []string `json:"trusted_sources" yaml:"trusted_sources"`
RequireSignature bool `json:"require_signature" yaml:"require_signature"`
AllowUnsafe bool `json:"allow_unsafe" yaml:"allow_unsafe"`
}
SecurityConfig security settings
Click to show internal directories.
Click to hide internal directories.