1
0
Fork 0

chore: use go generate to create Validate and Merge funcs on RoleConfigs

This commit is contained in:
Arthur K. 2026-02-01 13:14:34 +03:00
parent 28b7993be4
commit c9e93802eb
Signed by: wzray
GPG key ID: B97F30FDC4636357
10 changed files with 236 additions and 200 deletions

View file

@ -1,20 +1,8 @@
package config
//go:generate -command roleconfig go run git.wzray.com/homelab/hivemind/internal/codegen/roleconfig
//go:generate roleconfig -name DnsConfig
type DnsConfig struct {
UseSystemd bool `toml:"use_systemd"`
UseSystemd bool `toml:"use_systemd" gen:"no"`
baseRoleConfig
}
func (c DnsConfig) Validate() error {
return nil
}
func (c *DnsConfig) Merge(other DnsConfig) {
if other.set {
c.set = other.set
}
if other.UseSystemd {
c.UseSystemd = other.UseSystemd
}
}