Avec un parser soap un peu plus modulaire et un debut de ControlHandler sur les services qui fait des choses

This commit is contained in:
2025-09-07 11:45:43 +02:00
parent 437d9db4b7
commit a04f8cce6b
9 changed files with 368 additions and 42 deletions

View File

@@ -3,6 +3,7 @@ package statevariables
import (
"encoding/base64"
"encoding/hex"
"errors"
"fmt"
"net/url"
"reflect"
@@ -88,6 +89,17 @@ func (instance *StateVarInstance) AllowedValues() []interface{} {
return instance.allowedValues
}
func (instance *StateVarInstance) HasParser() bool {
return instance.parse != nil
}
func (instance *StateVarInstance) ParseValue(value string) (interface{}, error) {
if instance.parse == nil {
return value, errors.New("Not parsed value")
}
return instance.parse(value)
}
// IsValueInRange checks if a value falls within the defined range.
// Always returns true if no range is set.