config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitJWTRsaKey

func InitJWTRsaKey(config JWTConfig) (*rsa.PrivateKey, error)

InitJWTRsaKey initializes RSA private key for JWT authentication

Types

type Config

type Config struct {
	Server     ServerConfig     `json:"server"`
	Logging    LoggingConfig    `json:"logging"`
	Strategies StrategiesConfig `json:"strategies"`
	JWT        JWTConfig        `json:"jwt"`
}

Config represents the application configuration

func LoadConfig

func LoadConfig(filename string) (*Config, error)

LoadConfig loads configuration from file or returns default config

type JWTConfig

type JWTConfig struct {
	PrivateKeyPath string `json:"private_key_path"`
	TokenDuration  int    `json:"token_duration"` // Token duration in hours
}

JWTConfig represents JWT authentication configuration

type LabelSelector

type LabelSelector struct {
	Key   string `json:"key"`   // Label key
	Value string `json:"value"` // Label value
}

LabelSelector represents a key-value pair for pod label selection

type LoggingConfig

type LoggingConfig struct {
	Level  string `json:"level"`
	Format string `json:"format"`
}

LoggingConfig represents logging configuration

type SchedulingStrategy

type SchedulingStrategy struct {
	Priority      bool            `json:"priority"`                // If true, set vtime to minimum vtime
	ExecutionTime uint64          `json:"execution_time"`          // Time slice for this process in nanoseconds
	PID           int             `json:"pid,omitempty"`           // Process ID to apply this strategy to
	Selectors     []LabelSelector `json:"selectors,omitempty"`     // Label selectors to match pods
	CommandRegex  string          `json:"command_regex,omitempty"` // Regex to match process command
}

SchedulingStrategy represents a strategy for process scheduling

type ServerConfig

type ServerConfig struct {
	Port         string `json:"port"`
	ReadTimeout  int    `json:"read_timeout"`
	WriteTimeout int    `json:"write_timeout"`
	IdleTimeout  int    `json:"idle_timeout"`
}

ServerConfig represents server-specific configuration

type StrategiesConfig

type StrategiesConfig struct {
	Default []SchedulingStrategy `json:"default"`
}

StrategiesConfig represents scheduling strategies configuration

Jump to

Keyboard shortcuts

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