Update to network version 9.0.114

This commit is contained in:
2025-04-14 12:03:26 +02:00
parent 73d68d5ac1
commit bce4a5bdfd
16 changed files with 685 additions and 225 deletions

View File

@@ -27,8 +27,9 @@ type SettingDoh struct {
Key string `json:"key"`
ServerNames []string `json:"server_names,omitempty"`
State string `json:"state,omitempty"` // off|auto|manual
CustomServers []SettingDohCustomServers `json:"custom_servers,omitempty"`
ServerNames []string `json:"server_names,omitempty"`
State string `json:"state,omitempty"` // off|auto|manual|custom
}
func (dst *SettingDoh) UnmarshalJSON(b []byte) error {
@@ -47,6 +48,28 @@ func (dst *SettingDoh) UnmarshalJSON(b []byte) error {
return nil
}
type SettingDohCustomServers struct {
Enabled bool `json:"enabled"`
SdnsStamp string `json:"sdns_stamp,omitempty"`
ServerName string `json:"server_name,omitempty"`
}
func (dst *SettingDohCustomServers) UnmarshalJSON(b []byte) error {
type Alias SettingDohCustomServers
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
func (c *Client) getSettingDoh(ctx context.Context, site string) (*SettingDoh, error) {
var respBody struct {
Meta meta `json:"meta"`