Standardize codebase consistency: naming, JSON tags, logging, error wrapping

- JSON tags: fix snake_case to camelCase in dnsmasq (configFile, domainsConfigured,
  lastRestart), crowdsec Machine (lastPush, lastHeartbeat), network (primaryIP,
  primaryInterface). cscli raw parsing structs keep snake_case to match CLI output.
- Error wrapping: fix %v to %w in enableAuthelia for proper error chain preservation
- Naming: rename dnsmasq.ConfigGenerator to dnsmasq.Manager (matches all other packages),
  rename ServiceStatus to Status in dnsmasq and haproxy (matches authelia, crowdsec, etc.)
- Logging: standardize all slog calls to use "component" key instead of message prefixes.
  Affects reconcile, dnsfilter, ddns — now consistent with dnsmasq, haproxy, nftables, sse.
This commit is contained in:
2026-07-14 04:38:48 +00:00
parent 428d47f876
commit 3172e56288
13 changed files with 135 additions and 116 deletions

View File

@@ -572,8 +572,8 @@ func (m *Manager) RestartService() error {
return nil
}
// ServiceStatus represents the status of the HAProxy service
type ServiceStatus struct {
// Status represents the status of the HAProxy service
type Status struct {
Status string `json:"status"`
PID int `json:"pid"`
ConfigFile string `json:"configFile"`
@@ -581,8 +581,8 @@ type ServiceStatus struct {
}
// GetStatus returns the current HAProxy service status
func (m *Manager) GetStatus() (*ServiceStatus, error) {
status := &ServiceStatus{
func (m *Manager) GetStatus() (*Status, error) {
status := &Status{
ConfigFile: m.configPath,
}