 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
const DefaultLogLevel = LogLevelInfo
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader interface {
	// Load loads configuration from all sources and validates it
	// Returns a Provider interface for accessing the configuration
	// If loading fails, returns an error with appropriate context
	Load(ctx context.Context, opts ...Option) (Provider, error)
	// Validate checks if the current configuration is valid
	// Returns nil if valid, error with validation details otherwise
	Validate() error
}
    Loader handles the loading and validation of configuration from various sources (files, environment variables, flags)
type LogLevel ¶
type LogLevel string
LogLevel represents valid logging levels
type Option ¶
type Option func(*options) error
Option defines a configuration option that can be passed to Load
func WithConfigFile ¶
WithConfigFile specifies an explicit configuration file path
func WithEnvPrefix ¶
WithEnvPrefix specifies a custom environment variable prefix Default is "NVIDIACTL"
type Provider ¶
type Provider interface {
	// GetInterval returns the update interval in seconds
	GetInterval() int
	// GetTemperature returns the maximum allowed temperature in Celsius
	GetTemperature() int
	// GetFanSpeed returns the maximum allowed fan speed percentage
	GetFanSpeed() int
	// GetHysteresis returns the required temperature change before adjusting fan speed
	GetHysteresis() int
	// IsPerformanceMode returns whether performance mode is enabled
	IsPerformanceMode() bool
	// IsMonitorMode returns whether monitor-only mode is enabled
	IsMonitorMode() bool
	// GetLogLevel returns the configured logging level
	GetLogLevel() string
	// IsMetricsEnabled returns whether metrics collection is enabled
	IsMetricsEnabled() bool
	// GetMetricsDBPath returns the path to the metrics database
	GetMetricsDBPath() string
}
    Provider defines the interface for accessing configuration values All configuration values are immutable after initial loading unless Watch functionality is implemented
type Status ¶
type Status struct {
	// Valid indicates whether the current configuration is valid
	Valid bool
	// ValidationErrors contains any validation errors if Valid is false
	ValidationErrors []ValidationError
}
    Status represents the current state of the configuration
type ValidationError ¶
type ValidationError interface {
	error
	// Field returns the name of the invalid field
	Field() string
	// Value returns the invalid value
	Value() interface{}
	// Reason returns why the value is invalid
	Reason() string
}
    ValidationError represents a configuration validation error