chore: use go generate to create Validate and Merge funcs on RoleConfigs
This commit is contained in:
parent
28b7993be4
commit
c9e93802eb
10 changed files with 236 additions and 200 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue