package configure import ( "os" "encoding/json" ) type Config struct { DbFile string `json:"db_file"` // optional DB File LogFile string `json:"log_file"` // optional Log File MailProg string `json:"mail_prog"` // optional Mail Program ProtectedDirs []string `json:"protected_dirs"` AlertEmail string `json:"alert_email"` // optional root@localhost SkipDirs []string `json:"skip_dirs"` ScanInterval int `json:"scan_interval"` // in minutes, 0 disables scan Passphrase string `json:"passphrase"` // optional hash encryption key HashEncryption string `json:"hash_encryption"` // "none", "xor", or "xxtea" HashType string `json:"hash_type"` // "sha256" or "sha512" } func LoadConfig(configFile string) (*Config, error) { data, err := os.ReadFile(configFile) if err != nil { return nil, err } var cfg Config if err := json.Unmarshal(data, &cfg); err != nil { return nil, err } return &cfg, nil }